[UT] "RuntimeError: iter.device(arg).is_xpu()" in test_torch_xpu.py#11
Draft
Stonepia wants to merge 1 commit into
Draft
[UT] "RuntimeError: iter.device(arg).is_xpu()" in test_torch_xpu.py#11Stonepia wants to merge 1 commit into
Stonepia wants to merge 1 commit into
Conversation
[Bug Skip] XPU Dynamo Graph Lowering - stream_index None
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[UT] "RuntimeError: iter.device(arg).is_xpu()" in test_torch_xpu.py
Fixes intel/torch-xpu-ops#2560
Root Cause: The XPU addcmul_kernel in PointwiseOpsKernels.cpp does not handle the case where tensor2 (argument index 3) is a CPU scalar. It passes the TensorIterator directly to gpu_kernel(), which asserts all arguments are on XPU (Loops.h:637). The CUDA implementation detects is_cpu_scalar(3), extracts the scalar value, and dispatches to a separate addcmul_cuda_scalar_tensor2_kernel that bakes the scalar into the functor instead of reading it from the iterator.
Failed Tests:
test_torch_xpu.py::TestVitalSignsCudaXPU::test_cuda_vitals_gpu_only_xputest_torch_xpu.py::TestTorchDeviceTypeXPU::test_addcmul_use_cpu_scalar_True_xpu_complex128test_torch_xpu.py::TestTorchDeviceTypeXPU::test_addcmul_use_cpu_scalar_True_xpu_complex64test_torch_xpu.py::TestTorchDeviceTypeXPU::test_addcmul_use_cpu_scalar_True_xpu_float32test_torch_xpu.py::TestTorchDeviceTypeXPU::test_addcmul_use_cpu_scalar_True_xpu_float64test_torch_xpu.py::TestTorchDeviceTypeXPU::test_addcmul_use_cpu_scalar_True_xpu_int16test_torch_xpu.py::TestTorchDeviceTypeXPU::test_addcmul_use_cpu_scalar_True_xpu_int32test_torch_xpu.py::TestTorchDeviceTypeXPU::test_addcmul_use_cpu_scalar_True_xpu_int64test_torch_xpu.py::TestTorchDeviceTypeXPU::test_addcmul_use_cpu_scalar_True_xpu_int8test_torch_xpu.py::TestTorchDeviceTypeXPU::test_addcmul_use_cpu_scalar_True_xpu_uint8Diff stat: