Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
robertgshaw2-redhat committed Jan 3, 2025
1 parent 55a6195 commit aa6954f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
16 changes: 0 additions & 16 deletions vllm/v1/engine/async_llm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
import os
import signal
from typing import AsyncGenerator, Dict, List, Mapping, Optional, Type, Union

from vllm.config import ModelConfig, VllmConfig
Expand Down Expand Up @@ -42,21 +41,6 @@ def __init__(
start_engine_loop: bool = True,
) -> None:

# The child processes will send SIGQUIT when unrecoverable
# errors happen. We kill the process tree here so that the
# stack trace is very evident.
# TODO: rather than killing the main process, we should
# figure out how to raise an AsyncEngineDeadError and
# handle at the API server level so we can return a better
# error code to the clients calling VLLM.
def sigquit_handler(signum, frame):
logger.fatal(
"AsyncLLM got SIGQUIT from worker processes, shutting "
"down. See stack trace above for root cause issue.")
kill_process_tree(os.getpid())

signal.signal(signal.SIGQUIT, sigquit_handler)

assert start_engine_loop

self.log_requests = log_requests
Expand Down
19 changes: 18 additions & 1 deletion vllm/v1/engine/core_client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os
import signal
import weakref
from abc import ABC, abstractmethod
from typing import List, Type
Expand All @@ -8,7 +10,8 @@

from vllm.config import VllmConfig
from vllm.logger import init_logger
from vllm.utils import get_open_zmq_ipc_path, make_zmq_socket
from vllm.utils import (get_open_zmq_ipc_path, make_zmq_socket,
kill_process_tree)
from vllm.v1.engine import (EngineCoreOutput, EngineCoreOutputs,
EngineCoreProfile, EngineCoreRequest,
EngineCoreRequestType, EngineCoreRequestUnion)
Expand Down Expand Up @@ -134,6 +137,20 @@ def __init__(
executor_class: Type[Executor],
log_stats: bool = False,
):
# The child processes will send SIGQUIT when unrecoverable
# errors happen. We kill the process tree here so that the
# stack trace is very evident.
# TODO(rob): rather than killing the main process, we should
# figure out how to raise an AsyncEngineDeadError and
# handle at the API server level so we can return a better
# error code to the clients calling VLLM.
def sigquit_handler(signum, frame):
logger.fatal(
"Got SIGQUIT from worker processes, shutting "
"down. See stack trace above for root cause issue.")
kill_process_tree(os.getpid())
signal.signal(signal.SIGQUIT, sigquit_handler)

# Serialization setup.
self.encoder = PickleEncoder()
self.decoder = msgspec.msgpack.Decoder(EngineCoreOutputs)
Expand Down
1 change: 0 additions & 1 deletion vllm/v1/engine/llm_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __init__(
use_cached_outputs: bool = False,
multiprocess_mode: bool = False,
) -> None:

# TODO: Can we avoid this?
self.model_config = vllm_config.model_config

Expand Down

0 comments on commit aa6954f

Please sign in to comment.