Skip to content

[Model][GLM-5.3-Flash] Warm up the DCP top-k merge kernels for the kpool indexer - #60032

Merged
NickLucche merged 4 commits into
vllm-project:mainfrom
NickLucche:glm-flash-kpool-dcp-merge-warmup
Oct 8, 2026
Merged

NickLucche merged 4 commits into
vllm-project:mainfrom
NickLucche:glm-flash-kpool-dcp-merge-warmup

Conversation

@NickLucche

@NickLucche NickLucche commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Purpose

Follow-up to #59211 (now merged; this branch is rebased on main).

Under DCP, the GLM-5.x kpool indexer merges the per-rank top-k with _merge_dcp_topk_global, which runs PackDCPTopkCandidatesKernel and StableTopKFromGatheredCandidatesKernel. Only SparseAttnIndexer.__init__ registers these kernels for JIT warmup, so with the kpool indexer they were compiled on the first long-context request:

WARNING [jit_monitor.py:140] Triton kernel JIT compilation during inference: PackDCPTopkCandidatesKernel.kernel. This causes a latency spike; consider extending warmup to cover this shape/config.

This PR registers them from SparseAttnIndexerKpool.__init__ under the same conditions: DCP > 1, JIT warmup enabled, CUDA, and CuteDSL available. #59211 already makes the warmup keys use pool-level top-k and interleave for kpool models.

Test Plan

zai-org/GLM-5.3-Flash on 8×H100 with vllm serve, bf16 KV cache, no MTP. TP8 + DCP8 with --cp-kv-cache-interleave-size 4, compared with TP8. GSM8K (1319 questions) at 5, 25, 50 and 100 shots, i.e. prompts from about 650 to about 17k tokens. Checked the server log for JIT monitor warnings.

Test Result

PackDCPTopkCandidatesKernel no longer compiles during inference under DCP8. Without this change, it compiled during inference in the same setup. The other JIT warnings in the log (fused_moe_kernel, kpool compress kernels) also appear without DCP and are unrelated.

Shots TP8 TP8 + DCP8
5 0.918 0.920
25 0.914 0.917
50 0.911 0.911
100 0.917 0.921

The E2E runs used the same local SM90 FlashMLA bf16 DCP change as #59211, which Hopper needs for DCP at head_dim 512.

Duplicate check

I searched open PRs for kpool / SparseAttnIndexerKpool / PackDCPTopkCandidates warmup and found none. #54345 deals with prefill metadata JIT, not the DCP top-k merge kernels.

AI assistance

This PR was written with AI assistance (Claude). I reviewed the change and ran the tests above.

🤖 Generated with Claude Code

@mergify mergify Bot added deepseek Related to DeepSeek models glm kv-cache-manager labels Oct 5, 2026
@vllm-agent

vllm-agent commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

CI selector (shadow): 5 test steps (25 jobs) instead of 34 (47 jobs)

Shadow mode: this changes nothing about what CI runs. It shows what the evidence-based selector would pick for this PR, next to today's rules. How it works.

Feedback welcome: reply here if it would skip a step this change needs, or runs something unrelated.

steps (jobs) Today's rules Selector Would skip Would add
NVIDIA, CPU and others 34 (47) 5 (25) 32 (43) 3 (21)
AMD mirrors 32 (40) 0 (0) 32 (40) 0 (0)
Selector would run (5)
  • arm-cpu-test ×3
  • basic-models-tests-extra-initialization ×14
  • cpu-language-generation-and-pooling-model-tests ×3
  • cpu-multi-modal-model-tests-n ×4
  • glm5next-unit-tests
