Repository navigation
refactor(dist): unify fused AR+RMSNorm+quant public API - #4039
Merged
Merged
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
gbyu-amd
force-pushed
the
unify-fused-ar-rmsnorm-quant-api
branch
5 times, most recently
from
July 1, 2026 14:50
45b943b to
e88872d
Compare
Collapse tensor_model_parallel_fused_allreduce_rmsnorm_quant_per_group() into tensor_model_parallel_fused_allreduce_rmsnorm_quant(), dispatching on quant_type (and group_size for the block size) so users have a single entry point. The unified public function normalizes quant_type and, for the per-group family, routes to GroupCoordinator.fused_allreduce_rmsnorm_quant_per_group, which dispatches the torch.library-registered op so the fusion stays traceable under torch.compile. Other quant types keep the existing generic path. quant_type normalization is now single-sourced: _FUSED_AR_RMS_QUANT_ALIASES and _normalize_fused_ar_rms_quant_type live in communication_op.py, and communicator_cuda imports the normalizer from there (lazily, inside its eager device method, to avoid an aiter.dist import cycle). No duplicated alias tables. Graph-safety notes: - No import inside the traced call; the branch is on the constant quant_type, so Dynamo constant-folds it (matching the existing `if quant_type == "per_token"` fast path). The normalizer's try/except is off the taken path for valid inputs. - No new eager import edge: communication_op does not import the device-specific communicator module, and communicator_cuda imports the normalizer lazily. Verified: all import forms (plain/dotted/from) load cleanly with no cycle; the normalizer produces identical results for every string alias and QuantType member; the ValueError path is preserved. No functional change for callers: existing per_group/mxfp4 tests already call the unified function via quant_type=, and the removed per_group wrapper had no other callers. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
gbyu-amd
force-pushed
the
unify-fused-ar-rmsnorm-quant-api
branch
from
July 1, 2026 15:20
e88872d to
e0c8a12
Compare
1 task
valarLip
approved these changes
Jul 2, 2026
1 task
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.
Collapse tensor_model_parallel_fused_allreduce_rmsnorm_quant_per_group() into tensor_model_parallel_fused_allreduce_rmsnorm_quant(), dispatching on quant_type (and group_size for the block size) so users have a single entry point.
Per-group quant_type values are normalized via
_normalize_fused_ar_rms_quant_type (same alias table the device communicator uses) and routed to GroupCoordinator.fused_allreduce_rmsnorm_quant_per_group, which dispatches the torch.library-registered op so the fusion stays traceable under torch.compile. Other quant types keep the existing generic path.
No functional change for callers: existing per_group/mxfp4 tests already call the unified function via quant_type=, and the removed per_group wrapper had no other callers.
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist