Skip to content

Conversation

@bairdzhang
Copy link
Contributor

Summary:
It seems lengths_host_.CopyFrom(lengthsInput, &context_); is asynchronous w.r.t. the host while lengths_host_.CopyFrom(lengthsInput); is synchronous.

However, according to jerryzh168, lengths_host_.CopyFrom(lengths, &context_); context_.FinishDeviceComputation(); is the safest way to guarantee synchronization.

Differential Revision: D9197923

…ngthsTileOp (pytorch#10360)

Summary:
Pull Request resolved: pytorch#10360

It seems `lengths_host_.CopyFrom(lengthsInput, &context_);` is asynchronous w.r.t. the host while `lengths_host_.CopyFrom(lengthsInput);` is synchronous.

However, according to jerryzh168,  `lengths_host_.CopyFrom(lengths, &context_); context_.FinishDeviceComputation();` is the safest way to guarantee synchronization.

Reviewed By: jerryzh168

Differential Revision: D9197923

fbshipit-source-id: 47523ddc05f9f4eb9e288a4f0cf2625070777e9d
goodlux pushed a commit to goodlux/pytorch that referenced this pull request Aug 15, 2018
…ngthsTileOp (pytorch#10360)

Summary:
Pull Request resolved: pytorch#10360

It seems `lengths_host_.CopyFrom(lengthsInput, &context_);` is asynchronous w.r.t. the host while `lengths_host_.CopyFrom(lengthsInput);` is synchronous.

However, according to jerryzh168,  `lengths_host_.CopyFrom(lengths, &context_); context_.FinishDeviceComputation();` is the safest way to guarantee synchronization.

Reviewed By: jerryzh168

Differential Revision: D9197923

fbshipit-source-id: 827eb63d9d15c1274851e8301a793aed39d4fa6b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants