[Pytorch][Do not merge] Let MXFP8 dispatch return plain torch tensor - #3355
[Pytorch][Do not merge] Let MXFP8 dispatch return plain torch tensor#3355YangFei1990 wants to merge 2 commits into
Conversation
Signed-off-by: YangFei1990 <feiw@nvidia.com>
Greptile SummaryThe PR changes MXFP8 expert-parallel dispatch and combine-backward outputs from grouped quantized tensors to opaque plain PyTorch tensor carriers.
Confidence Score: 4/5The PR does not appear safe to merge because fused grouped-MLP carrier reconstruction remains disabled by attributes that are never assigned. MXFP8 dispatch and combine backward now return packed plain tensors, while the fused grouped-MLP reconstruction branches still default their unassigned carrier flags to false; the packed E4M3 data and scales can therefore enter computation as ordinary BF16 values. Files Needing Attention: transformer_engine/pytorch/ops/fused/grouped_mlp.py, transformer_engine/pytorch/ep.py Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[BF16 tokens] --> B[MXFP8 quantization]
B --> C[EP dispatch]
C --> D[Plain tensor carrier<br/>E4M3 data + E8M0 scales]
D --> E[mxfp8_carrier_to_grouped]
E --> F[Grouped MXFP8 tensor]
F --> G[Fused grouped MLP]
Reviews (2): Last reviewed commit: "Merge branch 'main' into mxfp8_dispatch_..." | Re-trigger Greptile |
|
|
||
| def _make_grouped_mxfp8(data, scale_inv, token_counts, fp8_dtype, fake_dtype): | ||
| """Wrap expert-major MXFP8 recv data + compact e8m0 scales as a per-expert ``GroupedTensor``. | ||
| def mxfp8_carrier_to_grouped(carrier: torch.Tensor, token_counts: torch.Tensor): |
There was a problem hiding this comment.
Carrier helper omitted from exports
The ep_dispatch documentation directs callers to mxfp8_carrier_to_grouped, but the helper is absent from the module's __all__ list. Wildcard imports therefore omit the function required to consume the new opaque representation, forcing callers to rely on an undeclared implementation detail.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Description
This PR allows TE's EP dispatch API return plain torch tensor when doing MXFP8 dispatch. Previously it will return a grouped tensor
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: