Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
d9cd78eb
"vscode:/vscode.git/clone" did not exist on "8452946c06a3b8a76233d2b390d886a5a8c78182"
Unverified
Commit
d9cd78eb
authored
Sep 18, 2024
by
Nick Hill
Committed by
GitHub
Sep 18, 2024
Browse files
[BugFix] Nonzero exit code if MQLLMEngine startup fails (#8572)
parent
db9120cd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
vllm/entrypoints/openai/api_server.py
vllm/entrypoints/openai/api_server.py
+5
-11
No files found.
vllm/entrypoints/openai/api_server.py
View file @
d9cd78eb
...
@@ -11,7 +11,7 @@ from argparse import Namespace
...
@@ -11,7 +11,7 @@ from argparse import Namespace
from
contextlib
import
asynccontextmanager
from
contextlib
import
asynccontextmanager
from
functools
import
partial
from
functools
import
partial
from
http
import
HTTPStatus
from
http
import
HTTPStatus
from
typing
import
AsyncIterator
,
Optional
,
Set
from
typing
import
AsyncIterator
,
Set
import
uvloop
import
uvloop
from
fastapi
import
APIRouter
,
FastAPI
,
Request
from
fastapi
import
APIRouter
,
FastAPI
,
Request
...
@@ -95,7 +95,7 @@ async def lifespan(app: FastAPI):
...
@@ -95,7 +95,7 @@ async def lifespan(app: FastAPI):
@
asynccontextmanager
@
asynccontextmanager
async
def
build_async_engine_client
(
async
def
build_async_engine_client
(
args
:
Namespace
)
->
AsyncIterator
[
Optional
[
EngineClient
]
]
:
args
:
Namespace
)
->
AsyncIterator
[
EngineClient
]:
# Context manager to handle engine_client lifecycle
# Context manager to handle engine_client lifecycle
# Ensures everything is shutdown and cleaned up on error/exit
# Ensures everything is shutdown and cleaned up on error/exit
...
@@ -110,7 +110,7 @@ async def build_async_engine_client(
...
@@ -110,7 +110,7 @@ async def build_async_engine_client(
async
def
build_async_engine_client_from_engine_args
(
async
def
build_async_engine_client_from_engine_args
(
engine_args
:
AsyncEngineArgs
,
engine_args
:
AsyncEngineArgs
,
disable_frontend_multiprocessing
:
bool
=
False
,
disable_frontend_multiprocessing
:
bool
=
False
,
)
->
AsyncIterator
[
Optional
[
EngineClient
]
]
:
)
->
AsyncIterator
[
EngineClient
]:
"""
"""
Create EngineClient, either:
Create EngineClient, either:
- in-process using the AsyncLLMEngine Directly
- in-process using the AsyncLLMEngine Directly
...
@@ -188,10 +188,8 @@ async def build_async_engine_client_from_engine_args(
...
@@ -188,10 +188,8 @@ async def build_async_engine_client_from_engine_args(
break
break
except
TimeoutError
:
except
TimeoutError
:
if
not
engine_process
.
is_alive
():
if
not
engine_process
.
is_alive
():
logger
.
error
(
"Engine process died before responding "
raise
RuntimeError
(
"to readiness probe"
)
"Engine process failed to start"
)
from
None
yield
None
return
yield
mp_engine_client
# type: ignore[misc]
yield
mp_engine_client
# type: ignore[misc]
finally
:
finally
:
...
@@ -532,10 +530,6 @@ async def run_server(args, **uvicorn_kwargs) -> None:
...
@@ -532,10 +530,6 @@ async def run_server(args, **uvicorn_kwargs) -> None:
signal
.
signal
(
signal
.
SIGTERM
,
signal_handler
)
signal
.
signal
(
signal
.
SIGTERM
,
signal_handler
)
async
with
build_async_engine_client
(
args
)
as
engine_client
:
async
with
build_async_engine_client
(
args
)
as
engine_client
:
# If None, creation of the client failed and we exit.
if
engine_client
is
None
:
return
app
=
build_app
(
args
)
app
=
build_app
(
args
)
model_config
=
await
engine_client
.
get_model_config
()
model_config
=
await
engine_client
.
get_model_config
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment