Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refine save numpy #57040

Merged
merged 2 commits into from
Sep 7, 2023
Merged

Conversation

wanghuancoder
Copy link
Contributor

@wanghuancoder wanghuancoder commented Sep 6, 2023

PR types

Others

PR changes

Others

Description

Pcard-74613
先将Tensor拷贝到CPU再转numpy:
numpy会拷贝Tensor的所有显存,而不是按需拷贝,导致CUDA Tensor save时间太长。
tensor.cpu会调用phi::Copy。这里如果Tensor是不连续的,会转成连续。再做按需拷贝。

Copy link
Contributor

@wawltor wawltor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wanghuancoder wanghuancoder merged commit 2fbebfd into PaddlePaddle:develop Sep 7, 2023
BeingGod pushed a commit to BeingGod/Paddle that referenced this pull request Sep 9, 2023
@Xiadalei Xiadalei mentioned this pull request Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants