Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
1b290ace
Unverified
Commit
1b290ace
authored
Nov 11, 2023
by
Dominik Schwabe
Committed by
GitHub
Nov 11, 2023
Browse files
Run default _AsyncLLMEngine._run_workers_async in threadpool (#1628)
parent
0d578228
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
vllm/engine/async_llm_engine.py
vllm/engine/async_llm_engine.py
+6
-7
No files found.
vllm/engine/async_llm_engine.py
View file @
1b290ace
...
@@ -206,18 +206,17 @@ class _AsyncLLMEngine(LLMEngine):
...
@@ -206,18 +206,17 @@ class _AsyncLLMEngine(LLMEngine):
**
kwargs
,
**
kwargs
,
)
->
Any
:
)
->
Any
:
"""Runs the given method on all workers."""
"""Runs the given method on all workers."""
all_output
s
=
[]
coro
s
=
[]
for
worker
in
self
.
workers
:
for
worker
in
self
.
workers
:
if
self
.
parallel_config
.
worker_use_ray
:
if
self
.
parallel_config
.
worker_use_ray
:
executor
=
partial
(
worker
.
execute_method
.
remote
,
method
)
coros
.
append
(
worker
.
execute_method
.
remote
(
method
,
*
args
,
**
kwargs
))
else
:
else
:
executor
=
getattr
(
worker
,
method
)
executor
=
getattr
(
worker
,
method
)
coros
.
append
(
asyncio
.
get_event_loop
().
run_in_executor
(
None
,
partial
(
executor
,
*
args
,
**
kwargs
)))
output
=
executor
(
*
args
,
**
kwargs
)
all_outputs
=
await
asyncio
.
gather
(
*
coros
)
all_outputs
.
append
(
output
)
if
self
.
parallel_config
.
worker_use_ray
:
all_outputs
=
await
asyncio
.
gather
(
*
all_outputs
)
if
get_all_outputs
:
if
get_all_outputs
:
return
all_outputs
return
all_outputs
...
...
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