Skip to content

[xpu][mx] Enable mx matmul tests on xpu#4251

Open
ugolowic wants to merge 1 commit intopytorch:mainfrom
ugolowic:enable_mx_mm_tests
Open

[xpu][mx] Enable mx matmul tests on xpu#4251
ugolowic wants to merge 1 commit intopytorch:mainfrom
ugolowic:enable_mx_mm_tests

Conversation

@ugolowic
Copy link
Copy Markdown
Contributor

@ugolowic ugolowic commented Apr 8, 2026

In the context of #3576.

To enable matmul tests on xpu, the "new" PyTorch matmul API needs to be used with torch 2.10+.

The older torch._scaled_mm infers scaling type and memory layout from tensor shapes alone. This only works on CUDA with the specific swizzled scale layout the hardware expects.

PyTorch 2.10 introduced torch.functional.scaled_mm as the public API. It takes explicit ScalingType and SwizzleType arguments, making it possible to specify non-swizzled layouts needed by backends like XPU.

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Apr 8, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4251

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 8, 2026
- Parametrize the mx matmul tests by device.
- Use F.scaled_mm (torch 2.10+) which takes explicit
  ScalingType/SwizzleType args enabling non-CUDA backends,
  fall back to torch._scaled_mm on older versions
  (CUDA-only, implicit layout).

Signed-off-by: Ula Golowicz <urszula.golowicz@intel.com>
@ugolowic ugolowic force-pushed the enable_mx_mm_tests branch from 865a1a2 to 9efa4a7 Compare April 8, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant