Skip to content

[Bugfix][V1] Warm up slot-mapping kernel through BlockTable - #46446

Closed
lesj0610 wants to merge 7 commits into
vllm-project:mainfrom
lesj0610:lesj/slot-mapping-jit-warmup-20260623-ready
Closed

lesj0610 wants to merge 7 commits into
vllm-project:mainfrom
lesj0610:lesj/slot-mapping-jit-warmup-20260623-ready

Conversation

@lesj0610

Copy link
Copy Markdown
Contributor

Problem

The old V1 BlockTable slot-mapping Triton kernel can be first touched after startup warmup, when the JIT monitor is already active.

The normal model dummy/profile runs do not directly exercise BlockTable.compute_slot_mapping() for every runtime-specialized request shape. When the first real request hits an uncovered shape, _compute_slot_mapping_kernel can still compile during inference.

Approach

  • Add BlockTable.warmup_compute_slot_mapping() and MultiGroupBlockTable.warmup_compute_slot_mapping() so the warmup goes through the same V1 block-table wrapper that runtime input preparation uses.
  • Cover the slot-mapping specialization classes observed for single-token, short non-divisible, and block-sized request shapes while staying within the allocated block-table bounds.
  • Call the V1 slot-mapping warmup from GPU worker initialization after the existing kernel warmup and before CUDA graph capture / JIT monitor activation.
  • Keep the change scoped to the old V1 BlockTable slot-mapping path. V2 GPU block-table and KV-zeroing warmup paths are not changed here.

This keeps the warmup near the owner of the slot-mapping kernel contract instead of adding a broader synthetic kernel launcher.

Test Plan

python -m py_compile \
  vllm/v1/worker/block_table.py \
  vllm/v1/worker/gpu_worker.py \
  tests/v1/worker/test_block_table_warmup.py

python -m ruff check \
  vllm/v1/worker/block_table.py \
  vllm/v1/worker/gpu_worker.py \
  tests/v1/worker/test_block_table_warmup.py

python -m ruff format --check \
  vllm/v1/worker/block_table.py \
  vllm/v1/worker/gpu_worker.py \
  tests/v1/worker/test_block_table_warmup.py

python -m pytest tests/v1/worker/test_block_table_warmup.py -q
git diff --check

Test Result

  • py_compile: passed
  • ruff check: passed
  • ruff format --check: passed
  • tests/v1/worker/test_block_table_warmup.py: 2 passed
  • git diff --check: passed

GPU runtime smoke was not rerun for this standalone PR, so absence of runtime JIT warnings remains to be validated on a CUDA serving run.

Checklist
  • Purpose
  • Test plan and results
  • AI assistance disclosed

AI assistance: Codex.

@mergify mergify Bot added v1 bug Something isn't working labels Jun 23, 2026
@lesj0610
lesj0610 marked this pull request as ready for review June 23, 2026 06:52
@lesj0610
lesj0610 requested a review from njhill as a code owner June 23, 2026 06:52
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@lesj0610
lesj0610 marked this pull request as draft June 24, 2026 02:38
lesj0610 added a commit to lesj0610/vllm that referenced this pull request Aug 22, 2026
Upstream's warmup infrastructure (vllm-project#50174) registers these kernels through
its own provider registry, so the fork-side warmup hooks are redundant.
Reverse-apply the deltas of the upstream warmup PRs (vllm-project#42193, vllm-project#42215,
vllm-project#43642, vllm-project#46446) so every file they touched matches origin/main:

- Drop the fused MoE, TurboQuant, hybrid GDN/Mamba/MRoPE and block-table
  warmup modules plus their tests and kernel_warmup wiring.
- Restore triton_decode_attention, triton_turboquant_decode,
  fused_recurrent and fused_moe to upstream (removes the VllmJitKernel
  wrappers those PRs introduced).
- Keep `import math` in mrope.py: it is used by the bounded M-RoPE cache
  work, not by the reverted warmup code.
@lesj0610 lesj0610 closed this Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant