Skip to content

[FEA]: Deprecate BLOCK_REDUCE_WARP_REDUCTIONS_NONDETERMINISTIC algorithm #11909

Open

Description

@fbusato

Is this a duplicate?

Area

CUB

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

Evaluated all algorithms of BlockReduce as a follow up of

on sm90, sm100, sm120 with 9 data types X 5 block sizes.
All configurations on all SMs consistently show that BLOCK_REDUCE_WARP_REDUCTIONS_NONDETERMINISTIC is always the slowest implementation.

Slowdown compared to the fastest algorithm:
Image

In addition, it only supports cuda::std::plus and types that work with atomic operations. On top, it is not deterministic.

Describe the solution you'd like

Deprecate BLOCK_REDUCE_WARP_REDUCTIONS_NONDETERMINISTIC and remove it in the next major version.

Optionally, we should also consider merging RAKING and RAKING_COMMUTATIVE_ONLY because their implementations are very similar.

Finally, the evaluation should be repeated after

Describe alternatives you've considered

No response

Additional context

No response

Activity

  1. bernhardmgruber commented on Oct 7, 2026

    @bernhardmgruber
    Contributor

    @NaderAlAwar for vis

  2. NaderAlAwar commented on Oct 7, 2026

    @NaderAlAwar
    Contributor

    @fbusato could you also try benchmarking cub.bench.reduce.nondeterministic.* to see if using any of the other block reduction algorithms improves performance? When the nondeterministic block reduce was introduced it was better than the others, curious to see if that still holds up. If it underperforms even for the non deterministic reduce, then we can consider dropping it.

  3. fbusato commented on Oct 7, 2026

    @fbusato
    ContributorAuthor

    yeah, this also an experiment that I tried yesterday. Replacing the default WARP_REDUCTIONS_NONDETERMINISTIC algorithm with the standard WARP_REDUCTIONS a slightly better performance ~1%/2% depending on the problem size. Clearly, DeviceReduce is memory bound, with several loads per thread, an only one block reduction, so it is expected that the overall impact is not huge.

  4. NaderAlAwar commented on Oct 7, 2026

    @NaderAlAwar
    Contributor

    So if I'm understanding correctly, it seems like the non-deterministic block reduce is always slower than the other implementations. In that case deprecating it is fine.

  5. bernhardmgruber commented on Oct 8, 2026

    @bernhardmgruber
    Contributor

    @NaderAlAwar but you added the non-deterministic block reduction and measured it's faster. I think that was for some GPU MODE leaderboard competition. Didn't we even have a blog post about it? Why would that suddenly no longer be true?

  6. NaderAlAwar commented on Oct 8, 2026

    @NaderAlAwar
    Contributor

    Besides the block reduce part, the non deterministic device reduce can be faster than the default run to run one because it launches only one kernel instead of two (it uses atomics to accumulate the partial results instead of another kernel), so it could be that that part is what gives it the speedup. I don't remember whether the non deterministic block reduce itself was needed.

    I can have an agent investigate

  7. fbusato commented on Oct 8, 2026

    @fbusato
    ContributorAuthor

    the only reason that WARP_REDUCTIONS_NONDETERMINISTIC could be fast is if shared mem atomic ops are also really fast, which is not the case

  8. fbusato commented on Oct 8, 2026

    @fbusato
    ContributorAuthor

    mentioned in #11909

  9. NaderAlAwar commented on Oct 8, 2026

    @NaderAlAwar
    Contributor

    Ran some experiments on an H200 and a B200. On an H200, using BLOCK_REDUCE_WARP_REDUCTIONS had no regressions, and on B200, BLOCK_REDUCE_RAKING had no regressions. We never tuned the non deterministic reduce on its own, so it may be worth doing that. Could be easier with the new tuning skill we have

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions