From fd8679510737e632e74255520bb21606caa04cf7 Mon Sep 17 00:00:00 2001 From: YC Yen-Ching Tseng Date: Thu, 30 Jul 2026 17:56:07 +0800 Subject: [PATCH] [AMD] MiniMax-M3: opt-in custom/quick all-reduce on ROCm (#32230) --- python/sglang/srt/arg_groups/overrides.py | 7 ++++++- python/sglang/srt/environ.py | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/arg_groups/overrides.py b/python/sglang/srt/arg_groups/overrides.py index 08a236345..7c217cd56 100644 --- a/python/sglang/srt/arg_groups/overrides.py +++ b/python/sglang/srt/arg_groups/overrides.py @@ -508,7 +508,12 @@ def _minimax_m3_overrides(server_args: Any, hf_config: Any) -> dict: ) overrides["enable_aiter_allreduce_fusion"] = False aiter_fusion_resolved = False - if not aiter_fusion_resolved: + # By default MiniMax-M3 on ROCm keeps NCCL all-reduce (custom AR off) + # whenever aiter all-reduce fusion is not used. Opting in via + # SGLANG_M3_ALLOW_CUSTOM_AR keeps custom all-reduce enabled so the + # quick-reduce path (ROCM_QUICK_REDUCE_QUANTIZATION=INT4/INT6/INT8) can + # accelerate the large prefill all-reduce. + if not aiter_fusion_resolved and not envs.SGLANG_M3_ALLOW_CUSTOM_AR.get(): overrides["disable_custom_all_reduce"] = True elif is_sm100_supported(): if server_args.is_attention_backend_not_set(): diff --git a/python/sglang/srt/environ.py b/python/sglang/srt/environ.py index bfc19adb7..901a6dbf5 100644 --- a/python/sglang/srt/environ.py +++ b/python/sglang/srt/environ.py @@ -815,6 +815,11 @@ class Envs: # Set to 0: force disable (use default Aiter AR even with --enable-deterministic-inference) SGLANG_USE_1STAGE_ALLREDUCE = EnvBool(False) SGLANG_OPT_USE_CUSTOM_ALL_REDUCE_V2 = EnvBool(True) + # MiniMax-M3 on ROCm force-disables custom all-reduce in its model override + # (arg_groups/overrides.py) when aiter all-reduce fusion is off. Set this to + # opt back in and keep custom/quick all-reduce enabled -- e.g. to run the + # INT4 quick-reduce path via ROCM_QUICK_REDUCE_QUANTIZATION={INT4,INT6,INT8}. + SGLANG_M3_ALLOW_CUSTOM_AR = EnvBool(False) # Default per-direction workspace cap for CustomAllReduceV2; explicit # constructor sizes take precedence over this. SGLANG_CUSTOM_ALL_REDUCE_V2_MAX_SIZE_KB = EnvInt(16 * 1024)