Skip to content

Commit 16e9064

Browse files
robertgshaw2-redhatsimon-mo
authored andcommitted
[V1] Guard Against Main Thread Usage (#14972)
Signed-off-by: rshaw@neuralmagic.com <robertgshaw2@gmail.com>
1 parent 5ac1a8e commit 16e9064

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

vllm/engine/arg_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import argparse
44
import dataclasses
55
import json
6+
import threading
67
from dataclasses import dataclass
78
from typing import (TYPE_CHECKING, Any, Dict, List, Literal, Mapping, Optional,
89
Tuple, Type, Union, cast, get_args)
@@ -1576,6 +1577,11 @@ def _is_v1_supported_oracle(self, model_config: ModelConfig) -> bool:
15761577
#############################################################
15771578
# Experimental Features - allow users to opt in.
15781579

1580+
# Signal Handlers requires running in main thread.
1581+
if (threading.current_thread() != threading.main_thread()
1582+
and _warn_or_fallback("Engine in background thread")):
1583+
return False
1584+
15791585
# LoRA is supported on V1, but off by default for now.
15801586
if self.enable_lora and _warn_or_fallback("LORA"):
15811587
return False

0 commit comments

Comments
 (0)