Skip to content

Conversation

@chunhuanMeng
Copy link
Contributor

@chunhuanMeng chunhuanMeng commented Oct 20, 2025

To solve #2207
Extends support for float8 data types across various XPU tensor indexing and transformation kernels, ensuring these operations are compatible with the new types. It also adds a regression test for flipping float8 tensors and removes the skip for float8 indexing tests.

Float8 type support:

  • Updated dispatch macros in XPUScalar.cpp and Indexing.cpp to include AT_FLOAT8_TYPES, enabling float8 support in scalar extraction, indexing, index_put, and deterministic index_put kernels.
  • Modified flip_kernel in TensorTransformationsKernels.cpp to support float8 and barebones unsigned types, updating the dispatch mechanism accordingly.
  • Included the new dispatch header Dispatch_v2.h for the updated dispatch macros.

Testing improvements:

  • Added a regression test for flipping float8 tensors in test_index_and_index_put.py to verify correctness of the operation on XPU.
  • Removed the skip for float8 tests in test_indexing_xpu.py, re-enabling these tests now that support is implemented.

Copilot AI review requested due to automatic review settings October 20, 2025 03:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds FP8 support to XPU tensor operations including flip, index, and index_put operations by migrating from legacy dispatch macros to the newer AT_DISPATCH_V2 system.

  • Migrates flip_kernel from AT_DISPATCH_ALL_TYPES_AND_COMPLEX_AND3 to AT_DISPATCH_V2
  • Migrates index_kernel and index_put_kernel from AT_DISPATCH_ALL_TYPES_AND_COMPLEX_AND4 to AT_DISPATCH_V2
  • Adds FP8 type support through AT_FLOAT8_TYPES expansion

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/ATen/native/xpu/sycl/TensorTransformationsKernels.cpp Updates flip_kernel to use AT_DISPATCH_V2 with FP8 support
src/ATen/native/xpu/sycl/Indexing.cpp Updates index_kernel and index_put_kernel to use AT_DISPATCH_V2 with FP8 support

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@chunhuanMeng
Copy link
Contributor Author

image image

@CuiYifeng CuiYifeng added this pull request to the merge queue Nov 3, 2025
Merged via the queue into main with commit 9aac5a1 Nov 3, 2025
49 of 50 checks passed
@CuiYifeng CuiYifeng deleted the meng_FP8 branch November 3, 2025 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants