From c487a221ee27141170592d440cc973905a42fd97 Mon Sep 17 00:00:00 2001 From: Antoni Baum Date: Wed, 19 Jul 2023 23:17:12 -0700 Subject: [PATCH] Fix bad assert in initialize_cluster if PG already exists (#526) --- vllm/engine/ray_utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vllm/engine/ray_utils.py b/vllm/engine/ray_utils.py index db943ad411aa1..06ebf207abf58 100644 --- a/vllm/engine/ray_utils.py +++ b/vllm/engine/ray_utils.py @@ -81,9 +81,11 @@ def initialize_cluster( # Verify that we can use the placement group. gpu_bundles = 0 for bundle in bundles: - assert bundle.get("GPU", 0) > 1, ( - "Placement group bundles cannot have more than 1 GPU") - if bundle.get("GPU", 0): + bundle_gpus = bundle.get("GPU", 0) + if bundle_gpus > 1: + raise ValueError( + "Placement group bundle cannot have more than 1 GPU.") + if bundle_gpus: gpu_bundles += 1 if parallel_config.world_size > gpu_bundles: raise ValueError(