Repository navigation
[Fix] [NPU] kimi-k3: Skip the CuTe DSL TGV tactic registration on NPU - #50107
Conversation
|
/rerun-ci test_kimi_k3*.py |
|
⛔ See the command reference. |
|
/rerun-test test_kimi_k3*.py |
|
🚀 🚀 🚀 🚀 ⛔ ⛔ ⛔ ⛔ ⛔ ⛔ |
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.
What
Guard the per-M TGV tactic registration in
KimiK3LinearForCausalLM.__init__withif not (_is_hip or _is_npu), so Ascend NPU 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. #49929 later skipped it on ROCm, but the guard only covers HIP. That module importscuda.bindingsandcutlassat module level, and neither exists in the Ascend NPU environment, so every Kimi-K3/K3.1 server exits during model init with:followed by
Received sigquit from a child processon all TP ranks (TP0-TP7). The registered tactics are only read by the CuTe DSL GEMM path, which NPU never selects; the other import sites of this module inkimi_k3.pyare already behind the cutedsl backend or SM103 checks.Test plan
python -m py_compileonpython/sglang/srt/models/kimi_k3.py: pass.ModuleNotFoundError: No module named 'cuda', and the VLM startup warmup runs.Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #43217228115
Latest PR Test (Extra): ❌ Run #43217227724
Latest PR Test (AMD ROCm 10): ❌ Run #43217227681
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: