Repository navigation
Pass tensor data pointer to dlDeviceToTorchDevice from maybeCopyTensor in DLConvertor.cpp - #178768
AKloniecki wants to merge 1 commit into
Conversation
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". 🟡 AUTOMATED REVIEW - Changes requested:
Findings (3): Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/178768
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 185d0db with merge base 1a70a6e ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "topic: not user facing" |
|
@AKloniecki thanks for the fix. Please help add a regression test to |
|
@EikanWang there is a test case in the original PR that enables the test_dlpack.py test suite, that is currently skipped, but should be reenabled once this PR is merged (https://github.com/shangerxin/pytorch/blob/6f74d5d9c987a7c687bf980c883d1a9738856fe6/test/test_dlpack.py#L527). Should we add a separate TC in test_xpu.py anyway? |
|
@AKloniecki , I suggest adding a UT to |
|
@EikanWang test added. |
|
Found two things below:
|
tszulist-hbn
left a comment
There was a problem hiding this comment.
Found two things below:
Enable the skipped XPU test in test_dlpack.py:527
Verify: Confirm that the Module.cpp:769 call site doesn't need the same fix (appears safe, but worth explicit verification)
ecd6137 to
79855ae
Compare
79855ae to
1a1c444
Compare
|
@pytorchbot rebase -b main |
|
@pytorchbot started a rebase job onto refs/remotes/origin/main. Check the current status here |
|
Successfully rebased |
1a1c444 to
fad7e96
Compare
fad7e96 to
660e7b6
Compare
660e7b6 to
42c4101
Compare
|
@pytorchbot rebase -b main |
…template
DLPack stream exchange is only specified for CUDA and ROCm. The seven tests
moved here encode that numbering directly -- stream=1 is the legacy default
stream on CUDA and stream=0 on ROCm, stream=2 is the per-thread default
stream PyTorch rejects -- and reach for torch.cuda.Stream and
torch.cuda._sleep by name. Cloning them into every backend so they can skip
at runtime tells the reader nothing and costs 23 skipped clones per
non-CUDA backend, since two of the seven are dtype-parametrized.
They move to TestTorchDlPackCUDA, instantiated with only_for="cuda",
which makes @skipMeta and @onlyCUDA redundant. The executed set is
unchanged at {cuda}, with test_dlpack_invalid_rocm_streams still gated by
@skipCUDAIfNotRocm. Part of pytorch#142029.
Test Plan:
```
python test/test_dlpack.py
python -m pytest test/test_dlpack.py -v --tb=no -p no:randomly
python -m pytest test/test_dlpack.py --collect-only -q -p no:randomly
```
281 tests, 237 passed / 44 skipped / 0 failed, against 327 tests and 237/90/0
on the parent commit. The per-test outcome map loses 46 lines and gains none,
and every one of the 46 was SKIPPED: the 23 cpu and 23 xpu clones of the seven
moved tests. The passed set is untouched, so no coverage was traded away.
only_for="cuda" generates no class on this box, so collection lists only
TestTorchDlPackDeviceCPU, TestTorchDlPackDeviceXPU and TestReadOnlyDLPack; the
seven tests need a CUDA runner to execute, exactly as before the move.
Measured on a single-Battlemage box with no CUDA and no MPS device, so the
cuda and mps bases are never generated here. pytorch#178768 was
applied locally, since test_copy on XPU depends on it.
Authored with the help of an AI assistant (Claude Code).
Co-Authored-By: Claude Opus 5 <[email protected]>
Eight tests in test/test_dlpack.py do not depend on where the tensor lives. They cover export rejections -- requires_grad, conjugate views, non-strided layouts, a stream argument on CPU -- plus stride normalization, the copy fallback and the unsupported-dtype error. Six take no device argument at all and the other two ignore theirs, so the device template was cloning each of them into every backend to run byte-identical work. They move to a plain TestTorchDlPack that is never passed to instantiate_device_type_tests, so each runs once. The @skipMeta that seven of the eight carried is dropped rather than moved, because skipIf reads slf.device_type and a plain TestCase has no such attribute. Two of them lose a restriction outright rather than trading it for an only_for. test_from_dlpack_negative_strides and test_dlpack_unsupported_dtype_error were @onlyCPU, so they did not run at all wherever the CPU base is filtered out, as on GPU-only shards or under PYTORCH_TESTING_DEVICE_ONLY_FOR=cuda. Both bodies build only CPU tensors, so each still runs once and runs the same code it ran as the _cpu clone, but the restriction is now gone everywhere rather than on XPU alone, which is worth stating rather than burying. Their unused device parameters go with the decorator. test_numpy_dlpack_protocol_conversion joins them. It consumes a capsule produced by NumPy, which only allocates on the host, so it was @onlyCPU as well and its xpu clones existed only to skip. Like the two above, it now also runs where the CPU base is filtered out, on the same CPU tensors. It takes its dtypes from @parametrize, since @dtypes needs the device template, and its @skipMeta is dropped for the same reason as the others'. Part of pytorch#142029. Test Plan: ``` python test/test_dlpack.py python -m pytest test/test_dlpack.py -v --tb=no -p no:randomly python -m pytest test/test_dlpack.py --collect-only -q -p no:randomly ``` 260 tests, 231 passed / 29 skipped / 0 failed, against 281 tests and 237/44/0 on the parent commit. The per-test outcome map loses 42 lines and gains 21: for each of the eight tests the cpu and xpu clones are replaced by one unsuffixed entry, and the 13 cpu and 13 xpu dtype clones of test_numpy_dlpack_protocol_conversion by 13 entries without a device suffix. All 21 pass. Six of the eight were PASSED on both bases, so they account for six fewer executions of identical work; the two former @onlyCPU tests and the NumPy test had SKIPPED xpu clones, 15 in all, and those are gone. Collection confirms TestTorchDlPack appears once with 21 tests and no per-device suffix, alongside TestTorchDlPackDeviceCPU (115), TestTorchDlPackDeviceXPU (115) and TestReadOnlyDLPack (9). Measured on a single-Battlemage box with no CUDA and no MPS device, so the cuda and mps bases are never generated here. pytorch#178768 was applied locally, since test_copy on XPU depends on it. Authored with the help of an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5 <[email protected]>
Adds hw_classification to the four test classes in test/test_dlpack.py. Part of pytorch#142029. The classification follows the agreed rule: ACCELERATOR when a class is instantiated via instantiate_device_type_tests, GENERIC when it is not. ACCELERATOR covers behavior that must hold consistently across every device including CPU, so TestTorchDlPackDevice is ACCELERATOR even though most of its tests also run on CPU -- see TestTorchAutocastDevice in test/test_autocast.py, which is ACCELERATOR and instantiated with no device restriction. TestTorchDlPack and TestReadOnlyDLPack are not instantiated, so they are GENERIC. TestTorchDlPackCUDA, whose instantiation is pinned to one backend, takes that backend's label, matching TestUnaryUfuncsCUDADevice in test/test_unary_ufuncs.py. The attribute is set on the generic classes and inherited by the per-device classes that instantiate_device_type_tests generates, so it does not need to be applied to the generated names. Test Plan: ``` python test/test_dlpack.py python test/test_dlpack.py --hw-classification GENERIC python test/test_dlpack.py --hw-classification ACCELERATOR python test/test_dlpack.py --hw-classification CUDA python test/test_dlpack.py --hw-classification MPS python -m pytest test/test_dlpack.py -v --tb=no -p no:randomly ``` 260 tests, 231 passed / 29 skipped / 0 failed, and the per-test outcome map is byte-identical to the parent commit; setting a class attribute cannot change what runs unfiltered. The four selectors partition the file exactly, with unclassified=0 on every one: GENERIC 30, ACCELERATOR 230, CUDA 0, MPS 0, summing to 260. CUDA and MPS are empty because neither device exists on this box. The 29 skips are 24 cpu clones of the @OnlyOn(["xpu", "cuda"]) tests, 2 needing a second device, 2 needing a newer NumPy, and test_no_copy_xpu, whose pytorch#3077 skip is removed by pytorch#178768. Measured on a single-Battlemage box with no CUDA and no MPS device, so the cuda and mps bases are never generated here. pytorch#178768 was applied locally, since test_copy on XPU depends on it. Authored with the help of an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5 <[email protected]>
Review feedback on pytorch#195722: the seven tests in TestTorchDlPackDevice that were @OnlyOn(["xpu", "cuda"]) exercise the generic DLPack device contract, so they now use @onlyAccelerator and opt MPS out only where it actually fails. The class is already instantiated with allow_mps=True, and the macos-m1 default shard collects its MPS clones (test_copy_mps, test_no_copy_mps, ...), so this enables them there. The two stream tests (test_dlpack_conversion_with_streams and test_dlpack_conversion_with_streams_narrow_precision) get @skipMPS. Their helper calls stream.synchronize(), and MPSGuardImpl does not override synchronizeStream, so the base DeviceGuardImplInterface raises "Backend doesn't support synchronizing streams." The float64/complex128 variants would also fail earlier in make_tensor, since the test has no dtypesIfMPS. test_numpy_cross_device_multi_gpu skips itself on MPS through deviceCountAtLeast(2). The remaining four (test_copy, test_no_copy, test_needs_copy_error, test_numpy_cross_device_transfer) are expected to pass on MPS from reading DLConvertor.cpp and torch/utils/dlpack.py. On CUDA and XPU nothing changes: onlyAccelerator only skips cpu and meta, and skipMPS is a no-op off MPS. Test Plan: Per-test outcomes before and after, on a single-Battlemage XPU box with no CUDA and no MPS device: ``` cd test && python -m pytest test_dlpack.py -p no:randomly -v --tb=no lintrunner -a -- test/test_dlpack.py ``` 262 tests, identical outcome map before and after. The one failure on both sides is test_copy_xpu, which depends on the unmerged pytorch#178768 (intel/torch-xpu-ops#3077). The MPS predictions above were not run locally; the macos-m1 default shard is the first place they execute. Authored with the help of an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]>
dvrogozh
left a comment
There was a problem hiding this comment.
Previously this optional data pointer was not passed to dlDeviceToTorchDevice, which is not supported on XPU. Now that is being passed along, the device can be correctly determined.
Please, polish PR description which will go to the commit message. I am confused reading the first sentence: if dlDeviceToTorchDevice is not supported on XPU, then why we should care and pass some optional data pointer? This does not make sense. You likely wanted to say that you've added support for XXX by doing YYY.
…device under test test_automatically_select_in_creation in test/test_dlpack.py is a device template test, but it allocated its input with a bare torch.rand(10), so every non-CPU clone handed torch.tensor a CPU producer. The property the test is named for, that torch.tensor detects __dlpack__ on the wrapper and imports the buffer instead of iterating element by element, was therefore only ever exercised against the CPU export path. Allocating on the injected device makes each clone drive its own backend's export path. The assertion is left as it was: assertEqual defaults to exact_device=False, so this commit widens what the test runs, not what it checks. Part of pytorch#142029. Test Plan: ``` python test/test_dlpack.py python -m pytest test/test_dlpack.py -v --tb=no -p no:randomly ``` 327 tests, 234 passed / 93 skipped / 0 failed, and the per-test outcome map is byte-identical to the parent commit. That is the expected result: the xpu clone already passed, and allocating on the injected device changes which backend it exercises, not whether it succeeds. Measured on a single-Battlemage box with no CUDA and no MPS device, so the cuda and mps bases are never generated here. pytorch#178768 was applied locally, since test_copy on XPU depends on it. Authored with the help of an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5 <[email protected]>
…lpack.py test_dlpack_exchange_api carried a skip for intel/torch-xpu-ops#3074, which is closed. The test passes on Intel GPU, so the skip only hides coverage. Part of pytorch#142029. The skipXPUIf import stays: test_no_copy still carries a skip for intel/torch-xpu-ops#3077, which pytorch#178768 removes. Test Plan: ``` python test/test_dlpack.py python -m pytest test/test_dlpack.py -v --tb=no -p no:randomly ``` 327 tests, 235 passed / 92 skipped / 0 failed, against 234/93/0 on the parent commit. Exactly one line moves in the per-test outcome map: test_dlpack_exchange_api_xpu, SKIPPED -> PASSED. Measured on a single-Battlemage box with no CUDA and no MPS device, so the cuda and mps bases are never generated here. pytorch#178768 was applied locally, since test_copy on XPU depends on it. Authored with the help of an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5 <[email protected]>
test_copy and test_needs_copy_error in test/test_dlpack.py were @onlyCUDA, but neither body is CUDA-specific: they exercise the copy=True and copy=False contract of torch.from_dlpack across a device boundary. Both now carry @OnlyOn(["xpu", "cuda"]), matching test_no_copy immediately below them, so both run on Intel GPU. Part of pytorch#142029. test_copy on XPU depends on pytorch#178768, so this PR has to land after it. Its out_device=device sub-case reaches dlDeviceToTorchDevice through maybeCopyTensor, which without that fix raises "Can't get ATen device for XPU without XPU data" (intel/torch-xpu-ops#3077). @onlyAccelerator would have been the broader choice and was rejected: it also selects MPS, where neither test has ever run, and enabling a backend speculatively either goes green by luck or lands a failure with no issue behind it. Test Plan: ``` python test/test_dlpack.py python -m pytest test/test_dlpack.py -v --tb=no -p no:randomly python -m pytest test/test_dlpack.py -v -p no:randomly -k copy ``` 327 tests, 237 passed / 90 skipped / 0 failed, against 235/92/0 on the parent commit. Exactly the two newly enabled clones move in the per-test outcome map: test_copy_xpu and test_needs_copy_error_xpu, both SKIPPED -> PASSED. Measured on a single-Battlemage box with no CUDA and no MPS device, so the cuda and mps bases are never generated here. pytorch#178768 was applied locally, since test_copy on XPU depends on it. Authored with the help of an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5 <[email protected]>
test/test_dlpack.py has one test class instantiated through instantiate_device_type_tests. The Device suffix marks it as the device-instantiated template, an established convention in the test suite: TestTypePromotionDevice in test/test_type_promotion.py (pytorch#190990), TestScatterGatherDevice, TestHOPDevice and others. Part of pytorch#142029. Renaming a test class changes every lookup key of the form f"{class_name}.{test_name}", so the three name-keyed mechanisms were swept first. No marker file under test/dynamo_expected_failures, test/dynamo_skips, test/compiled_autograd_skips, test/inductor_expected_failures or test/inductor_skips names a TestTorchDlPack class -- the TestDLPack markers there belong to test/torch_np -- the test-infra disabled-tests list has no DLPack entry, and nothing outside this file refers to the generated names. A later commit reuses the bare name TestTorchDlPack for the tests that are not device-dependent, so the rename goes first to keep the two steps separately reviewable. Test Plan: ``` python test/test_dlpack.py python -m pytest test/test_dlpack.py -v --tb=no -p no:randomly python -m pytest test/test_dlpack.py --collect-only -q -p no:randomly ``` 327 tests, 237 passed / 90 skipped / 0 failed, unchanged from the parent commit. The per-test outcome map, which is keyed on the method name, is identical apart from two skip-reason strings that pytest truncates one character earlier now that the class name is longer. Collection confirms the generated classes are TestTorchDlPackDeviceCPU and TestTorchDlPackDeviceXPU. The name sweep above was three checks: a filename grep over the five marker directories, a lookup in the downloaded disabled-tests-condensed.json (193 entries, no DLPack match), and a repo-wide grep for TestTorchDlPack outside this file (no hits). Measured on a single-Battlemage box with no CUDA and no MPS device, so the cuda and mps bases are never generated here. pytorch#178768 was applied locally, since test_copy on XPU depends on it. Authored with the help of an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5 <[email protected]>
…template
DLPack stream exchange is only specified for CUDA and ROCm. The seven tests
moved here encode that numbering directly -- stream=1 is the legacy default
stream on CUDA and stream=0 on ROCm, stream=2 is the per-thread default
stream PyTorch rejects -- and reach for torch.cuda.Stream and
torch.cuda._sleep by name. Cloning them into every backend so they can skip
at runtime tells the reader nothing and costs 23 skipped clones per
non-CUDA backend, since two of the seven are dtype-parametrized.
They move to TestTorchDlPackCUDA, instantiated with only_for="cuda",
which makes @skipMeta and @onlyCUDA redundant. The executed set is
unchanged at {cuda}, with test_dlpack_invalid_rocm_streams still gated by
@skipCUDAIfNotRocm. Part of pytorch#142029.
Test Plan:
```
python test/test_dlpack.py
python -m pytest test/test_dlpack.py -v --tb=no -p no:randomly
python -m pytest test/test_dlpack.py --collect-only -q -p no:randomly
```
281 tests, 237 passed / 44 skipped / 0 failed, against 327 tests and 237/90/0
on the parent commit. The per-test outcome map loses 46 lines and gains none,
and every one of the 46 was SKIPPED: the 23 cpu and 23 xpu clones of the seven
moved tests. The passed set is untouched, so no coverage was traded away.
only_for="cuda" generates no class on this box, so collection lists only
TestTorchDlPackDeviceCPU, TestTorchDlPackDeviceXPU and TestReadOnlyDLPack; the
seven tests need a CUDA runner to execute, exactly as before the move.
Measured on a single-Battlemage box with no CUDA and no MPS device, so the
cuda and mps bases are never generated here. pytorch#178768 was
applied locally, since test_copy on XPU depends on it.
Authored with the help of an AI assistant (Claude Code).
Co-Authored-By: Claude Opus 5 <[email protected]>
Eight tests in test/test_dlpack.py do not depend on where the tensor lives. They cover export rejections -- requires_grad, conjugate views, non-strided layouts, a stream argument on CPU -- plus stride normalization, the copy fallback and the unsupported-dtype error. Six take no device argument at all and the other two ignore theirs, so the device template was cloning each of them into every backend to run byte-identical work. They move to a plain TestTorchDlPack that is never passed to instantiate_device_type_tests, so each runs once. The @skipMeta that seven of the eight carried is dropped rather than moved, because skipIf reads slf.device_type and a plain TestCase has no such attribute. Two of them lose a restriction outright rather than trading it for an only_for. test_from_dlpack_negative_strides and test_dlpack_unsupported_dtype_error were @onlyCPU, so they did not run at all wherever the CPU base is filtered out, as on GPU-only shards or under PYTORCH_TESTING_DEVICE_ONLY_FOR=cuda. Both bodies build only CPU tensors, so each still runs once and runs the same code it ran as the _cpu clone, but the restriction is now gone everywhere rather than on XPU alone, which is worth stating rather than burying. Their unused device parameters go with the decorator. test_numpy_dlpack_protocol_conversion joins them. It consumes a capsule produced by NumPy, which only allocates on the host, so it was @onlyCPU as well and its xpu clones existed only to skip. Like the two above, it now also runs where the CPU base is filtered out, on the same CPU tensors. It takes its dtypes from @parametrize, since @dtypes needs the device template, and its @skipMeta is dropped for the same reason as the others'. Part of pytorch#142029. Test Plan: ``` python test/test_dlpack.py python -m pytest test/test_dlpack.py -v --tb=no -p no:randomly python -m pytest test/test_dlpack.py --collect-only -q -p no:randomly ``` 260 tests, 231 passed / 29 skipped / 0 failed, against 281 tests and 237/44/0 on the parent commit. The per-test outcome map loses 42 lines and gains 21: for each of the eight tests the cpu and xpu clones are replaced by one unsuffixed entry, and the 13 cpu and 13 xpu dtype clones of test_numpy_dlpack_protocol_conversion by 13 entries without a device suffix. All 21 pass. Six of the eight were PASSED on both bases, so they account for six fewer executions of identical work; the two former @onlyCPU tests and the NumPy test had SKIPPED xpu clones, 15 in all, and those are gone. Collection confirms TestTorchDlPack appears once with 21 tests and no per-device suffix, alongside TestTorchDlPackDeviceCPU (115), TestTorchDlPackDeviceXPU (115) and TestReadOnlyDLPack (9). Measured on a single-Battlemage box with no CUDA and no MPS device, so the cuda and mps bases are never generated here. pytorch#178768 was applied locally, since test_copy on XPU depends on it. Authored with the help of an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5 <[email protected]>
Adds hw_classification to the four test classes in test/test_dlpack.py. Part of pytorch#142029. The classification follows the agreed rule: ACCELERATOR when a class is instantiated via instantiate_device_type_tests, GENERIC when it is not. ACCELERATOR covers behavior that must hold consistently across every device including CPU, so TestTorchDlPackDevice is ACCELERATOR even though most of its tests also run on CPU -- see TestTorchAutocastDevice in test/test_autocast.py, which is ACCELERATOR and instantiated with no device restriction. TestTorchDlPack and TestReadOnlyDLPack are not instantiated, so they are GENERIC. TestTorchDlPackCUDA, whose instantiation is pinned to one backend, takes that backend's label, matching TestUnaryUfuncsCUDADevice in test/test_unary_ufuncs.py. The attribute is set on the generic classes and inherited by the per-device classes that instantiate_device_type_tests generates, so it does not need to be applied to the generated names. Test Plan: ``` python test/test_dlpack.py python test/test_dlpack.py --hw-classification GENERIC python test/test_dlpack.py --hw-classification ACCELERATOR python test/test_dlpack.py --hw-classification CUDA python test/test_dlpack.py --hw-classification MPS python -m pytest test/test_dlpack.py -v --tb=no -p no:randomly ``` 260 tests, 231 passed / 29 skipped / 0 failed, and the per-test outcome map is byte-identical to the parent commit; setting a class attribute cannot change what runs unfiltered. The four selectors partition the file exactly, with unclassified=0 on every one: GENERIC 30, ACCELERATOR 230, CUDA 0, MPS 0, summing to 260. CUDA and MPS are empty because neither device exists on this box. The 29 skips are 24 cpu clones of the @OnlyOn(["xpu", "cuda"]) tests, 2 needing a second device, 2 needing a newer NumPy, and test_no_copy_xpu, whose pytorch#3077 skip is removed by pytorch#178768. Measured on a single-Battlemage box with no CUDA and no MPS device, so the cuda and mps bases are never generated here. pytorch#178768 was applied locally, since test_copy on XPU depends on it. Authored with the help of an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5 <[email protected]>
Review feedback on pytorch#195722: the seven tests in TestTorchDlPackDevice that were @OnlyOn(["xpu", "cuda"]) exercise the generic DLPack device contract, so they now use @onlyAccelerator and opt MPS out only where it actually fails. The class is already instantiated with allow_mps=True, and the macos-m1 default shard collects its MPS clones (test_copy_mps, test_no_copy_mps, ...), so this enables them there. The two stream tests (test_dlpack_conversion_with_streams and test_dlpack_conversion_with_streams_narrow_precision) get @skipMPS. Their helper calls stream.synchronize(), and MPSGuardImpl does not override synchronizeStream, so the base DeviceGuardImplInterface raises "Backend doesn't support synchronizing streams." The float64/complex128 variants would also fail earlier in make_tensor, since the test has no dtypesIfMPS. test_numpy_cross_device_multi_gpu skips itself on MPS through deviceCountAtLeast(2). The remaining four (test_copy, test_no_copy, test_needs_copy_error, test_numpy_cross_device_transfer) are expected to pass on MPS from reading DLConvertor.cpp and torch/utils/dlpack.py. On CUDA and XPU nothing changes: onlyAccelerator only skips cpu and meta, and skipMPS is a no-op off MPS. Test Plan: Per-test outcomes before and after, on a single-Battlemage XPU box with no CUDA and no MPS device: ``` cd test && python -m pytest test_dlpack.py -p no:randomly -v --tb=no lintrunner -a -- test/test_dlpack.py ``` 262 tests, identical outcome map before and after. The one failure on both sides is test_copy_xpu, which depends on the unmerged pytorch#178768 (intel/torch-xpu-ops#3077). The MPS predictions above were not run locally; the macos-m1 default shard is the first place they execute. Authored with the help of an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dvrogozh You're right, that was some really broken english in there. What I meant is that 'not passing the optional data pointer <- is not supported', but obviously the straightforward way of saying that is, that it is required. I've updated the description. |
dvrogozh
left a comment
There was a problem hiding this comment.
Please, fix a typo in the PR description (you are pointing to your fork copy):
Previously this optional data pointer was omitted in few places, triggering explicit assert in XPU path: https://github.com/AKloniecki/pytorch/blob/60786e267c6c8b74bceaf0c11f463b355028b67f/aten/src/ATen/DLConvertor.cpp#L184.
Make sure to point to the assert in the upstream pytorch with the valid commit id belonging to the main branch.
|
@dvrogozh Corrected PR description. |
|
@jansel Could you please review these changes and help to move them along? |
|
@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 |
The optional data pointer argument of dlDeviceToTorchDevice is non-optional for XPU, and must point to correct tensor data, in order for XPU to correctly name the device.
Previously this optional data pointer was omitted in few places, triggering explicit assert in XPU path:
pytorch/aten/src/ATen/DLConvertor.cpp
Line 184 in 91a0eda
Now that the argument is passed along, the device can be correctly determined.
Fixes intel/torch-xpu-ops#3077