Skip to content

Conversation

@li-roy
Copy link
Contributor

@li-roy li-roy commented May 9, 2019

Stack from ghstack:

Differential Revision: D15276094

@pytorchbot pytorchbot added module: cuda Related to torch.cuda, and CUDA support in general module: operators labels May 9, 2019
@li-roy li-roy requested review from colesbury and ezyang May 9, 2019 18:30
@colesbury
Copy link
Member

I think you can test this with something like the following pseudo-code:

x = torch.empty(10, pinned_memory=True)
y = torch.randn(10, device='cuda')
torch.cuda._sleep(...)
event = torch.cuda.Event().record()
x.copy_(y, non_blocking=True)
# check that event hasn't occurred (i.e that the copy is really non-blocking)
# synchronize
# check that x and y are equal

@ezyang
Copy link
Contributor

ezyang commented May 10, 2019

Yes, a test would be great

Fix bug in non_blocking copy

gh-metadata: pytorch pytorch 20305 gh/li-roy/12/head
@zou3519 zou3519 deleted the gh/li-roy/12/head branch May 11, 2019 22:22
zdevito pushed a commit to zdevito/ATen that referenced this pull request May 11, 2019
Summary:
Pull Request resolved: pytorch/pytorch#20305
ghimport-source-id: eb3dacb10fd93bbb5a6bbe078ed1ec842163d0e6

Differential Revision: D15276094

Pulled By: li-roy

fbshipit-source-id: 4728f419aa050e6c94a4f62231fa1a86caa556a7
@facebook-github-bot
Copy link
Contributor

@li-roy merged this pull request in 163f0e1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: cuda Related to torch.cuda, and CUDA support in general

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants