[PERF] fix: Correct AR 1stage Gating Condition - #3880
Merged
Conversation
Co-developed-by: Yankui Wang <yankui87@sjtu.edu.cn> Co-developed-by: Yingyi Hao <jpy794@hotmail.com>
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
valarLip
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
This PR addresses an issue in the AllReduce 1-stage / 2-stage dispatch threshold introduced in #3458.
In that PR, the condition was written as:
but the intended condition should be:
The threshold comes from the measurements in #3458. For inference workloads on models such as Kimi, the AllReduce path should use the 1-stage implementation for
M <= 32under TP4, and forM <= 16under TP8. Larger shapes should use the 2-stage implementation.Because the condition was computed incorrectly, the actual dispatch policy did not change as intended. In particular, TP4 was still only using the 1-stage path for
M <= 8.This PR fixes the threshold calculation and has been tested on MI350X.
Technical Details
See #3458
Test Plan
See #3458
Test Result
See #3458