From c4c0d08782dacf183c52ce3faf48c352ff3481d8 Mon Sep 17 00:00:00 2001 From: Woosuk Kwon Date: Tue, 30 Jan 2024 14:39:40 -0800 Subject: [PATCH] [Minor] Fix false warning when TP=1 (#2674) --- vllm/model_executor/parallel_utils/custom_all_reduce.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vllm/model_executor/parallel_utils/custom_all_reduce.py b/vllm/model_executor/parallel_utils/custom_all_reduce.py index 5b88649cc2129..628c151761fb2 100644 --- a/vllm/model_executor/parallel_utils/custom_all_reduce.py +++ b/vllm/model_executor/parallel_utils/custom_all_reduce.py @@ -29,6 +29,10 @@ def init_custom_ar() -> None: return rank = get_tensor_model_parallel_rank() world_size = get_tensor_model_parallel_world_size() + if world_size == 1: + # No need to initialize custom allreduce for single GPU case. + return + if world_size not in _SUPPORTED_WORLD_SIZES: logger.warn( "Custom allreduce is disabled due to an unsupported world size: "