[Qwen4] validate FP8 PLE weight scale after loading - #54722
Conversation
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
|
Looks right to me, thanks for turning it around quickly. Storing the scale as FP32 puts it on the path where One forward-looking note for the #53899 rebase: under |
|
/ci run |
|
✅ Triggered Buildkite CI #86761 for commit |
Reconcile the PLE mmap series with the fused PLE kernels merged by vllm-project#54517 and the FP8 scale validation from vllm-project#54722. Keep upstream's new ops.ple dispatch (ple_ngram_ids, ple_gate, ple_conv) and its removal of the NVIDIA positions_buffer/padded_buffer registrations and the max_total_tokens/max_num_reqs constructor parameters, then layer the mmap delta onto those seams. Resolves four hunks in ple_layer.py and model.py: union of the ple_mmap and ops.ple imports, the mmap embedding branch without the deleted buffers, the mmap short-circuit in forward without the duplicated ngram_ids allocation upstream removed, and the _HC_WEIGHTS_MAPPER to _EXTRA_WEIGHTS_MAPPER rename around the retained reload preflight. Adapt test_ple_mmap.py to the new Qwen4ExpNGramEmbedding signature. The CPU-driven equivalence test now copies compute_ngram_ids' result into the op's output buffer itself: the fused CUDA kernel writes in place, but the eager fallback returns a fresh tensor and leaves output untouched. Signed-off-by: Christopher Deodat <61226342+Trosfy@users.noreply.github.com> Assisted-by: Claude Code (AI assistant)
The bulk of the migration (nvidia +798, amd +201). Brings in the FP8 PLE path, per-shard weight_scale handling and validation, and the short-conv corrections from peakcrosser7/vllm release/qwen38next_offload. Our _short_conv_fallback survives unchanged, comment included, and gains a second guard: their version also falls back when the per-layer metadata is missing, not only when attn_metadata itself is None. That path is profiling and cudagraph capture, not an sm_80 gate -- worth stating because the word fallback made it look like one. This file also carries the change merged upstream as vllm-project/vllm vllm-project#54722, [Qwen4] validate FP8 PLE weight scale after loading, merged 2026-09-02 by the same author. Taking their branch subsumes it. After this the whole qwen4_exp tree matches theirs except two deliberate divergences: the PP=1 RuntimeError we reject (see 0f3ce9d) and a docstring re-indentation of theirs that is a typo.
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
The bulk of the migration (nvidia +798, amd +201). Brings in the FP8 PLE path, per-shard weight_scale handling and validation, and the short-conv corrections from peakcrosser7/vllm release/qwen38next_offload. Our _short_conv_fallback survives unchanged, comment included, and gains a second guard: their version also falls back when the per-layer metadata is missing, not only when attn_metadata itself is None. That path is profiling and cudagraph capture, not an sm_80 gate -- worth stating because the word fallback made it look like one. This file also carries the change merged upstream as vllm-project/vllm vllm-project#54722, [Qwen4] validate FP8 PLE weight scale after loading, merged 2026-09-02 by the same author. Taking their branch subsumes it. After this the whole qwen4_exp tree matches theirs except two deliberate divergences: the PP=1 RuntimeError we reject (see 1e0d517) and a docstring re-indentation of theirs that is a typo.
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Purpose
Fix a fail-open risk in the Qwen3.8 Flash Next FP8 PLE weight loading path.
If
ngram_embedding.weight_scaleis missing or incorrectly mapped, the registered parameter could remain uninitialized without being detected. This PR:process_weights_after_loading()after all checkpoint shards have been processed.Thanks to @Dev-Jahn for identifying and reporting this issue.
Not a duplicate
Searched the open PRs for Qwen3.8 PLE weight_scale and FP8 PLE scale. I did not find an open PR addressing this missing post-load validation.
Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.