[Rebase] Rebase to vllm v0.19.0 (#2475)

This commit is contained in:
Zhou Taichang authored and GitHub committed 2026-04-04 15:03:32 +08:00
1 parent 4c031580cf
commit 2804a85e58
52 files changed
+437 -142

No files matched your search

@@ -32,7 +32,9 @@ if current_omni_platform.is_rocm():
pass
elif current_omni_platform.is_xpu():
try:
from vllm.v1.attention.backends.fa_utils import flash_attn_varlen_func # noqa: F401
from vllm._xpu_ops import xpu_ops # noqa: F401
flash_attn_varlen_func = xpu_ops.flash_attn_varlen_func
except (ImportError, ModuleNotFoundError):
pass
elif current_omni_platform.is_musa():
+2 -2
View File
@@ -361,8 +361,8 @@ class DiffusionEngine:
def _dummy_run(self):
"""A dummy run to warm up the model."""
num_inference_steps = 1
height = 1024
width = 1024
height = 512
width = 512
if supports_image_input(self.od_config.model_class_name):
# Provide a dummy image input if the model supports it
color_format = image_color_format(self.od_config.model_class_name)
+14 -1
View File
@@ -244,7 +244,20 @@ class StageDiffusionClient:
return self._output_queue.get_nowait()
except asyncio.QueueEmpty:
if not self._shutting_down and self._proc is not None and not self._proc.is_alive():
raise RuntimeError(f"StageDiffusionProc died unexpectedly (exit code {self._proc.exitcode})")
exitcode = self._proc.exitcode
# One final drain – the last ZMQ frame may have arrived
# between the first drain and the is_alive() check.
self._drain_responses()
try:
return self._output_queue.get_nowait()
except asyncio.QueueEmpty:
pass
if exitcode is not None and exitcode > 128:
sig = exitcode - 128
logger.warning("StageDiffusionProc was killed by signal %d; treating as external shutdown.", sig)
self._shutting_down = True
return None
raise RuntimeError(f"StageDiffusionProc died unexpectedly (exit code {exitcode})")
return None
async def abort_requests_async(self, request_ids: list[str]) -> None:
+1 -1
View File
@@ -495,7 +495,7 @@ class StageDiffusionProc:
nonlocal shutdown_requested
if not shutdown_requested:
shutdown_requested = True
raise SystemExit()
raise SystemExit(128 + signum)
signal.signal(signal.SIGTERM, signal_handler)
signal.signal(signal.SIGINT, signal_handler)
@@ -17,7 +17,7 @@ from typing import Any
import torch
import zmq
from vllm.config import CompilationConfig, VllmConfig, set_current_vllm_config
from vllm.config import CompilationConfig, DeviceConfig, VllmConfig, set_current_vllm_config
from vllm.distributed.device_communicators.shm_broadcast import MessageQueue
from vllm.logger import init_logger
from vllm.utils.import_utils import resolve_obj_by_qualname
@@ -113,8 +113,12 @@ class DiffusionWorker:
self.device = current_omni_platform.get_torch_device(rank)
current_omni_platform.set_device(self.device)
# Create vllm_config for parallel configuration
vllm_config = VllmConfig(compilation_config=CompilationConfig())
# Create vllm_config for parallel configuration. Pass explicit device_config
# so DeviceConfig does not rely on current_platform in worker subprocesses.
vllm_config = VllmConfig(
compilation_config=CompilationConfig(),
device_config=DeviceConfig(device=self.device),
)
vllm_config.parallel_config.tensor_parallel_size = self.od_config.parallel_config.tensor_parallel_size
vllm_config.parallel_config.data_parallel_size = self.od_config.parallel_config.data_parallel_size
vllm_config.parallel_config.enable_expert_parallel = self.od_config.parallel_config.enable_expert_parallel