From fec613184480bd6fc5bfc9967bfb24a6125f684c Mon Sep 17 00:00:00 2001 From: fanxingran Date: Sat, 18 Jul 2026 01:22:14 +0800 Subject: [PATCH] [AMD] Disable DSA fused top-k v2 on ROCm for GLM-5.x / DeepSeek-V3.2 (#30506) Co-authored-by: kk <43161300+kkHuang-amd@users.noreply.github.com> --- python/sglang/srt/server_args.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/python/sglang/srt/server_args.py b/python/sglang/srt/server_args.py index 5a0d03464..05ef12de9 100644 --- a/python/sglang/srt/server_args.py +++ b/python/sglang/srt/server_args.py @@ -4409,6 +4409,16 @@ class ServerArgs: run_post_process_pass(self, _deepseek_moe_quant_resolution) if is_hip(): + if is_deepseek_dsa(hf_config): + # The fused top-k v2 kernel (topk_transform_512_v2) is a + # CUDA/Hopper-only path: its JIT source includes + # and uses cg::this_cluster() + # (thread-block clusters), neither of which exists on ROCm, + # so it fails to JIT-compile on gfx9xx during CUDA-graph + # capture. DeepSeek-V4 already disables it on HIP; mirror that + # here for the rest of the DSA family (DeepSeek-V3.2 / + # GLM-5.x) that shares the same decode top-k path. + envs.SGLANG_OPT_USE_TOPK_V2.set(False) if not self._resolved().enable_dp_attention and self.nnodes == 1: # TODO (Hubert): Put this back later # self.enable_aiter_allreduce_fusion = True