You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
@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.
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.
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.
@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?
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.
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
Activity
bernhardmgruber commentedon Oct 7, 2026
@NaderAlAwar for vis
NaderAlAwar commentedon Oct 7, 2026
@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.fbusato commentedon Oct 7, 2026
yeah, this also an experiment that I tried yesterday. Replacing the default
WARP_REDUCTIONS_NONDETERMINISTICalgorithm with the standardWARP_REDUCTIONSa 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.NaderAlAwar commentedon Oct 7, 2026
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.
bernhardmgruber commentedon Oct 8, 2026
@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?
NaderAlAwar commentedon Oct 8, 2026
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
fbusato commentedon Oct 8, 2026
the only reason that
WARP_REDUCTIONS_NONDETERMINISTICcould be fast is if shared mem atomic ops are also really fast, which is not the casefbusato commentedon Oct 8, 2026
mentioned in #11909
NaderAlAwar commentedon Oct 8, 2026
Ran some experiments on an H200 and a B200. On an H200, using
BLOCK_REDUCE_WARP_REDUCTIONShad no regressions, and on B200,BLOCK_REDUCE_RAKINGhad 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