Skip to content

[FEA]: Optimize BlockReduce #5167

Closed

Description

@fbusato

Is this a duplicate?

Area

CUB

Is your feature request related to a problem? Please describe.

The current implementation of BlockReduce performs the final aggregation sequentially, executing one load for each warp in the block, i.e. block_size / warp_size. This could become a bottleneck for large block sizes, e.g. 1024 here an example.

A secondary issue is that ApplyWarpAggregates is called recursively with different template parameters, which negatively affects the compile time.

Describe the solution you'd like

Considering that __reduce_sync_op has low latency, comparable to a single shared memory access, it would make sense to evaluate the performance impact of a warp-level reduction in the last step of BlockReduce.

Describe alternatives you've considered

No response

Additional context

No response

Activity

  1. self-assigned this
    on Jul 7, 2025
  2. added
    cub
    on Jul 7, 2025
  3. charan-003 commented on May 18, 2026

    @charan-003
    Contributor

    Hi @fbusato, I'm interested in working on this optimization if that's okay

  4. fbusato commented on May 18, 2026

    @fbusato
    ContributorAuthor

    Hi @charan-003, would be amazing. Let me assign the issue to you. Let me know if you need further clarification

  5. charan-003 commented on May 18, 2026

    @charan-003
    Contributor

    Thanks for assigning this to me. I'm planning to replace the sequential warp aggregate loop in ApplyWarpAggregates with a cooperative warp reduction, using shuffle fallback. Let me know if I'm missing any other details that i need to consider!

  6. moved this from Todo to In Progress in CCCLon May 21, 2026
  7. moved this from In Progress to In Review in CCCLon May 21, 2026
  8. moved this from In Review to In Progress in CCCLon Jun 15, 2026
  9. moved this from In Progress to In Review in CCCLon Oct 16, 2026
  10. moved this from In Review to Done in CCCLon Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cub

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions