[PTL][XPU][WSL] UT "mul_cpu" not implemented for 'BComplex32'
- Dominant language
- Python
- Stars
- 113
- Forks
- 128
- Avg merge
- 5d 9h
- Merged PRs (30d)
- 112
Description
### 🐛 Describe the bug
4 UTs fail on WSL (Ubuntu 26.04) in Windows 11 with Intel PTLP XPU (Intel(R) Graphics [0xb080]
) with "mul_cpu" not implemented for 'BComplex32'.
### Affected Test Cases
```
FAILED test_ops_xpu.py::TestCommonXPU::test_compare_cpu_where_xpu_bfloat16 - ...
FAILED test_ops_xpu.py::TestCompositeComplianceXPU::test_forward_ad_nn_functional_multi_head_attention_forward_xpu_float32
FAILED test_ops_xpu.py::TestCompositeComplianceXPU::test_operator_nn_functional_multi_head_attention_forward_xpu_float32
FAILED test_ops_xpu.py::TestCompositeComplianceXPU::test_operator_empty_xpu_float32
```
### Reproduction
```
# Installing UT requirements
cd ${PYTORCH_ROOT_DIR}
python -m pip install -r .ci/docker/requirements-ci.txt
python -m pip install pytest pytest-timeout pytest-xdist
# UT extended
cd $PYTORCH_ROOT_DIR/third_party/torch-xpu-ops/test/xpu/extended
export PYTEST_ADDOPTS="-v --timeout 600 --timeout_method=thread -n 1"
export PYTORCH_TEST_WITH_SLOW=1
python run_test_with_skip.py | tee $HOME/ut_extended.log
```
### Error Message
ut_extended.log
```
=================================== FAILURES ===================================
______________ TestCommonXPU.test_compare_cpu_where_xpu_bfloat16 _______________
[gw0] linux -- Python 3.12.13 /home/administrator/miniforge3/envs/torch_xpu_2.12/bin/python
Traceback (most recent call last):
File "/home/administrator/miniforge3/envs/torch_xpu_2.12/lib/python3.12/site-packages/torch/testing/_comparison.py", line 1327, in not_close_error_metas
pair.compare()
File "/home/administrator/miniforge3/envs/torch_xpu_2.12/lib/python3.12/site-packages/torch/testing/_comparison.py", line 776, in compare
self._compare_values(actual, expected)
File "/home/administrator/miniforge3/envs/torch_xpu_2.12/lib/python3.12/site-packages/torch/testing/_comparison.py", line 934, in _compare_values
compare_fn(
File "/home/administrator/miniforge3/envs/torch_xpu_2.12/lib/python3.12/site-packages/torch/testing/_comparison.py", line 1113, in _compare_regular_values_close
matches = torch.isclose(
^^^^^^^^^^^^^^
NotImplementedError: "mul_cpu" not implemented for 'BComplex32'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/administrator/pytorch_repo/third_party/torch-xpu-ops/test/xpu/extended/test_ops_xpu.py", line 169, in test_compare_cpu
test_common_test_fn(self.proxy, device, dtype, op)
File "/home/administrator/pytorch_repo/third_party/torch-xpu-ops/test/xpu/extended/test_ops_xpu.py", line 145, in test_compare_cpu
self.assertEqual(xpu_results, cpu_results, atol=1e-3, rtol=1e-3)
File "/home/administrator/miniforge3/envs/torch_xpu_2.12/lib/python3.12/site-packages/torch/testing/_internal/common_utils.py", line 4805, in assertEqual
error_metas = not_close_error_metas(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/administrator/miniforge3/envs/torch_xpu_2.12/lib/python3.12/site-packages/torch/testing/_comparison.py", line 1333, in not_close_error_metas
raise RuntimeError(
RuntimeError: Comparing
TensorOrArrayPair(
id=(),
actual=tensor([[[-4.5000+0.j, -5.9062+0.j, 0.0000+2.j],
[-4.5000+0.j, -5.9062+0.j, nan+0.j],
[ 0.0000+2.j, -5.9062+0.j, 0.0000+2.j],
[ 0.0000+2.j, -5.9062+0.j, nan+0.j],
[ 0.0000+2.j, 0.0000+2.j, nan+0.j],
[ 0.0000+2.j, -5.9062+0.j, 0.0000+2.j],
[-4.5000+0.j, -5.9062+0.j, nan+0.j],
[-4.5000+0.j, 0.0000+2.j, 0.0000+2.j],
[-4.5000+0.j, -5.9062+0.j, 0.0000+2.j],
[-4.5000+0.j, 0.0000+2.j, 0.0000+2.j]]], device='xpu:0',
dtype=torch.bcomplex32),
expected=tensor([[[-4.5000+0.j, -5.9062+0.j, 0.0000+2.j],
[-4.5000+0.j, -5.9062+0.j, nan+0.j],
[ 0.0000+2.j, -5.9062+0.j, 0.0000+2.j],
[ 0.0000+2.j, -5.9062+0.j, nan+0.j],
[ 0.0000+2.j, 0.0000+2.j, nan+0.j],
[ 0.0000+2.j, -5.9062+0.j, 0.0000+2.j],
[-4.5000+0.j, -5.9062+0.j, nan+0.j],
[-4.5000+0.j, 0.0000+2.j, 0.0000+2.j],
[-4.5000+0.j, -5.9062+0.j, 0.0000+2.j],
[-4.5000+0.j, 0.0000+2.j, 0.0000+2.j]]], dtype=torch.bcomplex32),
rtol=0.001,
atol=0.001,
equal_nan=True,
check_device=False,
check_dtype=True,
check_layout=False,
check_stride=False,
)
resulted in the unexpected exception above. If you are a user and see this message during normal operation please file an issue at https://github.com/pytorch/pytorch/issues. If you are a developer and working on the comparison functions, please except the previous error and raise an expressive `ErrorMeta` instead.
To execute this test, run the following from the base repo dir:
PYTORCH_TEST_WITH_SLOW=1 python test/xpu/extended/test_ops_xpu.py TestCommonXPU.test_compare_cpu_where_xpu_bfloat16
This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
_________ third_party/torch-xpu-ops/test/xpu/extended/test_ops_xpu.py __________
[gw0] linux -- Python 3.12.13 /home/administrator/miniforge3/envs/torch_xpu_2.12/bin/python
worker 'gw0' crashed while running 'third_party/torch-xpu-ops/test/xpu/extended/test_ops_xpu.py::TestCompositeComplianceXPU::test_forward_ad_nn_functional_multi_head_attention_forward_xpu_float32'
_________ third_party/torch-xpu-ops/test/xpu/extended/test_ops_xpu.py __________
[gw1] linux -- Python 3.12.13 /home/administrator/miniforge3/envs/torch_xpu_2.12/bin/python
worker 'gw1' crashed while running 'third_party/torch-xpu-ops/test/xpu/extended/test_ops_xpu.py::TestCompositeComplianceXPU::test_operator_nn_functional_multi_head_attention_forward_xpu_float32'
__________ TestCompositeComplianceXPU.test_operator_empty_xpu_float32 __________
[gw2] linux -- Python 3.12.13 /home/administrator/miniforge3/envs/torch_xpu_2.12/bin/python
Traceback (most recent call last):
File "/home/administrator/pytorch_repo/third_party/torch-xpu-ops/test/xpu/extended/test_ops_xpu.py", line 221, in test_operator
test_composite_compliance_test_fn(self.proxy, device, dtype, op)
File "/home/administrator/pytorch_repo/third_party/torch-xpu-ops/test/xpu/../../../../test/test_ops.py", line 1948, in test_operator
composite_compliance.check_with_mode(op, args, kwargs, self.assertEqual)
File "/home/administrator/miniforge3/envs/torch_xpu_2.12/lib/python3.12/site-packages/torch/testing/_internal/composite_compliance.py", line 415, in check_with_mode
assert_equal_fn(tree_map(unwrap, actual), expected)
File "/home/administrator/miniforge3/envs/torch_xpu_2.12/lib/python3.12/site-packages/torch/testing/_internal/common_utils.py", line 4844, in assertEqual
raise error_metas.pop()[0].to_error( # type: ignore[index]
AssertionError: Scalars are not close!
Expected 1.175494490952134e-38 but got -6.710257053375244.
Absolute difference: 6.710257053375244 (up to 1e-05 allowed)
Relative difference: 5.708454701425296e+38 (up to 1.3e-06 allowed)
To execute this test, run the following from the base repo dir:
PYTORCH_TEST_WITH_SLOW=1 python test/xpu/extended/test_ops_xpu.py TestCompositeComplianceXPU.test_operator_empty_xpu_float32
This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
- generated xml file: /home/administrator/pytorch_repo/third_party/torch-xpu-ops/test/xpu/extended/op_extended.xml -
```
### Versions
Click to expand environment details
```
PyTorch version: 2.14.0.dev20260803+xpu
OS: Linux MININT-M4RS1G1 6.18.33.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 18 21:54:43 UTC 2026 x86_64 GNU/Linux
Windows driver version: 32.0.101.8864
WSL driver: 26.22.38646.6
gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0;
g++ (Ubuntu 15.2.0-16ubuntu1) 15.2.0
HW:
PTL H 2.00GHz
GPU Intel Arc B390 (integrated): 8086:B080 Rev:04
System Ram: 32 GB 8533 MT/s
Versions of relevant libraries:
Python 3.12.13
Package Version
------------------------- ----------------------
absl-py 2.5.0
aiohappyeyeballs 2.7.1
aiohttp 3.14.1
aiosignal 1.4.0
attrs 26.1.0
audioread 3.1.0
boto3 1.35.42
botocore 1.35.99
build 1.3.0
cattrs 25.2.0
certifi 2026.7.22
cffi 2.1.1
charset-normalizer 3.4.9
click 8.3.3
cmake 3.31.6
colorama 0.4.6
coremltools 8.3.0
cryptography 50.0.0
cuda-bindings 13.3.1
cuda-pathfinder 1.6.0
cupti-python 13.3.1
dataclasses-json 0.6.7
decorator 5.3.1
Deprecated 1.3.1
dill 0.3.7
distro 1.9.0
dpcpp-cpp-rt 2026.1.0
execnet 2.1.2
expecttest 0.3.0
fbscribelogger 0.1.7
filelock 3.20.3
flatbuffers 24.12.23
frozenlist 1.8.0
fsspec 2026.7.0
future 1.0.0
ghstack 0.8.0
google-auth 2.56.2
google-auth-oauthlib 1.0.0
grpcio 1.83.0
hypothesis 6.56.4
idna 3.18
ImageIO 2.37.4
impi-rt 2021.18.1
importlib_metadata 9.0.0
iniconfig 2.3.0
intel-cmplr-lib-rt 2026.1.0
intel-cmplr-lib-ur 2026.1.0
intel-cmplr-lic-rt 2026.1.0
intel-opencl-rt 2026.1.0
intel-openmp 2026.1.0
intel-pti 1.0.1
intel-sycl-rt 2026.1.0
Jinja2 3.1.6
jmespath 1.1.0
joblib 1.5.3
junitparser 2.1.1
lark 0.12.0
lazy-loader 0.5
librosa 0.10.2
lintrunner 0.13.0
llvmlite 0.46.0
lxml 5.3.0
Markdown 3.10.3
MarkupSafe 3.0.2
marshmallow 3.26.2
mkl 2026.1.0
mkl-include 2024.2.0
mkl-static 2024.2.0
ml_dtypes 0.5.4
mpmath 1.3.0
msgpack 1.2.1
multidict 6.7.1
mypy 1.16.0
mypy_extensions 1.1.0
narwhals 2.24.0
networkx 2.8.8
ninja 1.13.0
numba 0.64.0
numpy 1.26.4
nvidia-cuda-cupti 13.3.75
oauthlib 3.3.1
oneccl 2022.1.1
oneccl-devel 2022.1.1
onemkl-license 2026.1.0
onemkl-sycl-blas 2026.1.0
onemkl-sycl-dft 2026.1.0
onemkl-sycl-lapack 2026.1.0
onemkl-sycl-rng 2026.1.0
onemkl-sycl-sparse 2026.1.0
onnx 1.21.0
onnx-ir 0.1.16
onnxscript 0.6.2
opt-einsum 3.3.0
optree 0.13.0
packaging 24.2
pandas 2.2.3
parameterized 0.8.1
pathspec 1.1.1
pillow 12.3.0
pip 26.1.2
platformdirs 4.11.0
pluggy 1.6.0
ply 3.11
pooch 1.9.0
propcache 0.5.2
protobuf 6.33.5
psutil 7.2.2
PuLP 2.9.0
pwlf 2.2.1
pyaml 26.7.0
pyasn1 0.6.4
pyasn1_modules 0.4.2
pycparser 3.0
pyDOE 0.9.3
pyelftools 0.33
PyGithub 2.3.0
Pygments 2.20.0
PyJWT 2.13.0
PyNaCl 1.6.2
pyproject_hooks 1.2.0
pyre-extensions 0.0.32
pytest 7.3.2
pytest-cpp 2.3.0
pytest-flakefinder 1.1.0
pytest-rerunfailures 14.0
pytest-subtests 0.13.1
pytest-timeout 2.4.0
pytest-xdist 3.3.1
python-dateutil 2.9.0.post0
pytz 2026.3.post1
PyWavelets 1.7.0
PyYAML 6.0.3
pyzes 0.1.2
pyzstd 0.16.2
redis 8.1.0
requests 2.34.2
requests-oauthlib 2.0.0
s3transfer 0.10.4
scikit-build 0.18.1
scikit_build_core 1.0.0
scikit-image 0.22.0
scikit-learn 1.9.0
scipy 1.14.1
setuptools 78.1.1
setuptools-git-versioning 2.1.0
six 1.17.0
sortedcontainers 2.4.0
soundfile 0.14.0
soxr 1.1.0
spin 0.17
sympy 1.13.3
tabulate 0.9.0
tbb 2023.1.0
tcmlib 1.5.0
tensorboard 2.13.0
tensorboard-data-server 0.7.2
threadpoolctl 3.6.0
thriftpy2 0.5.3
tifffile 2026.3.3
tlparse 0.4.0
torch 2.14.0.dev20260803+xpu
torchao 0.18.0+xpu
torchaudio 2.11.0.dev20260804+xpu
torchvision 0.29.0.dev20260804+xpu
tqdm 4.70.0
triton-xpu 3.7.2+git5fcc14d9
typing_extensions 4.12.2
typing-inspect 0.9.0
tzdata 2026.3
umf 1.1.0
unittest-xml-reporting 3.2.0
urllib3 2.7.0
uv 0.12.1
Werkzeug 3.1.8
wheel 0.47.0
wrapt 2.3.0
xdoctest 1.3.0
yarl 1.24.5
z3-solver 4.15.1.0
zipp 4.1.0
```
Contributor guide
Research direction
Start with third_party/torch-xpu-ops/test/xpu/extended/test_ops_xpu.py and run the four affected tests, beginning with TestCommonXPU.test_compare_cpu_where_xpu_bfloat16. Use the provided extended-test command and inspect the BComplex32 mul_cpu and empty_xpu_float32 failures. Done means the listed tests pass on the reported WSL Intel XPU environment without these errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100