-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Make torch.cuda.* take device objects; Update distributed docs #10833
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
Conversation
…ice before init_process_group
li-roy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
| cases it's better to use ``CUDA_VISIBLE_DEVICES`` environmental variable. | ||
| Arguments: | ||
| 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.
weiyangfb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shipit shipit
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SsnL has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
…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
Commits:
torch.cuda.*take device objectstorch.distributeddocs to emphasize callingtorch.cuda.set_devicebeforeinit_process_group