Skip to content

Commit

Permalink
[Distributed][Core] Support Py39 and Py38 for PP (vllm-project#6120)
Browse files Browse the repository at this point in the history
Signed-off-by: Muralidhar Andoorveedu <muralidhar.andoorveedu@centml.ai>
  • Loading branch information
andoorve authored Jul 4, 2024
1 parent 1dab9bc commit 0ed646b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 1 addition & 6 deletions vllm/executor/executor_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,7 @@ def __init__(
multimodal_config: Optional[MultiModalConfig],
speculative_config: Optional[SpeculativeConfig],
) -> None:
# This locks each pipeline parallel stage so multiple virtual engines
# can't execute on the same stage at the same time
self.pp_locks = [
asyncio.Lock()
for _ in range(parallel_config.pipeline_parallel_size)
]
self.pp_locks: Optional[List[asyncio.Lock]] = None

super().__init__(model_config, cache_config, parallel_config,
scheduler_config, device_config, load_config,
Expand Down
9 changes: 9 additions & 0 deletions vllm/executor/ray_gpu_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,15 @@ async def _driver_execute_model_async(
self,
execute_model_req: Optional[ExecuteModelRequest] = None
) -> List[SamplerOutput]:
if self.pp_locks is None:
# This locks each pipeline parallel stage so multiple virtual
# engines can't execute on the same stage at the same time
# We create the locks here to avoid creating them in the constructor
# which uses a different asyncio loop.
self.pp_locks = [
asyncio.Lock()
for _ in range(self.parallel_config.pipeline_parallel_size)
]

async def _run_task_with_lock(task, lock, *args, **kwargs):
async with lock:
Expand Down

0 comments on commit 0ed646b

Please sign in to comment.