Repository navigation
Conversation
Reuse the ordinary FP8+SR worktree implementation at 23cec6d: immutable step seeds, canonical tensor salts, global counters, shared E4M3 rounding, and grouped backward workspace lifetimes. Keep QAT serving scales and BF16 backward. Include its plain SGD support and portable two-node validation overlays. Validated on H200: 101 GPU tests, three distributed cases on each of two ranks, 245 config tests, and 30 MoE regressions. Protected optimization and reduction dtypes are unchanged.
nxphi47
marked this pull request as ready for review
October 13, 2026 18:16
This branch has not been deployed
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 and decisions
Adds opt-in FP8 forward / BF16 backward QAT for dense/grouped projections and routed experts, plus independent DeepSeek V4 FP8 KV simulation. Dense QAT, expert QAT, and SR are configured independently; protected FP32 optimization/reduction defaults are unchanged.
Stacked on #4067, with base
feat/fp8-stochastic-rounding. That PR owns the shared SR state, parameter identities, Philox helper, global expert coordinates, and SGD support. QAT reuses them for consistent masks across FSDP/CP replicas, EP shards, tied weights, accumulation microsteps, forward/backward, and checkpoint replay. Merge #4067 first, then rebase/retarget this PR to main.This selectively adapts grouped-projection and KV ideas from #3627 rather than adopting its backward/RNG behavior. QAT computes
dX = dY @ decoded(W_fp8)using the exact forward weight decisions, anddW = dY.T @ X_bf16; GEMMs are BF16. KV fake quantization uses identity STE. QAT preserves grouped output projections and fuses inverse RoPE with FP8 activation casting.Use ordinary FP8+SR when SR is the only requested change. QAT is for the requested backward precision and audited vLLM forward conventions. The short validation does not establish a quality advantage.
Committed report documents decisions, the exact SR contract, portable configs, full results, failed attempts, and limitations. Machine-readable results retain every step's loss, gradient norm, timing, and W&B link.
BIG NOTICE — TRAINER / vLLM QUANTIZATION CONVENTIONS DIFFER
The audited serving target is vLLM 0.31.0. QAT follows its numerical conventions, with an explicit SR extension using #4067's shared contract.
1e-4; vLLM floors amax at1e-4before/448. QAT follows vLLM's rule and operation order.-0(0x80) separately from+0(0x00), including tiny negative values rounding to zero. Checks compare payload bytes and decoded BF16 bits.2^-33versus2^-42minimum UE8M0 scales).Results
All three full 43-layer DeepSeek V4 Flash Base runs completed five real-data SFT steps on two nodes / 16 H200s. Slurm 4082 completed with exit 0. All 15 losses and gradient norms were finite; all NaN-loss counts were zero.
Common settings: pinned base checkpoint/data, EP16, sequence 512, SGD
lr=1e-5, optimizer-state-only offload, FP32 optimization/reduction, compilation, activation checkpointing/offloading, FP8 KV simulation, and reduced NCCL buffers. These are SGD validation runs, not AdamW comparisons.CP1 last-two-step medians were 10.531 s RN / 11.239 s SR (+6.7%) on the same nodes. Only two samples, warmup, sequential execution, and allocator retries make this preliminary. CP2 uses a different batch and had a final-step timing outlier. Recovered allocation failures show that capacity is tight; PyTorch reserved memory excludes external allocations such as NCCL.
Operator forward/backward measurements (dense / grouped, milliseconds): BF16 0.279 / 0.596, ordinary FP8 RN 0.813 / 2.832, ordinary FP8 SR 0.940 / 4.851, QAT RN 0.558 / 1.455, QAT SR 0.652 / 4.183. Exact shapes/methodology are in the report. These are short microbenchmarks, not a general speed or quality claim.
Validation completed
f1eee78b725b3dafc2281144b8169be780806c64. The subsequent parent-history merge and report commit preserve runtime sources, packages, tests, dependencies, and lockfiles byte-for-byte; this was verified before publishing. Report links and copied result data were also checked.Remaining work