[Distributed] Enable custom all-reduce under VLLM_BATCH_INVARIANT (#58623)
Signed-off-by: Flora Feng <4florafeng@gmail.com> Signed-off-by: sfeng33 <4florafeng@gmail.com>
This commit is contained in:
@@ -68,8 +68,11 @@ class CudaCommunicator(DeviceCommunicatorBase):
|
||||
envs.VLLM_ALLREDUCE_USE_FLASHINFER_PCIE_IPC
|
||||
and not envs.VLLM_BATCH_INVARIANT
|
||||
)
|
||||
use_aiter_allreduce = use_custom_allreduce and bool(
|
||||
rocm_aiter_ops.is_custom_all_reduce_enabled()
|
||||
# Neither AITER nor QuickReduce all-reduce has a fixed reduction order.
|
||||
use_aiter_allreduce = (
|
||||
use_custom_allreduce
|
||||
and not envs.VLLM_BATCH_INVARIANT
|
||||
and bool(rocm_aiter_ops.is_custom_all_reduce_enabled())
|
||||
)
|
||||
|
||||
self.use_custom_allreduce = use_custom_allreduce
|
||||
@@ -166,7 +169,12 @@ class CudaCommunicator(DeviceCommunicatorBase):
|
||||
else:
|
||||
self.use_aiter_ag_rs = True
|
||||
|
||||
if use_custom_allreduce and self.world_size > 1 and current_platform.is_rocm():
|
||||
if (
|
||||
use_custom_allreduce
|
||||
and self.world_size > 1
|
||||
and current_platform.is_rocm()
|
||||
and not envs.VLLM_BATCH_INVARIANT
|
||||
):
|
||||
# Initialize a custom quick all-reduce implementation for AMD.
|
||||
# Quick reduce is designed as a complement to custom allreduce
|
||||
# (vLLM's or AITER's), so it is initialized for either backend.
|
||||
|
||||
Reference in New Issue
Block a user