[MPS] Fix dlpack exports/imports for sliced tensors#169272
[MPS] Fix dlpack exports/imports for sliced tensors#169272malfet wants to merge 2 commits intogh/malfet/612/basefrom
Conversation
For MPS tensor, one must pass both `id<MTL_Buffer>` (which is `t.storage().data()` and `t.storage_offset()`) Luckily, DLTensor already has `byte_offset` field, which feels natural to use as product of `storage_offset` and element_size Partially extends #168193, but instead of writing a completely new test, fix both export and import paths of sliced tensor and unskip test_from_dlpack_noncontinguous for MPS Fixes #168177 [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/169272
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 7 Unrelated FailuresAs of commit b1bbb85 with merge base a1ab3a0 ( NEW FAILURE - The following job has failed:
UNSTABLE - The following jobs are marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
For MPS tensor, one must pass both `id<MTL_Buffer>` (which is `t.storage().data()` and `t.storage_offset()`) Luckily, DLTensor already has `byte_offset` field, which feels natural to use as product of `storage_offset` and element_size Partially extends #168193, but instead of writing a completely new test, fix both export and import paths of sliced tensor and unskip test_from_dlpack_noncontinguous for MPS Fixes #168177 ghstack-source-id: 61a32f2 Pull Request resolved: #169272
For MPS tensor, one must pass both `id<MTL_Buffer>` (which is `t.storage().data()` and `t.storage_offset()`) Luckily, DLTensor already has `byte_offset` field, which feels natural to use as product of `storage_offset` and element_size Partially extends #168193, but instead of writing a completely new test, fix both export and import paths of sliced tensor and unskip test_from_dlpack_noncontinguous for MPS Fixes #168177 ghstack-source-id: 61a32f2 Pull Request resolved: #169272
For MPS tensor, one must pass both `id<MTL_Buffer>` (which is `t.storage().data()` and `t.storage_offset()`) Luckily, DLTensor already has `byte_offset` field, which feels natural to use as product of `storage_offset` and element_size Partially extends #168193, but instead of writing a completely new test, fix both export and import paths of sliced tensor and unskip test_from_dlpack_noncontinguous for MPS Fixes #168177 ghstack-source-id: 702dda8 Pull Request resolved: #169272
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
@pytorchbot revert -m 'I am seeing some ROCm failures in trunk after this lands' -c nosignals test/inductor/test_aot_inductor.py::AOTInductorTestABICompatibleGpu::test_non_tensor_input_cuda GH job link HUD commit link test/inductor/test_torchinductor.py::GPUTests::test_aoti_eager_override_registration_cuda GH job link HUD commit link |
|
❌ 🤖 pytorchbot command failed: Try |
|
@pytorchbot revert -m 'I am seeing some ROCm failures in trunk after this lands' -c nosignal |
|
@pytorchbot successfully started a revert job. Check the current status here. |
This reverts commit 7741edd. Reverted #169272 on behalf of https://github.com/huydhn due to I am seeing some ROCm failures in trunk after this lands ([comment](#169272 (comment)))
|
@malfet your PR has been successfully reverted. |
|
@pytorchbot merge -i Reland this as I don't think the revert helps |
Merge startedYour change will be merged while ignoring the following 8 checks: trunk / linux-jammy-rocm-py3.10 / test (default, 1, 6, linux.rocm.gpu.gfx942.1), trunk / linux-jammy-rocm-py3.10 / test (default, 2, 6, linux.rocm.gpu.gfx942.1), trunk / linux-jammy-rocm-py3.10 / test (default, 6, 6, linux.rocm.gpu.gfx942.1), trunk / linux-jammy-rocm-py3.10 / test (default, 4, 6, linux.rocm.gpu.gfx942.1), trunk / linux-jammy-rocm-py3.10 / test (default, 3, 6, linux.rocm.gpu.gfx942.1), trunk / linux-jammy-rocm-py3.10 / test (default, 5, 6, linux.rocm.gpu.gfx942.1), trunk / linux-jammy-rocm-py3.10 / test (distributed, 1, 3, linux.rocm.gpu.gfx942.4), trunk / linux-jammy-cuda12.8-py3.10-gcc11 / test (default, 4, 5, linux.g6.4xlarge.experimental.nvidia.gpu) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
For MPS tensor, one must pass both `id<MTL_Buffer>` (which is `t.storage().data()` and `t.storage_offset()`) Luckily, DLTensor already has `byte_offset` field, which feels natural to use as product of `storage_offset` and element_size. Partially extends #168193, but instead of writing a completely new test, fix both export and import paths of sliced tensor and unskip test_from_dlpack_noncontinguous for MPS Error out if one is attempting to create tensor with non-zero `byte_offsets` and no strides, as there are no `at::from_blob` variant that could be used Fixes #168177 Pull Request resolved: #169272 Approved by: https://github.com/ngimel
This reverts commit 7741edd. Reverted #169272 on behalf of https://github.com/huydhn due to I am seeing some ROCm failures in trunk after this lands ([comment](#169272 (comment)))
For MPS tensor, one must pass both `id<MTL_Buffer>` (which is `t.storage().data()` and `t.storage_offset()`) Luckily, DLTensor already has `byte_offset` field, which feels natural to use as product of `storage_offset` and element_size. Partially extends #168193, but instead of writing a completely new test, fix both export and import paths of sliced tensor and unskip test_from_dlpack_noncontinguous for MPS Error out if one is attempting to create tensor with non-zero `byte_offsets` and no strides, as there are no `at::from_blob` variant that could be used Fixes #168177 Pull Request resolved: #169272 Approved by: https://github.com/ngimel
Stack from ghstack (oldest at bottom):
For MPS tensor, one must pass both
id<MTL_Buffer>(which ist.storage().data()andt.storage_offset())Luckily, DLTensor already has
byte_offsetfield, which feels natural to use as product ofstorage_offsetand element_size.Partially extends #168193, but instead of writing a completely new test, fix both export and import paths of sliced tensor and unskip test_from_dlpack_noncontinguous for MPS
Error out if one is attempting to create tensor with non-zero
byte_offsetsand no strides, as there are noat::from_blobvariant that could be usedFixes #168177