Developer Tools

trunk/6657db391a6918d424747c50d79226217f772140: [xpu][fix] Skip test_device_capability_supported_dtypes on XPU (#180660)

Barebones data types like uint1–uint7 cause segfaults on Intel XPUs...

Deep Dive

PyTorch has temporarily skipped the `test_device_capability_supported_dtypes` test on XPU (Intel's GPU architecture) due to a compatibility issue with barebones data types. The problem stems from data types like `uint1`–`uint7` and opaque bit-field types (e.g., `Bits1x8`) defined in PyTorch's `ScalarType.h`, which are not supported by the `cast_and_store` function in `DynamicCast.h`. When users call `t.to(dtype)` with these types on XPU, the CUDA-style kernel assert (`CUDA_KERNEL_ASSERT`) triggers undefined behavior—causing segfaults or intermittent test passes depending on kernel completion timing.

To avoid runtime corruption, the team opted to skip the test rather than patch the assert. The fix is tracked in PR #180660 and approved by reviewers EikanWang and albanD. Basic coverage for `torch.accelerator.get_device_capability` remains in `test_xpu.py`. This highlights ongoing challenges in adapting CUDA-centric PyTorch code for XPU backends.

Key Points
  • Data types uint1–uint7 and Bits1x8 cause segfaults on XPU when used with `t.to(dtype)`
  • CUDA kernel assert in DynamicCast.h leads to undefined behavior on Intel GPUs
  • Test skipped; basic `get_device_capability` coverage remains in test_xpu.py

Why It Matters

Highlights PyTorch's XPU backend fragility, impacting Intel GPU users relying on low-precision dtypes.