Would skip (today's rules run them) (32)
  • ascend-npu-test
  • basic-correctness ×2
  • basic-correctness-cpu-offload
  • basic-correctness-cumem
  • basic-correctness-prefetch-offload
  • basic-correctness-sleep-mode
  • basic-models-test-other-cpu
  • basic-models-tests-initialization
  • basic-models-tests-other
  • benchmarks-cli-test
  • entrypoints-integration-api-server ×4
  • entrypoints-integration-api-server-generate
  • entrypoints-integration-api-server-openai-chat_completion
  • entrypoints-integration-api-server-openai-completion
  • entrypoints-integration-llm
  • entrypoints-integration-multimodal
  • entrypoints-integration-pooling
  • entrypoints-integration-responses-api
  • entrypoints-integration-speech_to_text
  • kernels-fla-ops-test-b200
  • kernels-mhc-test-b200
  • kernels-root-misc-test-b200
  • language-models-tests-granite-l4-compatibility
  • language-models-tests-hybrid ×2
  • language-models-tests-standard
  • multi-modal-models-standard-1-qwen2
  • multi-modal-models-standard-2-qwen3-gemma
  • multi-modal-models-standard-3-llava-qwen2-vl
  • multi-modal-models-standard-4-other-whisper
  • multi-modal-processor ×4
  • multi-modal-processor-cpu ×4
  • rl-entrypoints-tests
Would add (today's rules do not run them) (3)
  • arm-cpu-test ×3 (code map)
  • basic-models-tests-extra-initialization ×14 (code map)
  • cpu-multi-modal-model-tests-n ×4 (code map)
AMD mirrors: would skip (32)
  • basic-correctness ×2
  • basic-correctness-cpu-offload
  • basic-correctness-cumem
  • basic-correctness-prefetch-offload
  • basic-correctness-sleep-mode
  • basic-models-tests-initialization
  • basic-models-tests-other
  • benchmarks-cli-test
  • entrypoints-integration-api-server ×4
  • entrypoints-integration-api-server-generate
  • entrypoints-integration-api-server-openai-chat_completion
  • entrypoints-integration-api-server-openai-completion
  • entrypoints-integration-llm
  • entrypoints-integration-multimodal
  • entrypoints-integration-pooling
  • entrypoints-integration-responses-api
  • entrypoints-integration-speech_to_text
  • glm5next-unit-tests
  • kernels-fla-ops-test-b200
  • kernels-mhc-test-b200
  • kernels-root-misc-test-b200
  • language-models-tests-granite-l4-compatibility
  • language-models-tests-hybrid ×2
  • language-models-tests-standard
  • multi-modal-models-standard-1-qwen2
  • multi-modal-models-standard-2-qwen3-gemma
  • multi-modal-models-standard-3-llava-qwen2-vl
  • multi-modal-models-standard-4-other-whisper
  • multi-modal-processor ×4
  • platform-tests
  • pytorch-compilation-passes-unit-tests
  • rl-entrypoints-tests
AMD mirrors: would add (0)

none

1 changed files · base 29ae81fe83 · head 164d8047ab · Python record: build 93039 at 1e5d0ea888 · kernel record: table a982c81 (build 93415), map a982c81 · not counted: 10 build steps, 5 A100 steps the generator no longer emits, 8 optional steps the selector would also run

…ool indexer

Under DCP the kpool indexer merges per-rank top-k with the CuteDSL/Triton
DCP merge kernels, but only SparseAttnIndexer registered them for JIT
warmup, so GLM-5.x compiled PackDCPTopkCandidatesKernel during inference.
Register them from SparseAttnIndexerKpool as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: NickLucche <nicolo.lucchesi@mistral.ai>
@NickLucche
NickLucche force-pushed the glm-flash-kpool-dcp-merge-warmup branch from f75c346 to 984782e Compare October 5, 2026 14:45
Cover the warmup registration added to SparseAttnIndexerKpool.__init__:
both DCP top-k merge kernels are registered under DCP with JIT warmup
enabled, and neither is registered without DCP or with warmup disabled.

Generated with Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>

Signed-off-by: NickLucche <nicolo.lucchesi@mistral.ai>
@NickLucche
NickLucche marked this pull request as ready for review October 5, 2026 17:50

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

@NickLucche

Copy link
Copy Markdown
Member Author

@LopezCastroRoberto LopezCastroRoberto self-assigned this Oct 5, 2026

@LopezCastroRoberto LopezCastroRoberto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for catching this. I think we can drop the test and simplify the condition to current_platform.is_cuda() and has_cutedsl(). The registry already handles enable_jit_warmup, and DCP is guaranteed by the surrounding branch.

Address review feedback: drop the unit test and reduce the warmup condition to `current_platform.is_cuda() and has_cutedsl()`. The JIT warmup registry only compiles registered kernels when `enable_jit_warmup` is on (kernel_warmup gates registry.warmup()), and DCP > 1 is guaranteed by the surrounding branch, so the extra checks are redundant.

Generated with Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>

Signed-off-by: NickLucche <nicolo.lucchesi@mistral.ai>
@NickLucche

Copy link
Copy Markdown
Member Author

Thanks for reviewing @LopezCastroRoberto , addressed!
PS we usually don't request changes on reviews unless it's for blocking PR

@LopezCastroRoberto LopezCastroRoberto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gotcha! Sorry for the block @NickLucche. LGTM, thanks!

@LopezCastroRoberto

Copy link
Copy Markdown
Contributor

/ci run

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #93544 for commit 164d8047abf4.

@NickLucche
NickLucche merged commit 70bdce6 into vllm-project:main Oct 8, 2026
88 checks passed
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 kv-cache-manager

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants