Repository navigation
Conversation
Project master weights onto the MXFP4 grid before existing MXFP8 or block-scaled FP8 compute, preserving high-precision optimizer parameters and the host recipe's backward policy. Adapt module/FSDP2 and ops fusion paths to miles-main without the absent upstream GTP protocol. Invalidate cached weight workspaces when a mutable MXFP8 recipe changes its QAT flag. Keep a single recipe signature for fusion state, and cover in-place cache transitions plus the existing ops block-scaling rejection. Adapted from NVIDIA#3264 at 3a472d9. Co-authored-by: zhihaow6 <zhihaow6@illinois.edu> Signed-off-by: Jiajun Li <guapisolo@gmail.com>
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.
Summary
Add MXFP4 weight QAT using the existing MXFP8 and block-scaled FP8 compute paths.
Motivation
Training on unprojected weights does not expose the optimizer to MXFP4 weight rounding. This brings MXFP4 weight projection to
miles-mainwhile retaining high-precision master parameters and the host recipe's activation and gradient handling.Usage
Use BF16/FP32 master weights. Modules also support
MXFP4QATFloat8BlockScaling; the operations API retains its MXFP8-only QAT support boundary.Design Notes
high_precisionbackward intentionally uses the unprojected master; FSDP2 replay reconstructs the projected operand for other modes.Adapted from NVIDIA/TransformerEngine#3264 by @xiuhu17 at
3a472d9b, includingmxfp4_fake_quantize, recipes, FSDP2 replay and tests. GTP integration is omitted because this fork has noDistributedWeightprotocol. The commit retains the original author'sCo-authored-bycredit.Verification
F,E9, production Pylint 3.3.1 passed.Upstream's reported GPU passes do not validate this port.
Review Focus