8000 Raise `BufferError` for DLPack buffer-related errors. by ysiraichi · Pull Request #150691 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

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

Open
wants to merge 5 commits into
base: gh/ysiraichi/87/base
Choose a base branch
from

Conversation

ysiraichi
Copy link
Collaborator
@ysiraichi ysiraichi commented Apr 4, 2025

Stack from ghstack (oldest at bottom):

This PR addresses the Array API documentation for __dlpack__ and
from_dlpack by making some buffer-related errors BufferError
instead of RuntimeError, e.g. incompatible dtype, strides, or device.

[ghstack-poisoned]
Copy link
pytorch-bot bot commented Apr 4, 2025

🔗 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 Failures

As of commit c25232c with merge base 85bfaf8 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

ysiraichi added a commit that referenced this pull request Apr 4, 2025
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
@ysiraichi ysiraichi added module: dlpack release notes: python_frontend python frontend release notes category labels Apr 4, 2025
[ghstack-poisoned]
ysiraichi added a commit that referenced this pull request Apr 4, 2025
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
[ghstack-poisoned]
ysiraichi added a commit that referenced this pull request Apr 25, 2025
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
[ghstack-poisoned]
ysiraichi added a commit that referenced this pull request Apr 25, 2025
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
@ysiraichi ysiraichi requested review from rgommers and albanD April 25, 2025 23:34
[ghstack-poisoned]
ysiraichi added a commit that referenced this pull request Apr 26, 2025
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
8000
@@ -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");
Copy link
Member
@msaroufim msaroufim May 14, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0