Skip to content

Delete DeviceGuard(int64_t) constructor.#13232

Closed
ezyang wants to merge 12 commits intoexport-D10855883from
export-D10858024
Closed

Delete DeviceGuard(int64_t) constructor.#13232
ezyang wants to merge 12 commits intoexport-D10855883from
export-D10858024

Conversation

@ezyang
Copy link
Copy Markdown
Contributor

@ezyang ezyang commented Oct 29, 2018

Stack:
    :white_circle:  #13133 Add c10::Stream, make at::cuda::CUDAStream use it.  💛
    :black_circle:  #13232 Delete DeviceGuard(int64_t) constructor.  💛
    :white_circle:  #13275 Replace CUDA-specific set_index(_from) method from DeviceGuard with set_device.  💛
    :white_circle:  #13342 Generalize DeviceGuard to work with arbitrary DeviceType.  💛

DeviceGuard should be device agnostic, which means that it shouldn't
assume that int64_t means select the CUDA device.

Differential Revision: D10858024

Differential Revision: D10858024
Differential Version: 61911842
Differential Revision: D10858024
Differential Version: 61940689
Differential Revision: D10858024
Differential Version: 61943786
Differential Revision: D10858024
Differential Version: 61944580
Differential Revision: D10858024
Differential Version: 61945978
Differential Revision: D10858024
Differential Version: 61950975
Differential Revision: D10858024
Differential Version: 61951987
@teng-li
Copy link
Copy Markdown
Contributor

teng-li commented Oct 29, 2018

CI is failing

Differential Revision: D10858024
Differential Version: 61956053
Differential Revision: D10858024
Differential Version: 61998100
if (should_compute_output(1)) {
at::DeviceGuard device_guard(src_device);
if (grad.is_cuda() && grad.get_device() != src_device) {
if (grad.device() != src_device) {

This comment was marked as off-topic.


const int32_t tensor_device = self.is_cuda() ? self.get_device() : -1;
at::DeviceGuard device_guard(device_index.value_or(tensor_device));
at::DeviceGuard device_guard(self.device());

This comment was marked as off-topic.

Differential Revision: D10858024
Differential Version: 62022323
Differential Revision: D10858024
Differential Version: 62043486
Differential Revision: D10858024
Differential Version: 62135960
zdevito pushed a commit to zdevito/ATen that referenced this pull request Oct 31, 2018
Summary:
Pull Request resolved: pytorch/pytorch#13232

DeviceGuard should be device agnostic, which means that it shouldn't
assume that int64_t means select the CUDA device.

Reviewed By: gchanan

Differential Revision: D10858024

fbshipit-source-id: b40e8337e4046906fd8f83a95e6206367fb29dbe
@ezyang ezyang added the merged label Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants