perf(kimi-k3): re-sweep MoE tactic tables for flashinfer 0.6.16, warn on stale tables - #902
Merged
Merged
Conversation
… on stale tables The flashinfer 0.6.16 pin bump (#869) silently orphaned the packaged K3 tactic tables: their filenames embed the swept flashinfer version (0.6.16.dev20260730), so the loader — correctly — refuses them and every K3 launch falls back to the startup autotune window, whose native picks lose 16-83% on prefill-sized buckets. Tactic indices do not survive version changes (the trtllm-gen kernel enumeration reorders between builds: 17/21 ep=8 buckets and 12/21 tp=8 buckets map to different indices for the same tile families), so tables must be re-swept on every pin bump, never renamed. - Re-sweep both layouts (ep=8,tp=1 and ep=1,tp=8) on flashinfer 0.6.16 stable, B300, tune_max=8192; load-verified on current main. - Warn on stale tables: a lookup miss that finds a same-model/layout/ device table swept on a different flashinfer version now logs a WARNING naming the orphaned file and the re-sweep command, instead of the generic INFO. A pin bump that forgets the tables becomes visible in serving logs rather than a silent perf regression. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: dongjiyingdjy <87510204+dongjiyingdjy@users.noreply.github.com>
dongjiyingdjy
force-pushed
the
k3-tactic-tables-fi0616
branch
from
August 3, 2026 02:47
ecadf86 to
1eac1da
Compare
lightseek-bot
approved these changes
Aug 3, 2026
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.
Summary
The flashinfer 0.6.16 pin bump (#869) silently orphaned the packaged Kimi-K3 MoE tactic tables: filenames embed the swept flashinfer version (
0.6.16.dev20260730), the loader correctly refuses a version mismatch, and every K3 launch since has fallen back to the startup autotune window — whose native picks lose 16–83% on prefill-sized buckets. This PR re-sweeps both layout tables on 0.6.16 stable and makes the failure mode visible.Changes
ep=8,tp=1andep=1,tp=8(B300, flashinfer 0.6.16,tune_max=8192, 21 buckets each). Tactic indices do not survive version changes — the trtllm-gen kernel enumeration reorders between builds, so 17/21 (ep=8) and 12/21 (tp=8) buckets map to different indices for the same tile families. Tables must be re-swept on every pin bump, never renamed.load_packaged_flashinfer_tuning_cache: a lookup miss that finds a same-model/layout/device table swept on a different flashinfer version now logs a WARNING naming the orphaned file and the re-sweep command (previously a generic INFO). The next pin bump that forgets the tables shows up in serving logs instead of being a silent perf regression.Measured (B300 ×8, K3 w4a8, flashinfer 0.6.16)
Kernel level (
moe_tactic_sweep, table tactic vs autotune-window native pick, cold-L2):End-to-end A/B (same commit, same TP8 serve config, only variable = table file present; evalscope, 8×~4k-token prompts for prefill, 32-way × 256-token generations for decode):
Decode parity is expected: decode buckets (≤32 rows) are where the native heuristic is already near-optimal, and attention/comm dilute the MoE share.
Both tables load-verified on current main (post-#820: table load seeds the startup window; seeded shapes are skipped at zero cost). Note the sweep is keyed to
tune_max=8192— serving withchunked_prefill_size > 8192changes the bucket ladder and misses the table.🤖 Generated with Claude Code