[WIP] Add experimental NVFP4 fake-QAT RL recipe - #2020
Draft
zianglih wants to merge 2 commits into
Draft
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
6 tasks
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.
Warning
Experimental / WIP. This is the initial NVFP4 fake-QAT RL wiring and has not yet been validated on a GPU devbox.
Summary
Adds an explicit
--train-nvfp4-qatmode to the Qwen3 30B-A3B reference recipe, mirroring the existing INT4 QAT split between BF16 training weights and quantized rollout weights.--rollout-nvfp4.--train-nvfp4and the other training precision modes.OPEN_TRAINING_NVFP4_FAKE_QAT_FLAG=1for the companion Megatron implementation.Scope and limitations
Fake quantization is limited to routed MoE expert TE grouped FC1/FC2 weights. Dense MLPs, shared experts, sequential or legacy experts, activations, optimizer state, parameter gather, and the native TE FP4-GEMM training path are unchanged.
The recipe keeps BF16 master weights and GEMMs while the companion Megatron change applies TE NVFP4 quantize/dequantize during each forward with straight-through gradients.
Miles continues forwarding the driver's
NVTE_*andFLASHINFER_*variables so conversion, QAT, and rollout can use consistent 4over6 scope, E4M3 bounds, error mode, and fast-math settings. The quantized checkpoint does not encode those choices, so the same environment must be restored when resuming.The current Qwen recipe uses expert tensor parallel size 1. Generic expert-TP parity is not claimed yet: with expert TP greater than 1, the fake-QAT local-shard amax can differ from full-weight rollout conversion.
Dependencies
The dependency CI marker is intentionally deferred until the GPU validation phase.
Validation
Passed static checks:
pre-commit run --files scripts/run_qwen3_30b_a3b.pygit diff origin/main...HEAD --checkPer request, no unit or functional tests, benchmarks, accuracy runs, or GPU/devbox validation were performed before opening this draft.