Integrate Miles fused NVFP4 fake-QAT QDQ - #91
Open
zianglih wants to merge 1 commit into
Open
Conversation
Signed-off-by: Ziang Li <ziangli@umich.edu>
zianglih
marked this pull request as ready for review
September 1, 2026 19:22
zianglih
marked this pull request as draft
September 1, 2026 20:28
zianglih
marked this pull request as ready for review
September 1, 2026 20:29
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.
What does this PR do?
@HumansAnd
Adds the minimal Megatron side of a paired Miles/Megatron split for fused NVFP4 fake-QAT QDQ.
TEGroupedLinear._get_weight_tensors()gate onOPEN_TRAINING_NVFP4_FAKE_QAT_FLAG=1, lazily import the Miles-owned adapter, and transformTE's existing discrete weight list before the current INT4-QAT hook.
forward/backward test, and benchmark live in the paired Miles PR. This PR adds no duplicate
kernel or unit-test files.
carries no pre-2.17 fallback or runtime support validator; recipe compatibility is configured by
the caller.
re-expresses it as a cleaner ownership split. This remains a follow-up to [WIP] Add NVFP4 fake QAT for grouped experts #75.
Paired Miles kernel/test PR:
radixark/miles#2864
Issue tracking
Linked issue: N/A (paired fork refactor of draft #88; related to #75)
Validation
65940a7197427997bbfd411b3944849f68c1aaf0c160f0717e40f052de740026cf62739340e7b970(miles-main)ca0c3425f2c5b5f8ec97fc4af6e8fd976d32f704ffa7dc4ac3741c1e4f2c896aa78273730c418fe4(the head differs only by restoring the pre-existing CI registration metadata)
radixark/miles:dev-202609010119(
sha256:3ee2af22223ee8f0d0b0bf19340fc06bf8da6ddb26a36c76136f8f5e5c462728on amd64/B300)2.13.0+cu130, CUDA13.0,Transformer Engine
2.17.0, Cutlass DSL4.6.2The Miles Blackwell file includes the real
TEGroupedLinearhook, three discrete weights,bit-exact TE QDQ comparison, forward, and identity-STE backward. The full run uses two visible GPUs
so the non-current-device restoration case executes rather than skips.
cd /hai-workspace/nvfp4-qdq-split/miles CUDA_VISIBLE_DEVICES=0,1 PYTHONWARNINGS=ignore \ PYTHONPATH=/hai-workspace/nvfp4-qdq-split/miles:/hai-workspace/nvfp4-qdq-split/Megatron-LM \ pytest -q -o addopts= tests/fast-gpu/test_nvfp4_quantizer.pyLocal Megatron checks:
tools/autoformat.shwas invoked but its fetch step cannot resolve the fork-onlymiles-mainbranch on its hardcoded NVIDIA remote. The equivalent isort, Black, pylint, and Ruff commands were
run individually against the changed file and produced the results above; this was an
infrastructure/setup failure rather than a formatter failure.
The paired eight-weight
[4096,6144]benchmark reports1.623xoverall geomean speedup versusnative TE quantize-dequantize (
1.635xBF16,1.611xFP16); complete raw timing is owned by theMiles PR.
Contribution process
Pre-checks
Code review
Feel free to message or comment @NVIDIA/mcore-oncall to help accelerate your merge into main. The less complex your PR is, the faster it will be approved and merged!
All PRs start as draft. If you open a non-draft PR, it will be automatically converted to draft.
Step 1: Mark PR as "Ready for Review"
Step 2: Final Review
For changes under
megatron/core, expert approvals lead to theFinal Reviewlabel and final review.Step 3: Approved
The
Approvedlabel is applied automatically after the required reviews.Merge
Any member of mcore-engineers can merge the PR.