-
Notifications
You must be signed in to change notification settings - Fork 24.2k
Raise BufferError
for DLPack buffer-related errors.
#150691
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
base: gh/ysiraichi/87/base
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/150691
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit c25232c with merge base 85bfaf8 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR addresses the Array API documentation for [`__dlpack__`][1] and [`from_dlpack`][2] by making some buffer-related errors `BufferError` instead of `RuntimeError`, e.g. incompatible dtype, strides, or device. [1]: https://data-apis.org/array-api/latest/API_specification/generated/array_api.array.__dlpack__.html [2]: https://data-apis.org/array-api/latest/API_specification/generated/array_api.from_dlpack.html#from-dlpack ghstack-source-id: cfaa90f Pull Request resolved: #150691
This PR addresses the Array API documentation for [`__dlpack__`][1] and [`from_dlpack`][2] by making some buffer-related errors `BufferError` instead of `RuntimeError`, e.g. incompatible dtype, strides, or device. [1]: https://data-apis.org/array-api/latest/API_specification/generated/array_api.array.__dlpack__.html [2]: https://data-apis.org/array-api/latest/API_specification/generated/array_api.from_dlpack.html#from-dlpack ghstack-source-id: fc97736 Pull Request resolved: #150691
This PR addresses the Array API documentation for [`__dlpack__`][1] and [`from_dlpack`][2] by making some buffer-related errors `BufferError` instead of `RuntimeError`, e.g. incompatible dtype, strides, or device. [1]: https://data-apis.org/array-api/latest/API_specification/generated/array_api.array.__dlpack__.html [2]: https://data-apis.org/array-api/latest/API_specification/generated/array_api.from_dlpack.html#from-dlpack ghstack-source-id: 486a998 Pull Request resolved: #150691
This PR addresses the Array API documentation for [`__dlpack__`][1] and [`from_dlpack`][2] by making some buffer-related errors `BufferError` instead of `RuntimeError`, e.g. incompatible dtype, strides, or device. [1]: https://data-apis.org/array-api/latest/API_specification/generated/array_api.array.__dlpack__.html [2]: https://data-apis.org/array-api/latest/API_specification/generated/array_api.from_dlpack.html#from-dlpack ghstack-source-id: c3b89e9 Pull Request resolved: #150691
This PR addresses the Array API documentation for [`__dlpack__`][1] and [`from_dlpack`][2] by making some buffer-related errors `BufferError` instead of `RuntimeError`, e.g. incompatible dtype, strides, or device. [1]: https://data-apis.org/array-api/latest/API_specification/generated/array_api.array.__dlpack__.html [2]: https://data-apis.org/array-api/latest/API_specification/generated/array_api.from_dlpack.html#from-dlpack ghstack-source-id: bca99f7 Pull Request resolved: #150691
@@ -69,29 +69,29 @@ DLDataType getDLDataType(const Tensor& t) { | |||
case ScalarType::Float8_e4m3fn: | |||
case ScalarType::Float8_e4m3fnuz: | |||
case ScalarType::Float8_e8m0fnu: | |||
TORCH_CHECK(false, "float8 types are not supported by dlpack"); | |||
TORCH_CHECK_BUFFER(false, "float8 types are not supported by dlpack"); |
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.
maybe the more specific error would be not supported by 1.0, it is supported for example by 1.1 now https://github.com/dmlc/dlpack/releases
Curious to hear your reasoning for why we shouldn't just upgrade to 1.1
Stack from ghstack (oldest at bottom):
BufferError
for DLPack buffer-related errors. #150691This PR addresses the Array API documentation for
__dlpack__
andfrom_dlpack
by making some buffer-related errorsBufferError
instead of
RuntimeError
, e.g. incompatible dtype, strides, or device.