Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
HanGuo97 opened this issue Apr 16, 2024 · 4 comments
Open

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

HanGuo97 opened this issue Apr 16, 2024 · 4 comments

Comments

@HanGuo97
Copy link

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

@hwu36
Copy link
Collaborator

hwu36 commented Apr 24, 2024

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.

@HanGuo97
Copy link
Author

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?

Copy link

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.

Copy link

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.

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

No branches or pull requests

3 participants