[Model] Make the dummy-run recipe feature-neutral
Per review, the warmup recipe is a property of the model's request geometry, not of distributed layerwise offload: rename dlo_dummy_run_recipe to dummy_run_recipe and drop the DLO gate in _make_dummy_request. A model whose geometry needs recipe-specific sampling arguments warms up at startup whatever features are enabled — under DLO the generation also primes the component cache-retention budget; without it, the same warmup covers any other first-request cost. Validated both ways on L20X: DLO boot unchanged (releases stay in the startup window) and a non-DLO MiniMax-H3 boot now runs the warmup and serves normally. Signed-off-by: hsliuustc0106 <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
33297bdb9d
commit
e1c4b6153a
6 files changed
+53
-49
No files matched your search
@@ -34,9 +34,9 @@ from vllm_omni.diffusion.diffusion_kv.config import DiffusionKVCacheMode, is_sch
|
||||
from vllm_omni.diffusion.diffusion_kv.initialization import initialize_diffusion_kv_control_plane
|
||||
from vllm_omni.diffusion.executor.abstract import DiffusionExecutor
|
||||
from vllm_omni.diffusion.io_support import (
|
||||
get_dlo_dummy_run_recipe,
|
||||
get_dummy_run_num_frames,
|
||||
get_dummy_run_num_image_inputs,
|
||||
get_dummy_run_recipe,
|
||||
image_color_format,
|
||||
supports_audio_output,
|
||||
supports_multimodal_input,
|
||||
@@ -65,9 +65,9 @@ logger = init_logger(__name__)
|
||||
|
||||
_ASYNC_OUTPUT_TIMEOUT_ENV = "VLLM_OMNI_ASYNC_OUTPUT_TIMEOUT"
|
||||
_ASYNC_OUTPUT_TIMEOUT_DEFAULT = 600.0 # seconds
|
||||
# DLO warmup-recipe keys applied to the dummy request's sampling params;
|
||||
# every other recipe entry is forwarded through the request's extra_args.
|
||||
_DLO_DUMMY_RUN_SAMPLING_KEYS = frozenset({"height", "width", "num_inference_steps", "num_frames", "guidance_scale"})
|
||||
# Warmup-recipe keys applied to the dummy request's sampling params; every
|
||||
# other recipe entry is forwarded through the request's extra_args.
|
||||
_DUMMY_RUN_RECIPE_SAMPLING_KEYS = frozenset({"height", "width", "num_inference_steps", "num_frames", "guidance_scale"})
|
||||
|
||||
|
||||
def _async_output_timeout() -> float:
|
||||
@@ -1024,19 +1024,18 @@ class DiffusionEngine:
|
||||
supports_image_input, supports_audio_input = supports_multimodal_input(self.od_config)
|
||||
num_frames = get_dummy_run_num_frames(self.od_config.model_class_name, supports_audio_input)
|
||||
if num_frames <= 0:
|
||||
# The model opted out of the generic dummy run. Under distributed
|
||||
# layerwise offload, fall back to its declared warmup recipe so one
|
||||
# startup generation primes the component allocator-cache
|
||||
# retention policy ahead of real traffic. The recipe names its own
|
||||
# task, so the request stays text-only even when the model's other
|
||||
# tasks accept image or audio conditions.
|
||||
if not getattr(self.od_config, "enable_distributed_layerwise_offload", False):
|
||||
return None
|
||||
recipe = get_dlo_dummy_run_recipe(self.od_config.model_class_name)
|
||||
# The model opted out of the generic dummy run; fall back to its
|
||||
# declared warmup recipe, which supplies whatever feature-specific
|
||||
# sampling arguments the model requires (under distributed
|
||||
# layerwise offload the generation also primes the component
|
||||
# allocator-cache retention policy ahead of real traffic). The
|
||||
# recipe names its own task, so the request stays text-only even
|
||||
# when the model's other tasks accept image or audio conditions.
|
||||
recipe = get_dummy_run_recipe(self.od_config.model_class_name)
|
||||
if recipe is None:
|
||||
return None
|
||||
extra_args: dict[str, Any] = {"cfg_text_scale": 1.0, "cfg_img_scale": 1.0}
|
||||
extra_args.update({k: v for k, v in recipe.items() if k not in _DLO_DUMMY_RUN_SAMPLING_KEYS})
|
||||
extra_args.update({k: v for k, v in recipe.items() if k not in _DUMMY_RUN_RECIPE_SAMPLING_KEYS})
|
||||
return OmniDiffusionRequest(
|
||||
prompt={"prompt": "dummy run"},
|
||||
request_id=DUMMY_DIFFUSION_REQUEST_ID,
|
||||
|
||||
@@ -55,18 +55,19 @@ def get_dummy_run_num_frames(model_class_name: str, supports_audio_input: bool)
|
||||
return 2 if supports_audio_input or supports_audio_output(model_class_name) else 1
|
||||
|
||||
|
||||
def get_dlo_dummy_run_recipe(model_class_name: str) -> dict[str, Any] | None:
|
||||
"""Get the model-declared DLO startup-warmup recipe, or None.
|
||||
def get_dummy_run_recipe(model_class_name: str) -> dict[str, Any] | None:
|
||||
"""Get the model-declared startup-warmup recipe, or None.
|
||||
|
||||
Models that opt out of the generic dummy run (``dummy_run_num_frames = 0``)
|
||||
because their request geometry needs model-specific sampling arguments can
|
||||
still declare a recipe used only when distributed layerwise offload is
|
||||
enabled, where one startup generation primes the component allocator-cache
|
||||
retention policy.
|
||||
because their request geometry needs model-specific sampling arguments
|
||||
(task, duration, aspect ratio, ...) declare a recipe instead. The recipe
|
||||
is feature-neutral: the engine runs it at startup whatever features are
|
||||
enabled — under distributed layerwise offload the generation also primes
|
||||
the component allocator-cache retention policy's observed-peak budget.
|
||||
"""
|
||||
|
||||
model_cls = DiffusionModelRegistry._try_load_model_cls(model_class_name)
|
||||
recipe = getattr(model_cls, "dlo_dummy_run_recipe", None) if model_cls is not None else None
|
||||
recipe = getattr(model_cls, "dummy_run_recipe", None) if model_cls is not None else None
|
||||
return dict(recipe) if recipe else None
|
||||
|
||||
|
||||
|
||||
@@ -704,14 +704,14 @@ class MiniMaxH3Pipeline(
|
||||
"post_decode",
|
||||
]
|
||||
dummy_run_num_frames: ClassVar[int] = 0
|
||||
# Startup warmup used only when distributed layerwise offload is enabled:
|
||||
# the generic dummy run cannot satisfy t2va's required sampling arguments
|
||||
# (explicit aspect ratio, bounded duration). Duration is the only workload
|
||||
# variable at the fixed 768 short edge, so warming at the maximum makes the
|
||||
# learned cache-retention peak dominate every production request and moves
|
||||
# all cold-start flushes ahead of real traffic, at the cost of one
|
||||
# max-length generation in boot time.
|
||||
dlo_dummy_run_recipe: ClassVar[Mapping[str, Any] | None] = {
|
||||
# Startup warmup recipe: the generic dummy run cannot satisfy t2va's
|
||||
# required sampling arguments (explicit aspect ratio, bounded duration).
|
||||
# Duration is the only workload variable at the fixed 768 short edge, so
|
||||
# warming at the maximum covers every production request — under DLO this
|
||||
# makes the learned cache-retention peak dominate, moving all cold-start
|
||||
# flushes ahead of real traffic. The cost is one max-length generation in
|
||||
# boot time whatever features are enabled.
|
||||
dummy_run_recipe: ClassVar[Mapping[str, Any] | None] = {
|
||||
"task": "t2va",
|
||||
"duration": MINIMAX_H3_MAX_OUTPUT_SECONDS,
|
||||
"aspect_ratio": "16:9",
|
||||
|
||||
Reference in new issue
Block a user