Skip to content

Commit

Permalink
Use spawn instead of fork method for vllm
Browse files Browse the repository at this point in the history
  • Loading branch information
mreso committed Sep 11, 2024
1 parent d6ea6e7 commit 67e30b0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ts/torch_handler/vllm_handler.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import logging
import os
import pathlib
import time
from unittest.mock import MagicMock
Expand Down Expand Up @@ -40,6 +41,8 @@ def initialize(self, ctx):
vllm_engine_config = self._get_vllm_engine_config(
ctx.model_yaml_config.get("handler", {})
)

os.environ["VLLM_WORKER_MULTIPROC_METHOD"] = "spawn"

self.vllm_engine = AsyncLLMEngine.from_engine_args(vllm_engine_config)

Expand Down

0 comments on commit 67e30b0

Please sign in to comment.