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
15e7c675
Unverified
Commit
15e7c675
authored
Apr 25, 2024
by
Nick Hill
Committed by
GitHub
Apr 25, 2024
Browse files
[Core] Add `shutdown()` method to `ExecutorBase` (#4349)
parent
b6dcb4d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
vllm/engine/llm_engine.py
vllm/engine/llm_engine.py
+6
-0
vllm/executor/executor_base.py
vllm/executor/executor_base.py
+7
-0
No files found.
vllm/engine/llm_engine.py
View file @
15e7c675
...
@@ -287,6 +287,12 @@ class LLMEngine:
...
@@ -287,6 +287,12 @@ class LLMEngine:
# the closure used to initialize Ray worker actors
# the closure used to initialize Ray worker actors
raise
RuntimeError
(
"LLMEngine should not be pickled!"
)
raise
RuntimeError
(
"LLMEngine should not be pickled!"
)
def
__del__
(
self
):
# Shutdown model executor when engine is garbage collected
# Use getattr since __init__ can fail before the field is set
if
model_executor
:
=
getattr
(
self
,
"model_executor"
,
None
):
model_executor
.
shutdown
()
def
get_tokenizer
(
self
)
->
"PreTrainedTokenizer"
:
def
get_tokenizer
(
self
)
->
"PreTrainedTokenizer"
:
return
self
.
tokenizer
.
get_lora_tokenizer
(
None
)
return
self
.
tokenizer
.
get_lora_tokenizer
(
None
)
...
...
vllm/executor/executor_base.py
View file @
15e7c675
...
@@ -95,6 +95,13 @@ class ExecutorBase(ABC):
...
@@ -95,6 +95,13 @@ class ExecutorBase(ABC):
exception."""
exception."""
raise
NotImplementedError
raise
NotImplementedError
def
shutdown
(
self
)
->
None
:
"""Shutdown the executor."""
return
def
__del__
(
self
):
self
.
shutdown
()
class
ExecutorAsyncBase
(
ExecutorBase
):
class
ExecutorAsyncBase
(
ExecutorBase
):
...
...
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