Skip to content

Enable two XPU dtype paths that were causing quantization tests to fail. - #4434

Merged
torchxpubot merged 6 commits into
mainfrom
bbela/add-dispatch
Jul 27, 2026
Merged

Enable two XPU dtype paths that were causing quantization tests to fail.#4434
torchxpubot merged 6 commits into
mainfrom
bbela/add-dispatch

Conversation

@BBBela

@BBBela BBBela commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Fixes: #4445

Changes

  1. Add Float4_e2m1fn_x2 support to XPU eq/ne compare dispatch.
  2. Add Bits* support to XPU copy.

Motivation

Without this change, two tests from upstream are failing:

python test/quantization/core/experimental/test_floatx.py TestFloat4DtypeXPU.test_float4_e2m1fn_x2_xpu
python test/quantization/core/experimental/test_bits.py TestBitsXPU.test_types_xpu

this change fixes those two cases and allows to enable xpu on those two test files.

BBBela added 2 commits July 23, 2026 13:50
Signed-off-by: Benedykt Bela <benedykt.bela@intel.com>
Signed-off-by: Benedykt Bela <benedykt.bela@intel.com>
@BBBela BBBela self-assigned this Jul 23, 2026
@BBBela BBBela added disable_e2e Disable all e2e test jobs for the PR disable_distributed Disable distributed UT test jobs for the PR disable_auto Disable auto label workflow for PR labels Jul 23, 2026
Signed-off-by: Benedykt Bela <benedykt.bela@intel.com>
Comment thread src/ATen/native/xpu/sycl/CopyKernel.cpp
Comment thread src/ATen/native/xpu/sycl/CopyKernel.cpp
Signed-off-by: Benedykt Bela <benedykt.bela@intel.com>
@BBBela

BBBela commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Thank you @tszulist-hbn and @astachowiczhabana for spotting the lack of TORCH_CHECK! I added this check like CUDA does.

@BBBela

BBBela commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

For the record - after adding allow_xpu=True to the upstream test files, the tests are passing with changes from this PR:

~/pytorch/test$ python -m pytest -v quantization/core/experimental/test_bits.py -k test_types_xpu
=============================================================================== test session starts ===============================================================================

quantization/core/experimental/test_bits.py::TestBitsXPU::test_types_xpu PASSED [0.1433s]                                                                                    [100%]

~/pytorch/test$ python -m pytest -v quantization/core/experimental/test_floatx.py -k test_float4_e2m1fn_x2_xpu
=============================================================================== test session starts ================================================================================

quantization/core/experimental/test_floatx.py::TestFloat4DtypeXPU::test_float4_e2m1fn_x2_xpu PASSED [0.4205s]                                                                [100%]

@BBBela

BBBela commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

@torchxpubot merge

@torchxpubot
torchxpubot merged commit d174390 into main Jul 27, 2026
19 checks passed
@torchxpubot

Copy link
Copy Markdown

PR has been successfully merged by @BBBela.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disable_auto Disable auto label workflow for PR disable_distributed Disable distributed UT test jobs for the PR disable_e2e Disable all e2e test jobs for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MIGRATION] Failing test cases in test_bits.py and test_floatx.py test files.

5 participants