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
0229c386
Unverified
Commit
0229c386
authored
Nov 29, 2023
by
FlorianJoncour
Committed by
GitHub
Nov 29, 2023
Browse files
Better integration with Ray Serve (#1821)
Co-authored-by:
FlorianJoncour
<
florian@zetta-sys.com
>
parent
a7b3e330
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
vllm/engine/llm_engine.py
vllm/engine/llm_engine.py
+3
-3
vllm/engine/ray_utils.py
vllm/engine/ray_utils.py
+2
-2
No files found.
vllm/engine/llm_engine.py
View file @
0229c386
...
@@ -7,7 +7,7 @@ from vllm.config import (CacheConfig, ModelConfig, ParallelConfig,
...
@@ -7,7 +7,7 @@ from vllm.config import (CacheConfig, ModelConfig, ParallelConfig,
SchedulerConfig
)
SchedulerConfig
)
from
vllm.core.scheduler
import
Scheduler
,
SchedulerOutputs
from
vllm.core.scheduler
import
Scheduler
,
SchedulerOutputs
from
vllm.engine.arg_utils
import
EngineArgs
from
vllm.engine.arg_utils
import
EngineArgs
from
vllm.engine.ray_utils
import
RayWorker
,
initialize_cluster
,
ray
from
vllm.engine.ray_utils
import
RayWorker
Vllm
,
initialize_cluster
,
ray
from
vllm.logger
import
init_logger
from
vllm.logger
import
init_logger
from
vllm.outputs
import
RequestOutput
from
vllm.outputs
import
RequestOutput
from
vllm.sampling_params
import
SamplingParams
from
vllm.sampling_params
import
SamplingParams
...
@@ -162,12 +162,12 @@ class LLMEngine:
...
@@ -162,12 +162,12 @@ class LLMEngine:
continue
continue
worker
=
ray
.
remote
(
worker
=
ray
.
remote
(
num_cpus
=
0
,
num_cpus
=
0
,
num_gpus
=
1
,
num_gpus
=
self
.
cache_config
.
gpu_memory_utilization
,
scheduling_strategy
=
PlacementGroupSchedulingStrategy
(
scheduling_strategy
=
PlacementGroupSchedulingStrategy
(
placement_group
=
placement_group
,
placement_group
=
placement_group
,
placement_group_capture_child_tasks
=
True
),
placement_group_capture_child_tasks
=
True
),
**
ray_remote_kwargs
,
**
ray_remote_kwargs
,
)(
RayWorker
).
remote
(
self
.
model_config
.
trust_remote_code
)
)(
RayWorker
Vllm
).
remote
(
self
.
model_config
.
trust_remote_code
)
self
.
workers
.
append
(
worker
)
self
.
workers
.
append
(
worker
)
# Initialize torch distributed process group for the workers.
# Initialize torch distributed process group for the workers.
...
...
vllm/engine/ray_utils.py
View file @
0229c386
...
@@ -10,7 +10,7 @@ try:
...
@@ -10,7 +10,7 @@ try:
import
ray
import
ray
from
ray.air.util.torch_dist
import
TorchDistributedWorker
from
ray.air.util.torch_dist
import
TorchDistributedWorker
class
RayWorker
(
TorchDistributedWorker
):
class
RayWorker
Vllm
(
TorchDistributedWorker
):
"""Ray wrapper for vllm.worker.Worker, allowing Worker to be
"""Ray wrapper for vllm.worker.Worker, allowing Worker to be
lazliy initialized after Ray sets CUDA_VISIBLE_DEVICES."""
lazliy initialized after Ray sets CUDA_VISIBLE_DEVICES."""
...
@@ -36,7 +36,7 @@ except ImportError as e:
...
@@ -36,7 +36,7 @@ except ImportError as e:
"`pip install ray pandas pyarrow`."
)
"`pip install ray pandas pyarrow`."
)
ray
=
None
ray
=
None
TorchDistributedWorker
=
None
TorchDistributedWorker
=
None
RayWorker
=
None
RayWorker
Vllm
=
None
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
from
ray.util.placement_group
import
PlacementGroup
from
ray.util.placement_group
import
PlacementGroup
...
...
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