[Core][Refactor][Diffusion] refactor request scheduler's admission wait policy (#5843)
Signed-off-by: Huang, Zeyu <11222265+fhfuih@users.noreply.github.com> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
c588208cc6
commit
33dd9a5a3e
13 files changed
+253
-54
No files matched your search
@@ -7,6 +7,7 @@ diffusion models (e.g., Qwen-Image) through the same CLI interface.
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import math
|
||||
import os
|
||||
import signal
|
||||
from types import FrameType
|
||||
@@ -43,6 +44,17 @@ Search by using: `--help=<ConfigGroup>` to explore options by section (e.g.,
|
||||
"""
|
||||
|
||||
|
||||
def _nonneg_finite_float(value: str) -> float:
|
||||
"""Argparse type for finite, non-negative floats (rejects nan/inf)."""
|
||||
try:
|
||||
parsed = float(value)
|
||||
except ValueError as exc:
|
||||
raise argparse.ArgumentTypeError(f"invalid float value: {value!r}") from exc
|
||||
if not math.isfinite(parsed) or parsed < 0:
|
||||
raise argparse.ArgumentTypeError(f"must be a finite non-negative number, got {value!r}")
|
||||
return parsed
|
||||
|
||||
|
||||
def _ensure_vllm_platform():
|
||||
"""Ensure vLLM's current_platform is valid before arg parsing.
|
||||
|
||||
@@ -599,7 +611,7 @@ class OmniServeCommand(CLISubcommand):
|
||||
)
|
||||
omni_config_group.add_argument(
|
||||
"--request-batch-max-wait-ms",
|
||||
type=float,
|
||||
type=_nonneg_finite_float,
|
||||
default=0.0,
|
||||
help="Request-mode batch admission: max milliseconds to wait for compatible "
|
||||
"requests to accumulate before scheduling a fused forward wave. "
|
||||
|
||||
@@ -31,16 +31,7 @@ TTS_ADAPTER_REGISTRY: dict[str, type[TTSModelAdapter]] = {}
|
||||
|
||||
#: Model types the serving layer detects that have no adapter yet. See
|
||||
#: :class:`LegacyDetector`. This list must only ever shrink.
|
||||
LEGACY_TTS_DETECTORS: tuple[LegacyDetector, ...] = (
|
||||
# Ming *flash-omni* claims the ``ming_tts`` stage key, while Ming *dense*
|
||||
# (which does have an adapter) is identified by architecture. The stage key
|
||||
# must therefore be tested first, hence the explicit priority.
|
||||
LegacyDetector(
|
||||
name="ming_flash_omni_tts",
|
||||
stage_keys=frozenset({"ming_tts"}),
|
||||
detect_priority=50,
|
||||
),
|
||||
)
|
||||
LEGACY_TTS_DETECTORS: tuple[LegacyDetector, ...] = ()
|
||||
|
||||
|
||||
def register_tts_adapter(cls: type[TTSModelAdapter]) -> type[TTSModelAdapter]:
|
||||
|
||||
Reference in new issue
Block a user