Skip to content

Commit acb0d2f

Browse files
jikunshangmzusman
authored andcommitted
[V1] Add RayExecutor support for AsyncLLM (api server) (vllm-project#11712)
1 parent 6770681 commit acb0d2f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

vllm/v1/engine/async_llm.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from vllm.v1.engine.detokenizer import Detokenizer
2323
from vllm.v1.engine.processor import Processor
2424
from vllm.v1.executor.abstract import Executor
25+
from vllm.v1.executor.ray_utils import initialize_ray_cluster
2526

2627
logger = init_logger(__name__)
2728

@@ -131,7 +132,11 @@ def _get_executor_cls(cls, vllm_config: VllmConfig) -> Type[Executor]:
131132
executor_class: Type[Executor]
132133
distributed_executor_backend = (
133134
vllm_config.parallel_config.distributed_executor_backend)
134-
if distributed_executor_backend == "mp":
135+
if distributed_executor_backend == "ray":
136+
initialize_ray_cluster(vllm_config.parallel_config)
137+
from vllm.v1.executor.ray_executor import RayExecutor
138+
executor_class = RayExecutor
139+
elif distributed_executor_backend == "mp":
135140
from vllm.v1.executor.multiproc_executor import MultiprocExecutor
136141
executor_class = MultiprocExecutor
137142
else:

0 commit comments

Comments
 (0)