cutlass
cutlass copied to clipboard
[QST] StreamK ReductionStrategy: "Atomic" or "Mixed"
What is your question?
Hi, I'm learning/going through the StreamK implementation in CUTLASS, and came across various reduction strategies:
/// Reduction strategy
enum ReductionStrategy
{
kNone, // Data-parallel strategy (no seams, fixup, etc.)
kAtomic, // Non-deterministic reduction of SK-block partials using atomic aggregation in L2
kMixed, // Deterministic reduction of SK-block partials employing either:
// (a) A separate wave of reduction thread blocks" (for scenarios with lots of
// SK-blocks per SK-tile)
// (b) Turnstile-ordered atomic aggregation in L2 (for scenarios with few
// SK-blocks per SK-tile)
};
static ReductionStrategy const kReductionStrategy = kMixed;
The current implementation hard-coded the choice. Does that mean the Mixed
choice is strictly preferred to Atomic
? It'd be great if someone could comment on situations when one strategy would be preferred to another --- thanks!!
the output is not deterministic if you use atomic with float point. it is hard to debug the numeric issues. atomic is usually faster though.
Thanks for the answer! I noticed a similar decision is made in the Hopper implementation of StreamK. If I understand correctly of what you said, most of these choices are out of convenience reason, whereas kAtomic
(in the Ampere case) or Nondeterministic
(in the Hopper case) is preferred if speed is prioritized?
This issue has been labeled inactive-30d
due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d
if there is no activity in the next 60 days.
This issue has been labeled inactive-90d
due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.