cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

[QST] StreamK ReductionStrategy: "Atomic" or "Mixed"

Open HanGuo97 opened this issue 10 months ago • 4 comments

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!!

HanGuo97 avatar Apr 16 '24 03:04 HanGuo97

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.

hwu36 avatar Apr 24 '24 02:04 hwu36

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?

HanGuo97 avatar Apr 24 '24 13:04 HanGuo97

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.

github-actions[bot] avatar May 29 '24 16:05 github-actions[bot]

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.

github-actions[bot] avatar Aug 27 '24 16:08 github-actions[bot]