Skip to content

fix(plugins): warm up vLLM's AKLR GEMM kernels without a model step - #165

Merged
kyle-256 merged 1 commit into
mainfrom
kyle/vllm-warmup-no-dummy-step
Nov 13, 2026
Merged

kyle-256 merged 1 commit into
mainfrom
kyle/vllm-warmup-no-dummy-step

Conversation

@kyle-256

Copy link
Copy Markdown
Collaborator

The vLLM plugin's warmup ran one runner._dummy_run per token count past the CUDA graph sizes, after vLLM's own warmup. On vLLM 0.33.0rc1.dev910 (v2 model runner) that leaves Kimi-K3 wrong at every decode step after it: greedy text degenerates after the first token and DSpark accepts no draft token. The steps themselves are the cause: the same happens with AKLR's dispatch paused during them, and not when they are skipped.

Now each GEMM kernel AKLR serves past the graph sizes, and the LM head's, is called once on zero operands: the same kernels compile before serving, and no model state is touched. MoE Points those steps also reached compile at their first prefill.

Base: main.

End to end

Kimi-K3, 8× MI355X, vLLM 0.33.0rc1.dev910 (nightly-4fab5a07), TP8, fp8 KV, DSpark 2 draft tokens, ISL 100K–500K, OSL 1000, C=1 and 2, AKLR_VLLM_PLUGIN=1 vs off:

accept length, AKLR on (off) decode tok/s, on / off
before 1.00 (1.27–2.29) 0.45–0.83
after 1.26–2.35 (1.25–2.25) 0.96–1.07

After the fix, greedy completions with AKLR on are correct again.

The vLLM plugin's warmup ran one runner._dummy_run per token count past the CUDA graph
sizes, after vLLM's own warmup. On vLLM 0.33.0rc1.dev910 (v2 model runner) that leaves
Kimi-K3 (linear attention, DSpark drafter) wrong at every decode step after it: greedy
text degenerates after the first token and DSpark accepts no draft token. It does so with
AKLR's dispatch paused during those steps too, so the steps themselves, not AKLR's
kernels, are the cause.

Call each GEMM kernel AKLR serves past the graph sizes, and the LM head's, once on zero
operands instead. Same kernels compiled before serving, no model state touched. The MoE
Points those steps also reached now compile at their first prefill.

Copilot AI 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.

🟡 Changes recommended

Warmup executes unrelated GEMM shapes that can abort worker startup and records scratch calls as observed workloads when AKLR_EXPORT=1, contaminating exported workload data.

2 open issues
What changed in this PR

This PR replaces dummy model-step warmup in the vLLM plugin with direct GEMM kernel calls, avoiding the decoding corruption reported for Kimi-K3 while compiling kernels before serving.

Changes:

  • Reconstructs served GEMM workload Points and calls their kernels with zero-filled scratch operands.
  • Warms GEMMs beyond CUDA graph sizes and LM-head kernels without executing model steps.
  • Updates warmup documentation, counters, and logging to reflect kernel calls.
File Description
aklr/​plugins/​vllm/​warmup.py Replaces dummy model runs with scratch GEMM calls and updates warmup reporting.

Review effort: Max

Comment on lines +48 to +54
result = gemm(
zeros((m, k), "a"),
zeros((n, k) if trans_b else (k, n), "b"),
trans_b=trans_b,
bias=zeros((n,), "bias") if point.attrs["has_bias"] else None,
out_dtype=semantics.torch_dtypes(point.dtypes["out"])[0],
)
Comment on lines +73 to +74
elif graph_tokens < m <= max_tokens:
steps += _call_once(point, device)
@kyle-256
kyle-256 merged commit 1dafc82 into main Nov 13, 2026
13 checks passed
zhenhuang12 pushed a commit that referenced this pull request Nov 14, 2026
- aiter's SwiGLU MoE reaches fused_moe only where aiter rounds its activations as fused_moe does (#160).
- A sglang route whose target needs a package that is not installed is left unhooked instead of ending sglang's
  start (#160). The lm_head routes hand gemm the hidden states as they are; the Triton GEMM route takes the K3
  image's aiter's persistent option (#159). vLLM's GEMM warmup records no workload and builds only the weight shapes
  of the rank's model and drafter (#165).
- Attention residual, sglang and vLLM: masked lanes score -inf; one lane stores each LDS partial; sums of squares
  past float32 are summed again scaled (decode kernels, on a uniform rare path, the common path as before) or
  prescaled by 2**-32 (prefill kernels); vLLM's mix without an output norm is weighted by normalized weights
  (#162, #176).
- kimi_k3_attn_res: RMS weights may be any finite value; the reference widens each chunk only and returns the prefix
  unscored with no bank row (#176). Route tests, GPU range regressions, the vLLM baseline's parity with vLLM's
  kernel, and two more vLLM Points.
@kyle-256
kyle-256 deleted the kyle/vllm-warmup-no-dummy-step branch November 16, 2026 05:27
kyle-256 added a commit that referenced this pull request Nov 16, 2026
… activation rounding, sglang without aiter (#197)

* fix(plugins): fixes from Copilot's reviews of the merged Kimi-K3 PRs

- aiter's SwiGLU MoE reaches fused_moe only where aiter rounds its activations as fused_moe does (#160).
- A sglang route whose target needs a package that is not installed is left unhooked instead of ending sglang's
  start (#160). The lm_head routes hand gemm the hidden states as they are; the Triton GEMM route takes the K3
  image's aiter's persistent option (#159). vLLM's GEMM warmup records no workload and builds only the weight shapes
  of the rank's model and drafter (#165).
- Attention residual, sglang and vLLM: masked lanes score -inf; one lane stores each LDS partial; sums of squares
  past float32 are summed again scaled (decode kernels, on a uniform rare path, the common path as before) or
  prescaled by 2**-32 (prefill kernels); vLLM's mix without an output norm is weighted by normalized weights
  (#162, #176).
- kimi_k3_attn_res: RMS weights may be any finite value; the reference widens each chunk only and returns the prefix
  unscored with no bank row (#176). Route tests, GPU range regressions, the vLLM baseline's parity with vLLM's
  kernel, and two more vLLM Points.

* test(plugins): drop the finite-input attention-residual tests

Their 36 sglang and 18 vLLM cases each loaded every committed schema (about 23 s on the CI
node) and stopped the unit tests at their 25-minute limit.

* fix(plugins): keep the no-norm attention residual within its VGPRs

The rare path for a sum of squares past float32 loaded all nine rows at once
for its mix. That pushed the 896-thread kernel past its 128 VGPRs, so the
common path spilled its rows to scratch (47 VGPRs, 192 bytes) and ran at
0.76x of the baseline. Without a norm the rare path now loads one row at a
time, with a scheduling barrier between rows of the mix: 120 VGPRs and no
scratch, about 1.9x again on all four workloads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants