Skip to content

Conversation

@ssnl
Copy link
Collaborator

@ssnl ssnl commented Aug 23, 2018

Commits:

  1. Make torch.cuda.* take device objects
  2. Update torch.distributed docs to emphasize calling torch.cuda.set_device before init_process_group

Copy link
Contributor

@li-roy li-roy left a 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.

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.

# 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.

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.

Copy link
Contributor

@weiyangfb weiyangfb left a comment

Choose a reason for hiding this comment

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

shipit shipit

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

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
@ssnl ssnl deleted the dist_dev branch December 8, 2018 08:22
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.

6 participants