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",