Disable Custom AR V2 when in multi-node (#24729)
Co-authored-by: b8zhong <b8zhong@users.noreply.github.com>
This commit is contained in:
@@ -344,6 +344,8 @@ def dispatch_custom_allreduce():
|
||||
|
||||
On CUDA, the JIT-compiled v2 implementation is used by default.
|
||||
Set SGLANG_OPT_USE_CUSTOM_ALL_REDUCE_V2=0 to fall back to the legacy CustomAllreduce.
|
||||
Note: ``ServerArgs._handle_environment_variables`` forces this env to "0" when
|
||||
``nnodes > 1`` since custom AR is intra-node only.
|
||||
"""
|
||||
if _is_cuda and envs.SGLANG_OPT_USE_CUSTOM_ALL_REDUCE_V2.get():
|
||||
from .custom_all_reduce_v2 import CustomAllReduceV2
|
||||
|
||||
@@ -4012,6 +4012,16 @@ class ServerArgs:
|
||||
envs.SGLANG_ENABLE_DETERMINISTIC_INFERENCE.set(
|
||||
"1" if self.enable_deterministic_inference else "0"
|
||||
)
|
||||
# Custom all-reduce v2 uses IPC handles and is intra-node only. Force-disable
|
||||
# on multi-node so the dispatch falls back to the legacy CustomAllreduce path.
|
||||
if self.nnodes > 1 and envs.SGLANG_OPT_USE_CUSTOM_ALL_REDUCE_V2.get():
|
||||
if envs.SGLANG_OPT_USE_CUSTOM_ALL_REDUCE_V2.is_set():
|
||||
logger.warning(
|
||||
"Disabling SGLANG_OPT_USE_CUSTOM_ALL_REDUCE_V2 because nnodes=%d "
|
||||
"(custom all-reduce v2 is intra-node only).",
|
||||
self.nnodes,
|
||||
)
|
||||
envs.SGLANG_OPT_USE_CUSTOM_ALL_REDUCE_V2.set("0")
|
||||
if self.debug_cuda_graph:
|
||||
if not is_cuda():
|
||||
logger.warning(
|
||||
|
||||
Reference in New Issue
Block a user