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

Prevent CUDAFuture from using uninitialized device index #51505

Closed
wants to merge 2 commits into from

Conversation

mrshenli
Copy link
Contributor

@mrshenli mrshenli commented Feb 1, 2021

Stack from ghstack:

Differential Revision: D26187380

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Feb 1, 2021

💊 CI failures summary and remediations

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


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-CircleCI failure(s)

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.

@mrshenli mrshenli changed the title Prevent CUDAFuture using uninitialized device index Prevent CUDAFuture from using uninitialized device index Feb 1, 2021
@mrshenli mrshenli requested a review from lw February 1, 2021 23:58
@codecov
Copy link

codecov bot commented Feb 2, 2021

Codecov Report

Merging #51505 (dacfdbf) into gh/mrshenli/290/base (718e4b1) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@                   Coverage Diff                    @@
##           gh/mrshenli/290/base   #51505      +/-   ##
========================================================
- Coverage                 80.86%   80.86%   -0.01%     
========================================================
  Files                      1942     1942              
  Lines                    211376   211376              
========================================================
- Hits                     170926   170925       -1     
- Misses                    40450    40451       +1     

Copy link
Contributor

@lw lw left a comment

Choose a reason for hiding this comment

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

This works for me. An alternative to possibly consider (up to you) is to store the current device as an optional<...>, and thus then use at::cuda::OptionalCUDAGuard, in order to leave the current device entirely untouched in case of error.

@facebook-github-bot
Copy link
Contributor

@mrshenli merged this pull request in a3f2fe0.

@facebook-github-bot facebook-github-bot deleted the gh/mrshenli/290/head branch February 7, 2021 15:21
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.

None yet

3 participants