Skip to content

[DCP] Default query replication for GLM sparse attention - #50382

Merged
LucasWilkinson merged 4 commits into
vllm-project:mainfrom
LucasWilkinson:codex/qrep-cli-glm-default
Aug 21, 2026
Merged

LucasWilkinson merged 4 commits into
vllm-project:mainfrom
LucasWilkinson:codex/qrep-cli-glm-default

Conversation

@LucasWilkinson

@LucasWilkinson LucasWilkinson commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add --dcp-q-replicate and --no-dcp-q-replicate as explicit CLI options;
  • preserve VLLM_DCP_Q_REPLICATE as the highest-precedence override;
  • enable query replication automatically for glm_moe_dsa models when decode DCP is enabled and PCP is not enabled;
  • keep query replication opt-in for other MLA model families.

The automatic default removes GLM's decode query all-gather at the cost of replicating the query projection weights across DCP ranks. Explicit CLI or environment selections still override the model default.

Performance and memory

GLM-5.2-NVFP4, TP=4, DCP=4, 32K input tokens, 128 output tokens, batch 8, two warmups, five measured iterations:

  • QREP off: 20.1777 s
  • QREP on: 19.7426 s
  • delta: -0.4351 s (-2.16%)

With QREP enabled, a fresh DCP backend comparison measured:

DCP backend Average latency
ag_rs 19.7636 s
a2a 18.0213 s

For the matched 32K benchmark configuration, model-loading memory increased from 110.37 GiB/rank to 114.94 GiB/rank with QREP, approximately +4.57 GiB/rank.

Model evaluation

GLM-5.2-NVFP4, TP=4, DCP=4, GSM8K 5-shot, 300 questions:

  • automatic GLM QREP default: 94.0% accuracy, 0% invalid outputs;
  • explicit QREP off: 95.0% accuracy, 0% invalid outputs.

The QREP-off evaluation used max_num_seqs=32 because FlashInfer's sparse-MLA workspace overflowed when all prompts were scheduled concurrently. Both runs evaluated the same 300 questions with the same decoding settings. The one-point difference is not significant at this sample size.

AI assistance

AI assistance was used for implementation, tests, benchmarking, profiling analysis, and drafting this description. The human submitter has reviewed.

@mergify mergify Bot added the deepseek Related to DeepSeek models label Jul 30, 2026
@LucasWilkinson
LucasWilkinson marked this pull request as ready for review July 30, 2026 23:41

@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.

@LucasWilkinson LucasWilkinson changed the title [DCP] Expose query replication for GLM sparse attention [DCP] Default query replication for GLM sparse attention Jul 31, 2026
@robertgshaw2-redhat

Copy link
Copy Markdown
Collaborator

nice find!

@LucasWilkinson

Copy link
Copy Markdown
Collaborator Author

/run ci

@LucasWilkinson LucasWilkinson added the ready ONLY add when PR is ready to merge/full CI is needed label Jul 31, 2026
@LucasWilkinson

Copy link
Copy Markdown
Collaborator Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #84623 for commit 0b7f5309d377.

@mergify

mergify Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Hi @LucasWilkinson, the pre-commit checks have failed. Please run:

uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

@mergify mergify Bot added the glm label Aug 19, 2026
@mergify

mergify Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Hi @LucasWilkinson, the pre-commit checks have failed. Please run:

uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

LucasWilkinson and others added 4 commits August 21, 2026 03:09
Add an explicit DCP query-replication CLI/config option while preserving the existing environment override. Resolve the automatic default only for GLM sparse-attention models with decode DCP enabled, and keep other MLA architectures opt-in.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Every consumer of dcp_comm_backend already gates on
decode_context_parallel_size > 1, so selecting "a2a" without DCP
selects no different code path. Rejecting the combination only got in
the way once models started supplying a2a as their default.

Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
@LucasWilkinson
LucasWilkinson force-pushed the codex/qrep-cli-glm-default branch from 0b7f530 to 1b33f97 Compare August 21, 2026 03:10
@LucasWilkinson

Copy link
Copy Markdown
Collaborator Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #84947 for commit 1b33f97a2dab.

@LucasWilkinson
LucasWilkinson enabled auto-merge (squash) August 21, 2026 03:13
@LucasWilkinson
LucasWilkinson merged commit 72aedcc into vllm-project:main Aug 21, 2026
115 of 116 checks passed
am-cohere pushed a commit to am-cohere/vllm that referenced this pull request Sep 1, 2026
…t#50382)

Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepseek Related to DeepSeek models glm ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants