Repository navigation
[Fix] [AMD] kimi-k3: Skip the CuTe DSL TGV tactic registration on ROCm - #49929
Merged
nvpohanh merged 1 commit intoNov 12, 2026
Merged
Conversation
KimiK3LinearForCausalLM.__init__ imports cutedsl_bf16_gemm unconditionally to register per-M TGV tactics. That module imports cuda.bindings and cutlass at module level, so the Kimi-K3.1-Pro server fails to start on ROCm with ModuleNotFoundError: No module named 'cuda'. The tactics are only read by the CuTe DSL GEMM, which ROCm never selects.
This was referenced Nov 11, 2026
michaelzhang-ai
marked this pull request as ready for review
November 11, 2026 22:50
Collaborator
|
merged. sorry for causing the issue |
5 tasks
This was referenced Nov 13, 2026
kevin-mii
added a commit
that referenced
this pull request
Nov 14, 2026
Conflicts: - pyproject_other.toml: take the target's fastokens extra; keep the sgl-amd-mono pin at b9f40eb562 (sgl-amd-mono#121), which contains the target's 7113024f. - speculative/draft_worker_common.py, arg_groups/speculative_hook.py: DFLASH_MLA_ONLY_DRAFT_BACKENDS moved to arg_groups/choices.py (#49621); keep the two DCP draft-backend helpers beside it. - dsa_backend.py: take the target's removal of _validate_dcp_backend, and drop validate_dcp_backend_hip with it; server_args already rejects non-triton DSA backends under DCP on ROCm. - dsa/dsa_indexer.py: keep the FP4 index-K branch around the target's BF16-logits budget and LiteTopK prefill (both off on ROCm). - prefill_cuda_graph_runner.py: prefix hits now replay under DCP (#49943) and the per-shape KV buffers are gone; ROCm Kimi-K3.1 still skips the DCP extend plan, which its DSA layers never read. - models/dflash.py: both platform flags. - models/kimi_k3.py: take the target's MXFP8 in-proj guard and ROCm TGV skip (#49929); the ROCm in-proj fusion stays ungated by do_fuse_qkvbfg. - attention/test_dflash_mla_backends.py: take the sliding-window case; skip it on ROCm (trtllm_mla and cutedsl_mla have no ROCm build). Also: test_triton_mla_window_dcp imports is_mla_dcp_lse_base_on_e from dcp.layout, its new home. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 16, 2026
5 tasks
rumitdesai
added a commit
to rumitdesai/sglang
that referenced
this pull request
Nov 25, 2026
KimiK3LinearForCausalLM.__init__ imports sglang.kernels.ops.gemm.cutedsl_bf16_gemm to register K3's measured TGV GEMM tactics on every platform except ROCm (sgl-project#49929) and Ascend NPU (sgl-project#50107). That module imports cuda.bindings and cutlass at module level, and only the CUDA install (python/pyproject.toml) depends on cuda-python and nvidia-cutlass-dsl. On the CPU, XPU and other installs, and on out-of-tree accelerator platforms, Kimi-K3 therefore fails at model construction with `ModuleNotFoundError: No module named 'cutlass'`. Only the CUDA CuTe DSL GEMM path reads these tactics. Move the registration into `_register_k3_tgv_m_ranges`, which returns unless `get_platform().is_cuda` (the check the file already uses for other CUDA-only paths), so new platforms no longer have to be added to a skip list one at a time. CUDA behaviour is unchanged, and ROCm and NPU stay skipped.
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.
What
Guard the per-M TGV tactic registration in
KimiK3LinearForCausalLM.__init__withif not _is_hip, so ROCm no longer imports the CuTe DSL BF16 GEMM module.Why
#49478 added an unconditional
from sglang.kernels.ops.gemm.cutedsl_bf16_gemm import register_tgv_m_rangesto the model constructor. That module importscuda.bindingsandcutlassat module level, and neither ships in the ROCm image, so the Kimi-K3.1-Pro server exits during model init withModuleNotFoundError: No module named 'cuda'(traceback throughkimi_k3.py:3459). The registered tactics are only read by the CuTe DSL GEMM path, which ROCm never selects; the other import sites of this module inkimi_k3.pyare already behind the cutedsl backend or SM103 checks.Failing jobs on main (MI35x, rocm10 nightly, first scheduled run containing #49478):
test_kimi_k31_pro_eval_mi35x.pyandtest_kimi_k31_pro_perf_mi35x.py)The same job passed on rocm10 on Nov 9 and on rocm724 on Nov 10, before the change.
Test plan
python -m py_compileand pre-commit on the changed file: pass.nightly-8-gpu-mi35x-kimi-k31-prorun on this commit: https://github.com/sgl-project/sglang/actions/runs/43100463379/job/130790135369 (server starts;test_kimi_k31_pro_eval_mi35x.pypasses with GSM8K accuracy 0.979, andtest_kimi_k31_pro_perf_mi35x.pypasses).CI States
Latest PR Test (Base): ❌ Run #43100836191
Latest PR Test (Extra): ❌ Run #43100836865
Latest PR Test (AMD ROCm 10): ❌ Run #43100836123
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: