Repository navigation
fix(plugins): warm up vLLM's AKLR GEMM kernels without a model step - #165
Merged
Merged
Conversation
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.
kyle-256
requested review from
RuibinCheung,
irvineoy,
jiejingzhangamd,
xiaobochen-amd and
zhenhuang12
as code owners
November 12, 2026 10:19
There was a problem hiding this comment.
🟡 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) |
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The vLLM plugin's warmup ran one
runner._dummy_runper 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=1vs off:After the fix, greedy completions with AKLR on are correct again.