Skip to content

Introduce at::DeviceType, which subsumes at::Device::Type and (partially) caffe2::DeviceType#10175

Closed
ezyang wants to merge 5 commits intopytorch:masterfrom
ezyang:export-D9137156
Closed

Introduce at::DeviceType, which subsumes at::Device::Type and (partially) caffe2::DeviceType#10175
ezyang wants to merge 5 commits intopytorch:masterfrom
ezyang:export-D9137156

Conversation

@ezyang
Copy link
Contributor

@ezyang ezyang commented Aug 2, 2018

Summary:
Previously, we had at::Device::Type and caffe2::DeviceType (from protobuf),
intended to help us distinguish between CPU, CUDA, etc. devices.

This replaces at::Device::Type entirely with at::DeviceType, which in turn
is a direct, 'enum class' version of the protobuf generated caffe2::DeviceType
'enum'. We can't eliminate the 'enum' because this would a pretty drastic
API change (enum is interconvertible with integers, enum class is not) but
we can make the two line up exactly and share code for, e.g., printing.

Differential Revision: D9137156

Copy link
Contributor

@Yangqing Yangqing left a comment

Choose a reason for hiding this comment

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

Stamping

@ezyang
Copy link
Contributor Author

ezyang commented Aug 2, 2018

This PR is blocked on unifying at::Error and caffe2::EnforceNotMet; change of CAFFE2_ENFORCE to AT_ERROR is not semantics preserving.

ezyang added 5 commits August 3, 2018 14:34
Summary:
It doesn't work with Caffe2; use AT_CORE_API from ATen/core/CoreAPI.h
instead.

Differential Revision: D9162467

fbshipit-source-id: ec072b8335c02ee6a18a399f74895bf940089a4d
Summary: nvcc only respects definitions, not options.

Differential Revision: D9154388

fbshipit-source-id: 9e752ecfcdc672cb1a641b708c1027e205697e59
Summary:
- New concept of a message stack; you can add messages
  using AppendMessage
- New concept of a caller; it's just a way to pass along
  some arbitrary extra information in the exception

Coming soon is changing Caffe2 to use at::Error instead of
EnforceNotMet

Differential Revision: D9139996

fbshipit-source-id: 78da78e6470fe7e6ae461d30b639820af1bd331d
Differential Revision: D9140095

fbshipit-source-id: a61820a4ffd21094aa6bf06527ef0a432de41937
…lly) caffe2::DeviceType (pytorch#10175)

Summary:
Pull Request resolved: pytorch#10175

Previously, we had at::Device::Type and caffe2::DeviceType (from protobuf),
intended to help us distinguish between CPU, CUDA, etc. devices.

This replaces at::Device::Type entirely with at::DeviceType, which in turn
is a direct, 'enum class' version of the protobuf generated caffe2::DeviceType
'enum'.  We can't eliminate the 'enum' because this would a pretty drastic
API change (enum is interconvertible with integers, enum class is not) but
we can make the two line up exactly and share code for, e.g., printing.

Reviewed By: Yangqing

Differential Revision: D9137156

fbshipit-source-id: 0ff672f28794d021e5c344635f272a62b61bd20e
zdevito pushed a commit to zdevito/ATen that referenced this pull request Aug 4, 2018
…lly) caffe2::DeviceType (#10175)

Summary:
Pull Request resolved: pytorch/pytorch#10175

Previously, we had at::Device::Type and caffe2::DeviceType (from protobuf),
intended to help us distinguish between CPU, CUDA, etc. devices.

This replaces at::Device::Type entirely with at::DeviceType, which in turn
is a direct, 'enum class' version of the protobuf generated caffe2::DeviceType
'enum'.  We can't eliminate the 'enum' because this would a pretty drastic
API change (enum is interconvertible with integers, enum class is not) but
we can make the two line up exactly and share code for, e.g., printing.

Reviewed By: Yangqing

Differential Revision: D9137156

fbshipit-source-id: 566385cd6efb1ed722b25e6f7849a910b50342ab
goodlux pushed a commit to goodlux/pytorch that referenced this pull request Aug 15, 2018
…lly) caffe2::DeviceType (pytorch#10175)

Summary:
Pull Request resolved: pytorch#10175

Previously, we had at::Device::Type and caffe2::DeviceType (from protobuf),
intended to help us distinguish between CPU, CUDA, etc. devices.

This replaces at::Device::Type entirely with at::DeviceType, which in turn
is a direct, 'enum class' version of the protobuf generated caffe2::DeviceType
'enum'.  We can't eliminate the 'enum' because this would a pretty drastic
API change (enum is interconvertible with integers, enum class is not) but
we can make the two line up exactly and share code for, e.g., printing.

Reviewed By: Yangqing

Differential Revision: D9137156

fbshipit-source-id: 566385cd6efb1ed722b25e6f7849a910b50342ab
@ezyang ezyang added the merged label Jun 26, 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