Repository navigation
qwen4_exp: release the nvidia pack's MTP expert FP8 sources after requant (~2.5 GB) - #78
Merged
Merged
Conversation
…r requant quantized_from_fp8 keeps its FP8 source whenever the GDN native-FP8 prefill (default on) or the dense FP8 attention overlay is enabled, because those read dense linear_attn / self_attn tensors as FP8. The nvidia Flash-Next pack routes its 512 MTP experts through the same function, and nothing ever reads a routed MoE expert as FP8 — so ~2.5 GB of FP8 source stayed resident for no consumer. With MTP on, pre-KV reached 104.6 GB and the serve refused util 0.88 (job 244). Reclaim each expert's weight and weight_scale_inv right after its NVFP4 copy is built. Co-Authored-By: Claude Opus 5.5 <[email protected]>
AzeezIsh
added a commit
that referenced
this pull request
Sep 25, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
Validated (reiner job 256): Flash-Next nvidia NVFP4 with
Marking ready for review. |
AzeezIsh
marked this pull request as ready for review
September 25, 2026 17:25
This was referenced Sep 25, 2026
Contributor
Author
|
Merged as part of the GB10 merge train (main Gates on the combined tree:
Tree check: |
This was referenced Sep 26, 2026
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.
On the nvidia Flash-Next pack the 512 MTP experts are per-expert FP8 block-scaled; the loader dequants each to BF16 and requants to NVFP4 through
quantized_from_fp8. That helper frees its FP8 source only when BOTH global FP8 readers are off (GDN native-FP8 prefill — on by default — and the dense FP8 attention overlay), because those read dense linear_attn / self_attn tensors as FP8. No reader ever consumes a routed MoE expert as FP8, so for the MTP experts the source is dead weight: ~4.9 MB per expert, ~2.5 GB over 512 (estimate).Evidence it matters: job 244 (GB10, main66) — with
--speculativethe nvidia pack reaches 104.6 GB pre-KV and refuses--gpu-memory-utilization 0.88("No memory left for KV cache"), so MTP currently needs util ≥ 0.93, which leaves little host headroom on a unified-memory box.Change: after each MTP expert's three NVFP4 copies are built, reclaim its
weightandweight_scale_inv(WeightStore::reclaimis idempotent and a no-op for tensors that are not resident). Weights used at inference are unchanged, so output must be identical.Validation (queued on reiner)
--speculative: main66 vs this branch (expect ~−2.5 GB)Workstream: job #70.
🤖 Generated with Claude Code