From cce0b53466243861c43cf3df7c1856bda7968198 Mon Sep 17 00:00:00 2001 From: wufann <36477220+wufann@users.noreply.github.com> Date: Fri, 28 Aug 2026 13:20:52 +0800 Subject: [PATCH] [AMD] Increase gfx950 DSA model indexer topk_transform kernel occupancy (#35628) --- python/sglang/kernels/aot/setup_rocm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/sglang/kernels/aot/setup_rocm.py b/python/sglang/kernels/aot/setup_rocm.py index 289683910..432dfa1e7 100644 --- a/python/sglang/kernels/aot/setup_rocm.py +++ b/python/sglang/kernels/aot/setup_rocm.py @@ -87,8 +87,9 @@ fp8_macro = ( # Dynamic shared-memory budget for the TopK kernels. # - gfx942 (MI300/MI325): LDS is typically 64KB per workgroup -> keep dynamic smem <= ~48KB # (leaves room for static shared allocations in the kernel). -# - gfx95x (MI350) and gfx1250: LDS is larger -> allow the original 128KB dynamic smem. -topk_dynamic_smem_bytes = 48 * 1024 if amdgpu_target == "gfx942" else 32 * 1024 * 4 +# - gfx95x (MI350) and gfx1250: LDS is larger. Large dynamic budget wastes LDS +# and pins occupancy to 1 block/CU. Keep it small (40KB) for better occupancy. +topk_dynamic_smem_bytes = 48 * 1024 if amdgpu_target == "gfx942" else 40 * 1024 hipcc_flags = [ "-DNDEBUG",