Skip to content

[WIP] Replace shift_group_left with reduce_over_group in Reduce Sum#3987

Open
CuiYifeng wants to merge 1 commit into
mainfrom
yifeng/reduce_over_group
Open

[WIP] Replace shift_group_left with reduce_over_group in Reduce Sum#3987
CuiYifeng wants to merge 1 commit into
mainfrom
yifeng/reduce_over_group

Conversation

@CuiYifeng

Copy link
Copy Markdown
Contributor

This pull request refactors and enhances the reduction utilities in the SYCL backend to support native SYCL reduction operations when available, improving performance and maintainability. The most important changes are grouped below:

Support for Native SYCL Reduction Operations

  • Introduced the get_native_sycl_op and native_sycl_op_t type traits to detect and propagate native SYCL reduction operators from functors, enabling the use of optimized native reductions when possible.
  • Updated the SumFunctor to define a native_sycl_op (sycl::plus), allowing it to leverage SYCL’s built-in reduction.

Refactoring of Reduction Logic

  • Added the tree_reduce function, which uses the native SYCL operator for floating-point types if available, and otherwise falls back to a manual reduction loop. This is now used in place of the previous manual reduction code in group_reduce and group_x_reduce.

Integration and Propagation of Native Operators

  • Modified the func_wrapper_t and reduction kernel logic to propagate the detected native SYCL operator through the reduction pipeline, ensuring that the most efficient reduction method is chosen at compile time.

These changes collectively make the reduction code more generic, extensible, and able to utilize hardware-accelerated reductions where possible, while falling back to custom logic otherwise.

@github-actions github-actions Bot added disable_e2e Disable all e2e test jobs for the PR disable_distributed Disable distributed UT test jobs for the PR labels Jun 12, 2026
@chuanqi129 chuanqi129 marked this pull request as draft June 12, 2026 08:49
@chuanqi129 chuanqi129 marked this pull request as ready for review June 12, 2026 08:49
@CuiYifeng CuiYifeng force-pushed the yifeng/reduce_over_group branch from 8bd3f60 to b3d75f5 Compare June 12, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

1 participant