[Feature] DP supervisor using rust frontend (#47076)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import uvicorn
|
||||
import uvloop
|
||||
from fastapi import FastAPI, Response
|
||||
|
||||
import vllm.envs as envs
|
||||
from vllm.logger import init_logger
|
||||
from vllm.utils.system_utils import (
|
||||
decorate_logs,
|
||||
@@ -233,12 +234,22 @@ def _build_dp_supervisor_app(supervisor: DPSupervisor) -> FastAPI:
|
||||
return app
|
||||
|
||||
|
||||
def _run_python_vllm_dp_server(child_args: argparse.Namespace) -> None:
|
||||
from vllm.entrypoints.openai.api_server import run_server
|
||||
|
||||
uvloop.run(run_server(child_args))
|
||||
|
||||
|
||||
def _run_rust_vllm_dp_server(child_args: argparse.Namespace) -> None:
|
||||
from vllm.entrypoints.cli.serve import run_multi_api_server
|
||||
|
||||
run_multi_api_server(child_args)
|
||||
|
||||
|
||||
def _run_vllm_dp_server(child_args: argparse.Namespace) -> None:
|
||||
"""
|
||||
Entrypoint function for the vLLM DP Server.
|
||||
"""
|
||||
from vllm.entrypoints.openai.api_server import run_server
|
||||
|
||||
# Create a fresh process group for the vLLM DP Server,
|
||||
# so that CTRL-C is propagated cleanly.
|
||||
os.setpgrp()
|
||||
@@ -246,7 +257,10 @@ def _run_vllm_dp_server(child_args: argparse.Namespace) -> None:
|
||||
name = f"APIServer_DP{child_args.data_parallel_rank}"
|
||||
set_process_title(name)
|
||||
decorate_logs(name)
|
||||
uvloop.run(run_server(child_args))
|
||||
if envs.VLLM_RUST_FRONTEND_PATH:
|
||||
_run_rust_vllm_dp_server(child_args)
|
||||
else:
|
||||
_run_python_vllm_dp_server(child_args)
|
||||
|
||||
|
||||
class DPSupervisor:
|
||||
|
||||
Reference in New Issue
Block a user