[Common][PyTorch] EP dispatch with unfused MXFP8 quantization - #3270
Open
phu0ngng wants to merge 2 commits into
Open
[Common][PyTorch] EP dispatch with unfused MXFP8 quantization#3270phu0ngng wants to merge 2 commits into
phu0ngng wants to merge 2 commits into
Conversation
Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
Contributor
Greptile SummaryAdds unfused MXFP8 quantization to NCCL expert-parallel dispatch and combine backward.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
BF16["BF16 tokens"] --> Quant["MXFP8 quantization"]
Quant --> Data["E4M3 data"]
Quant --> Scales["E8M0 scales"]
Data --> Dispatch["NCCL EP dispatch"]
Scales --> Dispatch
Dispatch --> Grouped["Per-expert GroupedTensor"]
Grad["Combine result gradient"] --> BwdQuant["MXFP8 quantization"]
BwdQuant --> Reverse["Reverse dispatch"]
Reverse --> ExpertGrad["Per-expert grouped gradient"]
Reviews (2): Last reviewed commit: "restore gitignore" | Re-trigger Greptile |
phu0ngng
commented
Jul 28, 2026
| alignment: int = 0, | ||
| payload_dtype: torch.dtype = torch.bfloat16, | ||
| device: Optional[torch.device] = None, | ||
| dispatch_quant_recipe: Optional["Recipe"] = None, |
Collaborator
Author
There was a problem hiding this comment.
Let me separate the recipe for dispatch fwd and combine bwd, in case users want to use different quantization for fwd and bwd in the future.
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.
Description
This PR adds MXFP8 support to the dispatch op of the NCCL EP path. The dispatch op is used in two places, and MXFP8 applies to both:
GroupedTensor.GroupedTensor.Type of change
Changes
PyTorch frontend (
transformer_engine/pytorch/ep.py,distributed.py,csrc/extensions/ep.cpp)**dispatch_quant_recipeis set (MXFP8BlockScalingonly for now); dispatch-forward recv is returned as a per-expertGroupedTensor. A pre-quantized input is rejected.GroupedTensor. Combine forward is unchanged (high-precision).Common backend (
common/ep/ep_backend.cpp,include/.../ep.h,comm_window.h)**NCCL EP submodule**
3rdparty/nccl-extensionsto the revision providing block-scaled dispatch.Tests (
tests/cpp_distributed/test_ep.cu,tests/pytorch/distributed/run_ep.py,run_test_ep.sh)**NVTE_EP_MXFP8_PASSrun since the grouped path pins the per-expert alignment process-wide.Checklist: