[https://nvbugs/6669206][fix] Gate the escape on the head count alone via trtllm-gen's real constraint (`not… - #18314
Conversation
…l for every batch shape trtllm-gen MLA decode rejects 64 < num_heads_q < 128 outright: its Q tile is 64 or 128 heads and neither divides such a head count once K3's padding to 128 heads was removed. K3's per-batch decode policy gated that correctness escape on num_contexts > 0, so it only covered mixed batches. A generation-only speculative-verification batch (num_contexts=0, num_gen_tokens != num_ generations) took the multi-token perf fallback and was downgraded to trtllm-gen, which then raised ValueError for num_heads_q=96. Gate the escape on the head count alone, expressed as trtllm-gen's real constraint, so neither perf-motivated fallback can target an illegal head count. Both fallbacks still apply where trtllm-gen is legal (e.g. H=128). Removes the waiver the failure was parked under. Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughKimi K3 MLA decode backend selection now avoids TRTLLM-Gen for head counts from 65 through 127. Tests verify H=96 uses CuTe DSL and H=128 uses TRTLLM-Gen. Related guidance and test waivers are updated. ChangesKimi K3 MLA backend selection
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change adjusts the K3 MLA backend selection gate and updates its tests and documentation; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
metadata.num_contexts > 0, so generation-only multi-token (spec-verification) batches took the perf fallback to trtllm-gen, whose MLA decode rejects64 < num_heads_q < 128.not 64 < num_heads < 128), so neither perf fallback can select an unsupported head count, while both still apply where trtllm-gen is legal (H=128 control); updated the docstring, developer guide, unit-test truth table, and removed the bug's waiver.pytest tests/unittest/tools/test_layer_wise_benchmarks.py::test_kimi_k3_gen_dep -k "1" -vTest plan
Links
Dev Engineer Review
trtllm-genfor65 <= num_heads <= 127.trtllm-gen.QA Engineer Review
tests/integration/test_lists/waives.txt, so it is covered by CI.