KEMBAR78
[CUDA graphs] hotfix for test_graph_grad_scaling on windows by mcarilli · Pull Request #64339 · pytorch/pytorch · GitHub
Skip to content

Conversation

@mcarilli
Copy link
Collaborator

@mcarilli mcarilli commented Sep 1, 2021

Graphed workloads that try to capture a full backward pass must do warmup on a non-default stream. If warmup happens on the default stream, AccumulateGrad functions might tag themselves to run on the default stream, and therefore won't be capturable.

@ngimel and I suspect on windows, some test_cuda.py tests run with the default stream as the ambient stream, which breaks test_graph_grad_scaling because test_graph_grad_scaling does warmup on the ambient stream (it assumes the ambient stream is a non-default stream).

This PR explicitly sets a side stream for the warmup in test_graph_grad_scaling, which is what I should have done all along because it's what the new documentation recommends.

I pushed the PR branch straight to the main pytorch repo in case we need to run ci-all on it (I'm not sure what the requirements are these days).

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Sep 1, 2021

🔗 Helpful links

💊 CI failures summary and remediations

As of commit 3baec78 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@facebook-github-bot
Copy link
Contributor

@ngimel has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@mcarilli mcarilli added the module: cuda graphs Ability to capture and then replay streams of CUDA kernels label Sep 1, 2021
@mcarilli mcarilli changed the title [CUDA graphs] hotfix for test_graph_ [CUDA graphs] hotfix for test_graph_grad_scaling on windows Sep 1, 2021
@facebook-github-bot
Copy link
Contributor

@ngimel merged this pull request in 24e50b8.

@mcarilli mcarilli deleted the windows_test_graph_grad_scaling_hotfix branch September 10, 2021 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed Merged module: cuda graphs Ability to capture and then replay streams of CUDA kernels open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants