ao icon indicating copy to clipboard operation
ao copied to clipboard

[xpu][test] Make tests in test_float8_tensor.py device agnostic

Open Stonepia opened this issue 1 month ago • 2 comments

This PR makes test_float8_tensor.py device agnostic and supports XPU.

Dependencies

This PR dependends on following PR.

  • PyTorch: https://github.com/pytorch/pytorch/pull/166056 : 166056 registered torch._scaled_mm for XPU device. Without it, the scaled_mm will fallback to CPU device, and cause the RowWise tests failed (CPU only supports tensorwise scaling for now).

If 166056 not merged, 57 tests will fail with the error message:

Now _scaled_mm only supports per-tensor scaling for CPU backend.
  • torchao: https://github.com/pytorch/ao/pull/3249 : 3249 adds the util function for auto_detect_device. We will need a rebase after 3249 is merged.

Test Status

After the dependencies in the above are merged, the tests will be 428 passed and 28 skipped. All the skipped tests are due to the fbgemm check _is_fbgemm_gpu_genai_available().

# Skipped Lists
test_bmm: 2 tests
test_expected_gpu_kernel_fbgemm: 1 test.
test_fp8_conv_variants : 16 tests.
test_fp8_conv_skip_quant: 8 tests.
test_moe_weight_reshape_ops: 1 test.

Stonepia avatar Nov 12 '25 07:11 Stonepia

:link: Helpful Links

:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/3332

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.

pytorch-bot[bot] avatar Nov 12 '25 07:11 pytorch-bot[bot]

@pytorchbot label "xpu"

Stonepia avatar Nov 12 '25 07:11 Stonepia

@Stonepia since the scaled_mm has been merged. pls rebase this pr again.

liangan1 avatar Dec 03 '25 23:12 liangan1

@pytorchbot rebase

liangan1 avatar Dec 11 '25 05:12 liangan1

@Stonepia pls rebase this PR.

liangan1 avatar Dec 12 '25 00:12 liangan1

To add the ciflow label ciflow/xpu please first approve the workflows that are awaiting approval (scroll to the bottom of this page).

This helps ensure we don't trigger CI on this PR until it is actually authorized to do so. Please ping one of the reviewers if you do not have access to approve and run workflows.

pytorch-bot[bot] avatar Dec 12 '25 00:12 pytorch-bot[bot]

@pytorchbot rebase

Stonepia avatar Dec 12 '25 12:12 Stonepia

You don't have permissions to rebase this PR since you are a first time contributor. If you think this is a mistake, please contact PyTorch Dev Infra.

pytorch-bot[bot] avatar Dec 12 '25 12:12 pytorch-bot[bot]