Skip to content

[Qwen4Exp] Clean up HC and PLE implementations for Qwen3.8-Flash-Next - #61454

Merged
gau-nernst merged 18 commits into
vllm-project:mainfrom
peakcrosser7:qwen4/cleanup_ple_hc
Oct 18, 2026
Merged

gau-nernst merged 18 commits into
vllm-project:mainfrom
peakcrosser7:qwen4/cleanup_ple_hc

Conversation

@peakcrosser7

@peakcrosser7 peakcrosser7 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Clean up Qwen4Exp HC/PLE implementations and refine PLE quantization selection, with regression coverage for the affected paths.

Claims

  • Remove redundant custom-op registrations, dispatcher wrappers, and fake implementations for NVIDIA HC operations and the shared PLE gate. Call the existing Triton kernel launch functions directly.
  • Move checkpoint shard overlap and copy helpers into PLEVocabParallelEmbedding, using the embedding's own TP shard metadata.
  • Rename HC lora_rank to hc_lowrank and local lora variables to lowrank on NVIDIA and AMD. Use clearer names for token counts and tensor dimensions in HC and PLE launch functions.
  • Reuse round_up for PLE vocabulary padding, QSA RoPE-position alignment, QSA ring capacity, and prefill logits alignment.
  • Refine PLE quantization selection: honor ModelOpt layer exclusions, retain serialized FP8 support, warn and fall back to unquantized PLE for unsupported global configurations, and reject unsupported explicit ModelOpt per-layer algorithms, embedding dtype overrides, and nonserialized Fp8Config usage.

Validation

Correctness tests:

pytest tests/models/qwen4_exp/test_ple.py tests/models/qwen4_exp/test_hc_ops.py -q

Result: 123 passed, 2 skipped. The skipped cases require ROCm. Coverage includes HC and PLE kernel correctness, checkpoint shard loading, FP8 handling, pinned-host lookup and prefetch, and quantization selection.

Static checks: Ruff lint and formatting checks passed for all 12 changed files. git diff --check also passed.

Serving smoke validation: Qwen3.8-Flash-Next started and served HTTP 200 requests with BF16, TP2/DP1, CPU-offloaded PLE, and MTP with 3 speculative tokens. The run recorded nonzero MTP acceptance.

CI coverage: Existing CPU CI covers PLE quantization selection and shard-loading tests. The H200 job covers HC operations and PLE convolution correctness.

End-to-end model accuracy evaluations and before/after performance benchmarks were not run. ROCm hardware execution and quantized-checkpoint serving validation remain pending.

Details

The unquantized PLE fallback assumes the checkpoint contains an unquantized embedding table. NVFP4 PLE decoding and format conversion remain outside this change.


Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).

  • AI assistance was used during the creation of this PR.

  • Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.

  • Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.

  • Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.

  • Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.

Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mergify mergify Bot added the qwen Related to Qwen models label Oct 13, 2026
@mergify

mergify Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @peakcrosser7.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Oct 14, 2026
Comment thread vllm/models/qwen4_exp/nvidia/ops/hc.py Resolved
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
@mergify mergify Bot removed the needs-rebase label Oct 14, 2026
This reverts commit f07f267.

Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
This reverts commit 5fb0b3d.

Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
@mergify

mergify Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @peakcrosser7.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Oct 16, 2026
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
@mergify mergify Bot removed the needs-rebase label Oct 17, 2026
Comment thread vllm/models/qwen4_exp/common/ops/ple.py Resolved
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
@gau-nernst

Copy link
Copy Markdown
Contributor

@peakcrosser7 Can you help fix DCO? I will run CI afterwards. Thanks!

@peakcrosser7

Copy link
Copy Markdown
Contributor Author

@peakcrosser7 Can you help fix DCO? I will run CI afterwards. Thanks!

OK, I noticed the two revert commits didn't include a sign-off. I'll fix them.

@peakcrosser7

Copy link
Copy Markdown
Contributor Author

@peakcrosser7 Can you help fix DCO? I will run CI afterwards. Thanks!

OK, I noticed the two revert commits didn't include a sign-off. I'll fix them.

DCO fixed.

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #95667 for commit 661e235c35b1.

@gau-nernst
gau-nernst merged commit 4946639 into vllm-project:main Oct 18, 2026
70 checks passed
@gau-nernst
gau-nernst deleted the qwen4/cleanup_ple_hc branch October 18, 2026 11:38
kimseunghyun-kr pushed a commit to kimseunghyun-kr/vllm that referenced this pull request Oct 18, 2026
Resolve the conflict in vllm/models/qwen4_exp/nvidia/ops/qsa_indexer.py:
keep this branch's per-shard logits width for the sharded selector and use
main's round_up (vllm-project#61454).

Signed-off-by: kimseunghyun <hellonypcteam@gmail.com>
harjothkhara added a commit to harjothkhara/vllm that referenced this pull request Oct 18, 2026
Resolve conflict in vllm/models/qwen4_exp/common/ngram_embedding.py:
keep main's reworked Qwen4ExpPLEEmbeddingMethod.from_quant_config
(vllm-project#61454, vllm-project#56273) and keep this PR's strip_model_root_prefix() call
ahead of every prefix-based quant lookup, including the new NVFP4 path.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: harjoth <harjoth.khara@gmail.com>
michael-gpu pushed a commit to practical-inference/vllm-ampere-extended that referenced this pull request Oct 20, 2026
…vllm-project#61454)

Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Co-authored-by: Thien Tran <gau.nernst@yahoo.com.sg>
mjkvaak-amd added a commit to mjkvaak-amd/vllm-project that referenced this pull request Oct 22, 2026
…spatch

vllm-project#61454 renamed GatedResidual.lora_rank to hc_lowrank; the two-stage
combine_and_mix dispatch still read the old attribute and failed at the
first compiled forward on bases with vllm-project#61454.

Signed-off-by: Mikko Tukiainen <Mikko.Tukiainen@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
mjkvaak-amd added a commit to mjkvaak-amd/vllm-project that referenced this pull request Oct 22, 2026
…spatch

vllm-project#61454 renamed GatedResidual.lora_rank to hc_lowrank; the two-stage
combine_and_mix dispatch still read the old attribute and failed at the
first compiled forward on bases with vllm-project#61454.

Signed-off-by: Mikko Tukiainen <Mikko.Tukiainen@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qwen Related to Qwen models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants