Failing test cases related to SDPA from `test_transformers_xpu.py`.
- Dominant language
- Python
- Stars
- 113
- Forks
- 128
- Avg merge
- 5d 9h
- Merged PRs (30d)
- 112
Description
### 🐛 Describe the bug
I am not sure if those two cases have the same root cause, but it looks like they started failing in the same or similar time and are both in the SDPA related test class. Feel free to split this issue into two if those two test cases are not related with each other.
Example workflow with fail:
https://github.com/intel/torch-xpu-ops/actions/runs/27962364465
Cases:
op_ut,third_party.torch-xpu-ops.test.xpu.test_transformers_xpu.TestSDPACudaOnlyXPU,test_singelton_head_dim_stride_ne_1_xpu
~~op_ut,third_party.torch-xpu-ops.test.xpu.test_transformers_xpu.TestSDPAXpuOnlyXPU,test_flash_attention_headdim_size_xpu~~
Error logs
```text
2026-06-22T23:02:23.7293646Z ___________ TestSDPAXpuOnlyXPU.test_flash_attention_headdim_size_xpu ___________
2026-06-22T23:02:23.7294131Z [gw1] linux -- Python 3.10.20 /tmp/xpu-tool/Python/3.10.20/x64/bin/python
2026-06-22T23:02:23.7294513Z Traceback (most recent call last):
2026-06-22T23:02:23.7295170Z File "/__w/torch-xpu-ops/torch-xpu-ops/pytorch/third_party/torch-xpu-ops/test/xpu/test_transformers_xpu.py", line 6915, in test_flash_attention_headdim_size
2026-06-22T23:02:23.7295900Z with self.assertRaisesRegex(RuntimeError, "No available kernel"):
2026-06-22T23:02:23.7296477Z File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/unittest/case.py", line 226, in __exit__
2026-06-22T23:02:23.7296970Z self._raiseFailure("{} not raised".format(exc_name))
2026-06-22T23:02:23.7297490Z File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/unittest/case.py", line 163, in _raiseFailure
2026-06-22T23:02:23.7297988Z raise self.test_case.failureException(msg)
2026-06-22T23:02:23.7298320Z AssertionError: RuntimeError not raised
2026-06-22T23:02:23.7298506Z
2026-06-22T23:02:23.7298683Z To execute this test, run the following from the base repo dir:
2026-06-22T23:02:23.7299290Z PYTORCH_TEST_WITH_SLOW=1 python test/xpu/test_transformers_xpu.py TestSDPAXpuOnlyXPU.test_flash_attention_headdim_size_xpu
2026-06-22T23:02:23.7299729Z
2026-06-22T23:02:23.7264800Z _________ TestSDPACudaOnlyXPU.test_singelton_head_dim_stride_ne_1_xpu __________
2026-06-22T23:02:23.7265293Z [gw1] linux -- Python 3.10.20 /tmp/xpu-tool/Python/3.10.20/x64/bin/python
2026-06-22T23:02:23.7265674Z Traceback (most recent call last):
2026-06-22T23:02:23.7266374Z File "/__w/torch-xpu-ops/torch-xpu-ops/pytorch/third_party/torch-xpu-ops/test/xpu/test_transformers_xpu.py", line 4363, in test_singelton_head_dim_stride_ne_1
2026-06-22T23:02:23.7267049Z scaled_dot_product_attention(query, key, value)
2026-06-22T23:02:23.7267519Z RuntimeError: mha_fwd on xpu: input tensor must have contiguous last dimension
2026-06-22T23:02:23.7267817Z
2026-06-22T23:02:23.7267986Z To execute this test, run the following from the base repo dir:
2026-06-22T23:02:23.7268608Z PYTORCH_TEST_WITH_SLOW=1 python test/xpu/test_transformers_xpu.py TestSDPACudaOnlyXPU.test_singelton_head_dim_stride_ne_1_xpu
```
### Versions
Versions
```text
2026-06-22T19:08:54.4408232Z PyTorch version: 2.14.0a0+gitdbd6811
2026-06-22T19:08:54.4408534Z Is debug build: False
2026-06-22T19:08:54.4408812Z CUDA used to build PyTorch: None
2026-06-22T19:08:54.4409097Z ROCM used to build PyTorch: N/A
2026-06-22T19:08:54.4409277Z
2026-06-22T19:08:54.4409379Z OS: Ubuntu 24.04.4 LTS (x86_64)
2026-06-22T19:08:54.4409694Z GCC version: (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
2026-06-22T19:08:54.4410530Z Clang version: Could not collect
2026-06-22T19:08:54.4410822Z CMake version: version 3.31.6
2026-06-22T19:08:54.4411095Z Libc version: glibc-2.39
2026-06-22T19:08:54.4411257Z
2026-06-22T19:08:54.4411473Z Python version: 3.10.20 (main, Jun 16 2026, 21:01:32) [GCC 13.3.0] (64-bit runtime)
2026-06-22T19:08:54.4411966Z Python platform: Linux-5.15.0-179-generic-x86_64-with-glibc2.39
2026-06-22T19:08:54.4412337Z Is CUDA available: False
2026-06-22T19:08:54.4412596Z CUDA runtime version: No CUDA
2026-06-22T19:08:54.4412874Z CUDA_MODULE_LOADING set to: N/A
2026-06-22T19:08:54.4413152Z GPU models and configuration: No CUDA
2026-06-22T19:08:54.4413446Z Nvidia driver version: No CUDA
2026-06-22T19:08:54.4413716Z cuDNN version: No CUDA
2026-06-22T19:08:54.4413958Z Is XPU available: True
2026-06-22T19:08:54.4414212Z XPU used to build PyTorch: 20260000
2026-06-22T19:08:54.4414505Z Intel GPU driver version:
2026-06-22T19:08:54.4414788Z * intel-opencl-icd: 25.18.33578.51-1146~24.04
2026-06-22T19:08:54.4415103Z * libze1: 1.24.0.0-1146~24.04
2026-06-22T19:08:54.4415371Z Intel GPU models onboard:
2026-06-22T19:08:54.4415632Z * Intel(R) Data Center GPU Max 1100
2026-06-22T19:08:54.4415913Z * Intel(R) Data Center GPU Max 1100
2026-06-22T19:08:54.4416195Z * Intel(R) Data Center GPU Max 1100
2026-06-22T19:08:54.4416468Z * Intel(R) Data Center GPU Max 1100
2026-06-22T19:08:54.4416736Z * Intel(R) Data Center GPU Max 1100
2026-06-22T19:08:54.4417011Z * Intel(R) Data Center GPU Max 1100
2026-06-22T19:08:54.4417277Z * Intel(R) Data Center GPU Max 1100
2026-06-22T19:08:54.4417545Z * Intel(R) Data Center GPU Max 1100
2026-06-22T19:08:54.4417822Z Intel GPU models detected:
2026-06-22T19:08:54.4419623Z * [0] _XpuDeviceProperties(name='Intel(R) Data Center GPU Max 1100', platform_name='Intel(R) oneAPI Unified Runtime over Level-Zero', type='gpu', device_id=0xBDA, uuid=8680da0b-2f00-0000-0f00-000000000000, driver_version='1.6.33578+51', total_memory=49136MB, local_mem_size=128KB, last_level_cache_size=196608KB, max_compute_units=448, memory_clock_rate=3200MHz, memory_bus_width=64-bit, gpu_eu_count=448, gpu_subslice_count=56, max_work_group_size=1024, max_num_sub_groups=64, sub_group_sizes=[16 32], has_fp16=1, has_fp64=1, has_atomic64=1, is_integrated_gpu=0)
2026-06-22T19:08:54.4422899Z * [1] _XpuDeviceProperties(name='Intel(R) Data Center GPU Max 1100', platform_name='Intel(R) oneAPI Unified Runtime over Level-Zero', type='gpu', device_id=0xBDA, uuid=8680da0b-2f00-0000-1600-000000000000, driver_version='1.6.33578+51', total_memory=49136MB, local_mem_size=128KB, last_level_cache_size=196608KB, max_compute_units=448, memory_clock_rate=3200MHz, memory_bus_width=64-bit, gpu_eu_count=448, gpu_subslice_count=56, max_work_group_size=1024, max_num_sub_groups=64, sub_group_sizes=[16 32], has_fp16=1, has_fp64=1, has_atomic64=1, is_integrated_gpu=0)
2026-06-22T19:08:54.4426206Z * [2] _XpuDeviceProperties(name='Intel(R) Data Center GPU Max 1100', platform_name='Intel(R) oneAPI Unified Runtime over Level-Zero', type='gpu', device_id=0xBDA, uuid=8680da0b-2f00-0000-1a00-000000000000, driver_version='1.6.33578+51', total_memory=49136MB, local_mem_size=128KB, last_level_cache_size=196608KB, max_compute_units=448, memory_clock_rate=3200MHz, memory_bus_width=64-bit, gpu_eu_count=448, gpu_subslice_count=56, max_work_group_size=1024, max_num_sub_groups=64, sub_group_sizes=[16 32], has_fp16=1, has_fp64=1, has_atomic64=1, is_integrated_gpu=0)
2026-06-22T19:08:54.4429431Z * [3] _XpuDeviceProperties(name='Intel(R) Data Center GPU Max 1100', platform_name='Intel(R) oneAPI Unified Runtime over Level-Zero', type='gpu', device_id=0xBDA, uuid=8680da0b-2f00-0000-1e00-000000000000, driver_version='1.6.33578+51', total_memory=49136MB, local_mem_size=128KB, last_level_cache_size=196608KB, max_compute_units=448, memory_clock_rate=3200MHz, memory_bus_width=64-bit, gpu_eu_count=448, gpu_subslice_count=56, max_work_group_size=1024, max_num_sub_groups=64, sub_group_sizes=[16 32], has_fp16=1, has_fp64=1, has_atomic64=1, is_integrated_gpu=0)
2026-06-22T19:08:54.4432791Z * [4] _XpuDeviceProperties(name='Intel(R) Data Center GPU Max 1100', platform_name='Intel(R) oneAPI Unified Runtime over Level-Zero', type='gpu', device_id=0xBDA, uuid=8680da0b-2f00-0000-8a00-000000000000, driver_version='1.6.33578+51', total_memory=49136MB, local_mem_size=128KB, last_level_cache_size=196608KB, max_compute_units=448, memory_clock_rate=3200MHz, memory_bus_width=64-bit, gpu_eu_count=448, gpu_subslice_count=56, max_work_group_size=1024, max_num_sub_groups=64, sub_group_sizes=[16 32], has_fp16=1, has_fp64=1, has_atomic64=1, is_integrated_gpu=0)
2026-06-22T19:08:54.4436166Z * [5] _XpuDeviceProperties(name='Intel(R) Data Center GPU Max 1100', platform_name='Intel(R) oneAPI Unified Runtime over Level-Zero', type='gpu', device_id=0xBDA, uuid=8680da0b-2f00-0000-8e00-000000000000, driver_version='1.6.33578+51', total_memory=49136MB, local_mem_size=128KB, last_level_cache_size=196608KB, max_compute_units=448, memory_clock_rate=3200MHz, memory_bus_width=64-bit, gpu_eu_count=448, gpu_subslice_count=56, max_work_group_size=1024, max_num_sub_groups=64, sub_group_sizes=[16 32], has_fp16=1, has_fp64=1, has_atomic64=1, is_integrated_gpu=0)
2026-06-22T19:08:54.4439407Z * [6] _XpuDeviceProperties(name='Intel(R) Data Center GPU Max 1100', platform_name='Intel(R) oneAPI Unified Runtime over Level-Zero', type='gpu', device_id=0xBDA, uuid=8680da0b-2f00-0000-c000-000000000000, driver_version='1.6.33578+51', total_memory=49136MB, local_mem_size=128KB, last_level_cache_size=196608KB, max_compute_units=448, memory_clock_rate=3200MHz, memory_bus_width=64-bit, gpu_eu_count=448, gpu_subslice_count=56, max_work_group_size=1024, max_num_sub_groups=64, sub_group_sizes=[16 32], has_fp16=1, has_fp64=1, has_atomic64=1, is_integrated_gpu=0)
2026-06-22T19:08:54.4442639Z * [7] _XpuDeviceProperties(name='Intel(R) Data Center GPU Max 1100', platform_name='Intel(R) oneAPI Unified Runtime over Level-Zero', type='gpu', device_id=0xBDA, uuid=8680da0b-2f00-0000-c400-000000000000, driver_version='1.6.33578+51', total_memory=49136MB, local_mem_size=128KB, last_level_cache_size=196608KB, max_compute_units=448, memory_clock_rate=3200MHz, memory_bus_width=64-bit, gpu_eu_count=448, gpu_subslice_count=56, max_work_group_size=1024, max_num_sub_groups=64, sub_group_sizes=[16 32], has_fp16=1, has_fp64=1, has_atomic64=1, is_integrated_gpu=0)
2026-06-22T19:08:54.4444406Z HIP runtime version: N/A
2026-06-22T19:08:54.4444672Z MIOpen runtime version: N/A
2026-06-22T19:08:54.4444946Z Is XNNPACK available: False
2026-06-22T19:08:54.4445226Z Caching allocator config: N/A
2026-06-22T19:08:54.4445399Z
2026-06-22T19:08:54.4445500Z CPU:
2026-06-22T19:08:54.4445744Z Architecture: x86_64
2026-06-22T19:08:54.4446114Z CPU op-mode(s): 32-bit, 64-bit
2026-06-22T19:08:54.4446549Z Address sizes: 46 bits physical, 57 bits virtual
2026-06-22T19:08:54.4446957Z Byte Order: Little Endian
2026-06-22T19:08:54.4447309Z CPU(s): 192
2026-06-22T19:08:54.4447645Z On-line CPU(s) list: 0-191
2026-06-22T19:08:54.4447987Z Vendor ID: GenuineIntel
2026-06-22T19:08:54.4448384Z Model name: Intel(R) Xeon(R) Platinum 8468V
2026-06-22T19:08:54.4448753Z CPU family: 6
2026-06-22T19:08:54.4449059Z Model: 143
2026-06-22T19:08:54.4449387Z Thread(s) per core: 2
2026-06-22T19:08:54.4449693Z Core(s) per socket: 48
2026-06-22T19:08:54.4449996Z Socket(s): 2
2026-06-22T19:08:54.4450295Z Stepping: 8
2026-06-22T19:08:54.4450613Z Frequency boost: enabled
2026-06-22T19:08:54.4450940Z CPU(s) scaling MHz: 106%
2026-06-22T19:08:54.4451272Z CPU max MHz: 2401.0000
2026-06-22T19:08:54.4451597Z CPU min MHz: 800.0000
2026-06-22T19:08:54.4452072Z BogoMIPS: 4800.00
2026-06-22T19:08:54.4456009Z Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 invpcid_single intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities ibpb_exit_to_user
2026-06-22T19:08:54.4460078Z Virtualization: VT-x
2026-06-22T19:08:54.4460441Z L1d cache: 4.5 MiB (96 instances)
2026-06-22T19:08:54.4460818Z L1i cache: 3 MiB (96 instances)
2026-06-22T19:08:54.4461182Z L2 cache: 192 MiB (96 instances)
2026-06-22T19:08:54.4461555Z L3 cache: 195 MiB (2 instances)
2026-06-22T19:08:54.4461893Z NUMA node(s): 2
2026-06-22T19:08:54.4462229Z NUMA node0 CPU(s): 0-47,96-143
2026-06-22T19:08:54.4462594Z NUMA node1 CPU(s): 48-95,144-191
2026-06-22T19:08:54.4462976Z Vulnerability Gather data sampling: Not affected
2026-06-22T19:08:54.4463364Z Vulnerability Indirect target selection: Not affected
2026-06-22T19:08:54.4463752Z Vulnerability Itlb multihit: Not affected
2026-06-22T19:08:54.4464117Z Vulnerability L1tf: Not affected
2026-06-22T19:08:54.4464472Z Vulnerability Mds: Not affected
2026-06-22T19:08:54.4464845Z Vulnerability Meltdown: Not affected
2026-06-22T19:08:54.4465203Z Vulnerability Mmio stale data: Not affected
2026-06-22T19:08:54.4465572Z Vulnerability Reg file data sampling: Not affected
2026-06-22T19:08:54.4465946Z Vulnerability Retbleed: Not affected
2026-06-22T19:08:54.4466310Z Vulnerability Spec rstack overflow: Not affected
2026-06-22T19:08:54.4466852Z Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
2026-06-22T19:08:54.4467564Z Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
2026-06-22T19:08:54.4468361Z Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
2026-06-22T19:08:54.4468983Z Vulnerability Srbds: Not affected
2026-06-22T19:08:54.4469353Z Vulnerability Tsa: Not affected
2026-06-22T19:08:54.4469725Z Vulnerability Tsx async abort: Not affected
2026-06-22T19:08:54.4470173Z Vulnerability Vmscape: Mitigation; IBPB before exit to userspace
2026-06-22T19:08:54.4470472Z
2026-06-22T19:08:54.4470593Z Versions of relevant libraries:
2026-06-22T19:08:54.4470879Z [pip3] dpcpp-cpp-rt==2026.0.0
2026-06-22T19:08:54.4471163Z [pip3] impi-rt==2021.18.0
2026-06-22T19:08:54.4471435Z [pip3] intel-cmplr-lib-rt==2026.0.0
2026-06-22T19:08:54.4471732Z [pip3] intel-cmplr-lib-ur==2026.0.0
2026-06-22T19:08:54.4472025Z [pip3] intel-cmplr-lic-rt==2026.0.0
2026-06-22T19:08:54.4472458Z [pip3] intel-opencl-rt==2026.0.0
2026-06-22T19:08:54.4472746Z [pip3] intel-openmp==2026.0.0
2026-06-22T19:08:54.4473021Z [pip3] intel-pti==0.17.0
2026-06-22T19:08:54.4473285Z [pip3] intel-sycl-rt==2026.0.0
2026-06-22T19:08:54.4473547Z [pip3] mkl==2026.0.0
2026-06-22T19:08:54.4473792Z [pip3] mypy==1.16.0
2026-06-22T19:08:54.4474035Z [pip3] mypy_extensions==1.1.0
2026-06-22T19:08:54.4474297Z [pip3] numpy==1.24.4
2026-06-22T19:08:54.4474563Z [pip3] nvidia-cuda-cupti==13.3.35
2026-06-22T19:08:54.4474838Z [pip3] oneccl==2022.0.0
2026-06-22T19:08:54.4475083Z [pip3] oneccl-devel==2022.0.0
2026-06-22T19:08:54.4475352Z [pip3] onemkl-license==2026.0.0
2026-06-22T19:08:54.4475703Z [pip3] onemkl-sycl-blas==2026.0.0
2026-06-22T19:08:54.4475995Z [pip3] onemkl-sycl-dft==2026.0.0
2026-06-22T19:08:54.4476289Z [pip3] onemkl-sycl-lapack==2026.0.0
2026-06-22T19:08:54.4476577Z [pip3] onemkl-sycl-rng==2026.0.0
2026-06-22T19:08:54.4476857Z [pip3] onemkl-sycl-sparse==2026.0.0
2026-06-22T19:08:54.4477144Z [pip3] onnx==1.21.0
2026-06-22T19:08:54.4477388Z [pip3] onnx-ir==0.1.16
2026-06-22T19:08:54.4477640Z [pip3] onnxscript==0.6.2
2026-06-22T19:08:54.4477902Z [pip3] optree==0.13.0
2026-06-22T19:08:54.4478138Z [pip3] tbb==2023.0.0
2026-06-22T19:08:54.4478369Z [pip3] tcmlib==1.5.0
2026-06-22T19:08:54.4478618Z [pip3] torch==2.14.0a0+gitdbd6811
2026-06-22T19:08:54.4478902Z [pip3] torchao==0.18.0.dev20260621+xpu
2026-06-22T19:08:54.4479190Z [pip3] torchaudio==2.11.0a0+c0cbdb9
2026-06-22T19:08:54.4479474Z [pip3] torchvision==0.28.0a0+85a1dcc
2026-06-22T19:08:54.4479762Z [pip3] triton-xpu==3.7.2+git5fcc14d9
2026-06-22T19:08:54.4480034Z [pip3] umf==1.1.0
2026-06-22T19:08:54.4480284Z [conda] No relevant packages
2026-06-22T19:08:54.8836537Z + pip list
2026-06-22T19:08:54.8836966Z + grep -E 'torch|intel'
2026-06-22T19:08:55.1769409Z intel-cmplr-lib-rt 2026.0.0
2026-06-22T19:08:55.1769744Z intel-cmplr-lib-ur 2026.0.0
2026-06-22T19:08:55.1770034Z intel-cmplr-lic-rt 2026.0.0
2026-06-22T19:08:55.1770361Z intel-opencl-rt 2026.0.0
2026-06-22T19:08:55.1770669Z intel-openmp 2026.0.0
2026-06-22T19:08:55.1770947Z intel-pti 0.17.0
2026-06-22T19:08:55.1771226Z intel-sycl-rt 2026.0.0
2026-06-22T19:08:55.1771563Z torch 2.14.0a0+gitdbd6811
2026-06-22T19:08:55.1771905Z torchao 0.18.0.dev20260621+xpu
2026-06-22T19:08:55.1772225Z torchaudio 2.11.0a0+c0cbdb9
2026-06-22T19:08:55.1772535Z torchvision 0.28.0a0+85a1dcc
```
Contributor guide
Assessment
This issue has not been assessed yet.