Make torch.cuda.* take device objects; Update distributed docs#10833
Closed
ssnl wants to merge 5 commits intopytorch:masterfrom
Closed
Make torch.cuda.* take device objects; Update distributed docs#10833ssnl wants to merge 5 commits intopytorch:masterfrom
ssnl wants to merge 5 commits intopytorch:masterfrom
Conversation
…ice before init_process_group
li-roy
reviewed
Aug 24, 2018
Contributor
li-roy
left a comment
There was a problem hiding this comment.
Changes look good! Small comments.
torch/cuda/_utils.py
Outdated
| if isinstance(device, torch.device): | ||
| dev_type = device.type | ||
| if device.type != 'cuda': | ||
| raise ValueError('Execpted a cuda device, but got: {}'.format(device)) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/cuda/_utils.py
Outdated
| # default cuda device | ||
| return current_device() | ||
| else: | ||
| raise ValueError('Execpted a cuda device or a device index, but got: None') |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/cuda/__init__.py
Outdated
| @@ -258,6 +259,7 @@ def set_device(device): | |||
| device (int): selected device. This function is a no-op if this | |||
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
apaszke
approved these changes
Aug 27, 2018
Contributor
facebook-github-bot
left a comment
There was a problem hiding this comment.
SsnL has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
PenghuiCheng
pushed a commit
to PenghuiCheng/pytorch
that referenced
this pull request
Sep 11, 2018
…ch#10833) Summary: Commits: 1. Make `torch.cuda.*` take device objects 2. Update `torch.distributed` docs to emphasize calling `torch.cuda.set_device` before `init_process_group` Pull Request resolved: pytorch#10833 Differential Revision: D9514241 Pulled By: SsnL fbshipit-source-id: 2497464305fb1e63d6c495291a5744aaa7e2696e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commits:
torch.cuda.*take device objectstorch.distributeddocs to emphasize callingtorch.cuda.set_devicebeforeinit_process_group