mirror of
https://github.com/vllm-project/vllm.git
synced 2025-10-20 23:03:52 +08:00
[V1] Guard Against Main Thread Usage (#14972)
Signed-off-by: rshaw@neuralmagic.com <robertgshaw2@gmail.com>
This commit is contained in:
@ -3,6 +3,7 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import dataclasses
|
import dataclasses
|
||||||
import json
|
import json
|
||||||
|
import threading
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import (TYPE_CHECKING, Any, Dict, List, Literal, Mapping, Optional,
|
from typing import (TYPE_CHECKING, Any, Dict, List, Literal, Mapping, Optional,
|
||||||
Tuple, Type, Union, cast, get_args)
|
Tuple, Type, Union, cast, get_args)
|
||||||
@ -1576,6 +1577,11 @@ class EngineArgs:
|
|||||||
#############################################################
|
#############################################################
|
||||||
# Experimental Features - allow users to opt in.
|
# Experimental Features - allow users to opt in.
|
||||||
|
|
||||||
|
# Signal Handlers requires running in main thread.
|
||||||
|
if (threading.current_thread() != threading.main_thread()
|
||||||
|
and _warn_or_fallback("Engine in background thread")):
|
||||||
|
return False
|
||||||
|
|
||||||
# LoRA is supported on V1, but off by default for now.
|
# LoRA is supported on V1, but off by default for now.
|
||||||
if self.enable_lora and _warn_or_fallback("LORA"):
|
if self.enable_lora and _warn_or_fallback("LORA"):
|
||||||
return False
|
return False
|
||||||
|
Reference in New Issue
Block a user