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

Correct tensor copy misuse #10412

Merged
merged 5 commits into from
May 7, 2018

Conversation

JiayiFeng
Copy link
Collaborator

@JiayiFeng JiayiFeng commented May 4, 2018

Correct misusing of TensorCopy in following ops or op tests:

concat_test
sequence_padding_test
multiplex_op
sequence_slice_op
lod_reset_op

Copy link
Contributor

@chengduoZH chengduoZH left a comment

Choose a reason for hiding this comment

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

If we replace cudaMalloc with cudaMallocHost, the memory::Copy should have sync and async operation respectively, because someplace call memory::Copy directly. For example

memory::Copy(dst_place, dst_ptr,
boost::get<platform::CPUPlace>(src.place()), src_ptr, size);

@JiayiFeng
Copy link
Collaborator Author

In current design, memcpy takes an cudaStream_t argument. If this argument is nullptr, the memcpy will be synchronous. @chengduoZH

Copy link
Contributor

@chengduoZH chengduoZH left a comment

Choose a reason for hiding this comment

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

LGTM!

@JiayiFeng JiayiFeng merged commit b708ec0 into PaddlePaddle:develop May 7, 2018
@JiayiFeng JiayiFeng deleted the correct_TensorCopy_misuse branch May 7, 2018 03:51
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.

None yet

2 participants