Conversation
… NVFP4 checkpoint ModelOpt NVFP4 checkpoints of Qwen3.8-Flash-Next exclude the PLE n-gram table from NVFP4 and ship it as FP8 shards with one global scale. The FP8 embedding method was only selected for Fp8Config and ModelOptMixedPrecisionConfig, so under a plain ModelOptNvFp4Config the unquantized embedding was built and loading failed with no parameter for ngram_embedding.weight_scale. Select the FP8 method under ModelOptNvFp4Config when the PLE layer is excluded from NVFP4 and the config declares the table as FP8 via ple_embedding_dtype. Requiring both keeps checkpoints that store the table unquantized on the existing path. Fixes vllm-project#54765 Signed-off-by: Stefano Castagnetta <scastagnetta@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe PLE embedding selector now supports FP8 PLE tables in ModelOpt NVFP4 checkpoints. The constructor passes the checkpoint PLE dtype to the selector. Tests cover excluded and non-excluded tables with FP8 and BF16 configurations. ChangesNVFP4 PLE support
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This enables loading supported NVFP4 checkpoints with separately stored FP8 PLE tables while preserving existing behavior for BF16 and non-excluded PLE tables. The covered selection paths indicate the change is ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request has merge conflicts that must be resolved before it can be |
Purpose
Fixes #54765.
ModelOpt NVFP4 checkpoints of Qwen3.8-Flash-Next exclude
*.ple.*from NVFP4 and ship the 51.2B-parameter n-gram table separately as FP8 shards with one global scale. That is exactly the layoutQwen4ExpPLEFp8EmbeddingMethodimplements, but_get_ple_embedding_quant_methodonly selects it forFp8ConfigorModelOptMixedPrecisionConfig. Under a plainModelOptNvFp4Configthe unquantized embedding is built, noweight_scaleparameter is registered, and loading fails:#54882 fixed this for
quant_algo: MIXED_PRECISION. Checkpoints that declarequant_algo: NVFP4still fail, which is the layout of the most widely used NVFP4 build of this model.Fix
Select the FP8 embedding method under
ModelOptNvFp4Configwhen both hold:is_layer_excluded), andple_embedding_dtype.Requiring both means a checkpoint that excludes the PLE but keeps it in bf16 still takes the unquantized path.
ple_embedding_dtypeis the same signal #53899 uses for this.Validation
Unit level, plus checkpoint metadata inspection. I did not run a full serving load of a 135 GB checkpoint.
Run inside
vllm/vllm-openai:nightly-8a728663c1(0.28.1rc1.dev388+g8a728663c) on both an sm_121 and an sm_120 host, unpatched then patched. The new tests fail against the unpatched selector and pass with the fix; the five pre-existing PLE tests pass in both.Note on the red-before-green: the unpatched failures are
TypeErrorfrom the added parameter, not assertion failures.test_ple_fp8_embedding_loads_under_nvfp4_checkpointis the one that encodes the bug, since the unpatched selector returnsNonefor this checkpoint. The threeskipped_for_non_fp8cases assert behaviour the unpatched code also has, so they are regression guards rather than proof of the fix.Table dtypes read from the safetensors headers of published checkpoints:
ple_embedding_dtypeRadixArk/Qwen3.8-Flash-Next-NVFP4float8_e4m3fnweight_scaledealignai/Qwen3.8-Flash-Next-ABLITERATED-NVFP4float8_e4m3fnweight_scaleInferact/Qwen3.8-Flash-Next-NVFP4,nota-ai/Qwen3.8-Flash-Next-Nota-NVFP4Note on
ple_embedding_dtypeprimitive-ai/Qwen3.8-Flash-Next-NVFP4andprimitive-ai/Qwen3.8-Flash-Next-mixed-NVFP4-FP8declareple_embedding_dtype: float8_e4m3fnbut ship bf16 tables with noweight_scale. They load today and would fail at startup after this change, with the clear scale-sentinel error added in #54722. I think the config is wrong rather than the gate, but flagging it since it is a visible behaviour change for those two repos. Happy to key on something else if a maintainer prefers.Why this is not a duplicate
I ran the checks in AGENTS.md. No open PR references #54765. The same selector is touched by the PLE offload PRs (#53899, #54371, #54070, #54129), which are large unmerged features; this is the standalone load fix and does not conflict with the direction they take.
Model evaluation
Not applicable. Affected checkpoints currently fail to load, so there is no baseline to regress against. The change only decides which method reads an embedding table that the checkpoint already stores in FP8; unaffected checkpoints keep their existing path, which the second test pins.
AI assistance
AI assistance was used to author this change. I have reviewed every changed line, ran the tests and linters above myself, and can defend the design.