[Rebase] Rebase to vllm 0.27.0 (#5976)

Signed-off-by: tzhouam <tzhouam@connect.ust.hk>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Zhou TaichangandClaude Opus 5 authored and GitHub committed 2026-08-11 15:23:46 +00:00
1 parent 584d78c673
commit 2ce15ab7a0
55 files changed
+1335 -93

No files matched your search

@@ -36,6 +36,22 @@ from vllm_omni.platforms import current_omni_platform
logger = logging.getLogger(__name__)
# Preference chain for CUDA flash attention in diffusers, best first. Shared
# with the accuracy tests' diffusers reference runs so both sides of a
# similarity comparison resolve to the same backend on any given image
# (hub kernels may lack a build variant for the image's torch).
CUDA_FLASH_ATTENTION_BACKEND_ATTEMPTS: list[str] = [
"_flash_3_hub",
"_flash_3_varlen_hub",
"_flash_3",
"_flash_varlen_3",
"flash_hub",
"flash_varlen_hub",
"flash",
"flash_varlen",
"_native_flash",
]
_DIFFUSERS_CONFIG_LOAD_KWARGS = {
"cache_dir",
"dduf_entries",
@@ -279,19 +295,7 @@ class DiffusersAdapterPipeline(nn.Module, DiffusionPipelineProfilerMixin):
)
attention_backend_attempts.append("native")
else:
attention_backend_attempts.extend(
[
"_flash_3_hub",
"_flash_3_varlen_hub",
"_flash_3",
"_flash_varlen_3",
"flash_hub",
"flash_varlen_hub",
"flash",
"flash_varlen",
"_native_flash",
]
)
attention_backend_attempts.extend(CUDA_FLASH_ATTENTION_BACKEND_ATTEMPTS)
case "SAGE_ATTN":
attention_backend_attempts.extend(["sage_hub", "sage", "sage", "sage_varlen"])
case "ASCEND":
@@ -299,16 +299,21 @@ def resolve_lingbot_output_dimensions(
sampling_width: Any = None,
sampling_height: Any = None,
prompt_fields: Mapping[str, Any] | None = None,
extra_fields: Mapping[str, Any] | None = None,
default_width: int = 480,
default_height: int = 480,
) -> tuple[int, int]:
"""Resolve the ``(width, height)`` that LingBot will use for generation."""
prompt_fields = prompt_fields or {}
requested_width = _pick(prompt_fields, "width")
requested_height = _pick(prompt_fields, "height")
size = _pick(prompt_fields, "size")
resolution = _pick(prompt_fields, "resolution")
ratio = _pick(prompt_fields, "ratio")
extra_fields = extra_fields or {}
# Online requests deliver `extra_params` through sampling.extra_args; the
# offline path embeds the same fields in the prompt dict. Consult both,
# extra_args first — the same precedence fps and num_frames use.
requested_width = _first_not_none(_pick(extra_fields, "width"), _pick(prompt_fields, "width"))
requested_height = _first_not_none(_pick(extra_fields, "height"), _pick(prompt_fields, "height"))
size = _first_not_none(_pick(extra_fields, "size"), _pick(prompt_fields, "size"))
resolution = _first_not_none(_pick(extra_fields, "resolution"), _pick(prompt_fields, "resolution"))
ratio = _first_not_none(_pick(extra_fields, "ratio"), _pick(prompt_fields, "ratio"))
if requested_width is not None or requested_height is not None:
width, height = requested_width, requested_height
elif size is not None or resolution is not None or ratio is not None:
@@ -414,6 +419,7 @@ def normalize_lingbot_request(
sampling_width=sampling.width,
sampling_height=sampling.height,
prompt_fields=prompt_fields,
extra_fields=extra_args,
default_width=default_width,
default_height=default_height,
)