[AMD] Fix DeepSeekV4 server cutlass error - #30374
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces conditional imports for pick_dsl_expand and CuteDSLPagedMQALogitsRunner to avoid eager loading on ROCm (HIP) platforms. The review feedback notes that on ROCm platforms, pick_dsl_expand is left completely undefined in the module namespace, which will trigger static analysis warnings. It is recommended to define a fallback value of None when _is_hip is True to resolve this issue.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if not _is_hip: | ||
| # Preserve the original eager import behavior on non-ROCm platforms. | ||
| from sglang.jit_kernel.dsa import pick_dsl_expand |
There was a problem hiding this comment.
When _is_hip is True, pick_dsl_expand is not imported and remains completely undefined in the module namespace. Although the code path that uses it (use_cute_dsl) is not reachable on ROCm, static analysis tools (such as Pyright, mypy, or flake8) will still flag pick_dsl_expand as an undefined name.\n\nDefining a fallback value of None when _is_hip is True resolves this static analysis issue.
if not _is_hip:\n # Preserve the original eager import behavior on non-ROCm platforms.\n from sglang.jit_kernel.dsa import pick_dsl_expand\nelse:\n pick_dsl_expand = NoneThere was a problem hiding this comment.
Please check this review comment and fix that
b8zhong
left a comment
There was a problem hiding this comment.
Thanks. Sorry about the breaking
…error (sgl-project#30374) (sgl-project#30729) Co-authored-by: Wang, FangYuan <39615225+At1a8@users.noreply.github.com>


Motivation
PR #25220 introduced a top-level import of the CuTeDSL MQA logits module, which depends on NVIDIA-only cutlass packages.
On AMD/ROCm environments without cutlass, this import fails during DSV4 model registration and prevents the server from starting, even though the CuTeDSL backend is not used.

Modifications
Guard the CuTeDSL imports behind
not is_hip(). On non-ROCm platforms, preserve the original eager import behavior so NVIDIA/CuTeDSL logic remains unchanged.Accuracy Tests
root@smci355-ccs-aus-n12-13:/sgl-workspace/sglang# python3 /sgl-workspace/sglang/benchmark/gsm8k/bench_sglang.py --port 8000 --num-questions 1319
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1319/1319 [01:08<00:00, 19.29it/s]
Accuracy: 0.948
Invalid: 0.000
Latency: 68.365 s
Output throughput: 1728.667 token/s
Speed Tests and Profiling
This PR has almost no impact on performance.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #28877915192
Latest PR Test (Extra): ❌ Run #28877913869