[SM70] FP8-resident MTP experts for AWQ and NVFP4 targets - #13
Merged
Merged
Conversation
Quantize unquantized draft expert shards with per-row scales and reuse the existing SM70 FP8 weight-only MoE path. Preserve the target, shared heads, and standard rejection sampler. GPU and sampling acceptance remain pending. Assisted-by: Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
V100 probes show unpadded W2 K=160 is numerically invalid. Pad gate/up halves and down input consistently to 256; preserve zero contributions and reuse supported native dimensions. Assisted-by: Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
Four GPU cases passed against explicit routed-expert reconstruction at M=1,2,8,64. Assisted-by: Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
Reject unsupported draft architectures and synthetic acceptance for the opt-in FP8 expert feature. Validate hidden-dimension alignment before weight allocation. Assisted-by: Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
Document supported configuration, padding, full-model memory and output checks, and the limits of the quality evidence. Assisted-by: Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
Backport ModelOpt block-FP8 dispatch and MTP metadata remapping from vllm-project/vllm#55513 (60ad959b6f1a5c8f602edbd608c8decbc0788c50). Add scale-preserving TP padding and native FP8 allocation for independent AWQ/NVFP4 targets. Keep full-model expanded validation explicitly in progress. Assisted-by: Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
ModelOpt mixed checkpoints leave missing quantized_layers entries unquantized even without an explicit exclusion. Allow the online MTP-only FP8 option for that case while rejecting unsupported quantized formats. Assisted-by: Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
Record checkpoint-native paired memory and complete-response checks for both target formats, plus NVFP4 online conversion. Distinguish same-source controls from different-draft integration checks. Assisted-by: Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
Include the online expert quantization option in the compilation hash and validate CUDA SM70 before dispatch can select an implementation that ignores the option. Validation: 52 CPU tests passed; pre-commit passed for both changed files. Assisted-by: Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
Hash the unset MTP expert option as well, so neither FP16 nor FP8 can reuse an old artifact whose key omitted the expert implementation. Unrelated speculative methods keep their existing hash. Validation: 52 CPU tests passed; pre-commit passed. Assisted-by: Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.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.
Problem and implementation
Qwen4Exp MTP experts can consume substantial memory even when the target is AWQ or NVFP4. Keep the draft experts resident in FP8 while preserving the target model and standard rejection verification. Reduced proposal acceptance is allowed; the unchanged target distribution must be preserved.
Support both input routes:
"mtp_expert_quantization": "fp8".modelfield for a separate draft checkpoint; ModelOpt mixed checkpoints and regular block-FP8 metadata are recognized.This backports vllm-project/vllm#55513, merged as
60ad959b6f1a5c8f602edbd608c8decbc0788c50: ModelOptFP8_PB_WO/FP8_BLOCK_SCALESdispatch and AMD/NVIDIA MTP layer-metadata remapping. The new work is SM70 resident execution, TP padding that preserves original FP8 bytes and block-scale offsets, and the independent online expert option. It does not depend on 1CatAI#553, whose SM70 fallback retains FP16 expert weights. vllm-project/vllm#55498 overlaps the already-merged generic loading fix.On the tested TP4 shape, logical width 160 needs physical width 256. Native checkpoint loading preserves offsets 0/32/64/96 inside original scale blocks, without dequantizing and requantizing. The SM70 kernel uses FP16 scales; overflowing/underflowing scales are rejected. Online conversion is restricted to unquantized draft experts. SM70/FP16, Qwen4ExpMTP, ordinary TP without PP/EP, and standard rejection sampling are required.
Validation
Both loading routes completed full-model tests with AWQ and NVFP4 targets. This remains a fork draft for human review.
.venv/bin/python -m pytest tests/models/qwen4_exp/test_mtp_fp8_experts.py tests/models/qwen4_exp/test_mtp_fp8_checkpoint.py -q: 48 passed. Includes both ModelOpt aliases, exclusions, metadata remapping, TP1/2/4/8 byte/scale preservation, incomplete checkpoints, the real allocator/TP loader with AWQ/NVFP4/mixed configuration names, and online conversion of unquantized experts omitted from mixed metadata..venv/bin/python -m pytest tests/models/qwen4_exp/test_mtp_fp8_experts_gpu.py -q: 20 passed, covering online and checkpoint-native methods, four TP4 offsets, M=1/2/8/64, reference reconstruction and exact CUDA Graph replay.All paired full-model arms use TP4/MTP3/C2, FP16 execution/KV, CUDA Graphs and fixed 5-GiB KV/rank. Memory values are idle snapshots after both greedy and stochastic campaigns, identical across all four ranks. Whole-GPU reductions include runtime overhead and must not be attributed entirely to the 225-MiB expert-payload reduction. Actual test prompts reach approximately 7700 tokens; configured 262144 context is not a full-context validation.
The native runtime uses extensions built from
752f86495f, with changed Python modules overlaid from this branch based onfe67339ddf; it is not a clean native rebuild. The first checkpoint-native AWQ run preceded two additional input guards; the 20 GPU tests and NVFP4 runs include them. Main target weights, shared-head handling and rejection sampling are not modified. Tests are bounded correctness/integration evidence, not a universal bitwise or benchmark-quality guarantee. Standard rejection sampling preserves the unchanged target distribution using actual proposal probabilities. No throughput or loading-peak improvement is claimed.See design and validation details. This remains a fork draft for human review; no production deployment or upstream submission is included.
AI assistance: Codex assisted with implementation, tests and documentation under the submitter's direction.