Skip to content

Commit

Permalink
make pp group initilized to avoid pooint-to-point communication as th…
Browse files Browse the repository at this point in the history
…e first call

Signed-off-by: yisheng <[email protected]>
  • Loading branch information
ys950902 committed Jan 2, 2025
1 parent 74fa1d1 commit 7a7ede7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vllm/worker/xpu_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from vllm.config import VllmConfig
from vllm.distributed import (ensure_model_parallel_initialized,
init_distributed_environment)
from vllm.distributed.parallel_state import get_pp_group
from vllm.logger import init_logger
from vllm.model_executor import set_random_seed
from vllm.platforms import current_platform
Expand Down Expand Up @@ -176,3 +177,8 @@ def init_worker_distributed_environment(self) -> None:
parallel_config.pipeline_parallel_size)
# global all_reduce needed for overall oneccl warm up
torch.distributed.all_reduce(torch.zeros(1).xpu())

if parallel_config.pipeline_parallel_size > 1:
# Add pp group init to avoid
# p2p communication as the first call
get_pp_group().all_reduce(torch.zeros(1).xpu())

0 comments on commit 7a7ede7

Please sign in to comment.