[Feature] Transfer AR-to-diffusion payloads over NIXL (#6264)

Signed-off-by: yuanwu <yuan.wu@intel.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
Yuan WuandHongsheng Liu authored and GitHub committed 2026-09-23 18:26:53 +08:00
1 parent 8953d082c0
commit cb5f508212
60 files changed
+4397 -641

No files matched your search

@@ -1,6 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
"""MiniMax H3 text-conditioning contract."""
"""MiniMax H3 validated text and unified encoder-conditioning contracts."""
from __future__ import annotations
@@ -395,6 +395,8 @@ def _effective_audio_inputs(
max_standalone_seconds: float,
) -> list[tuple[torch.Tensor, int]]:
"""Return the waveforms exactly as the audio WVAE will consume them."""
if not math.isfinite(max_standalone_seconds) or max_standalone_seconds <= 0:
raise ValueError("max_standalone_seconds must be positive and finite")
audio_inputs = [item for item in video_audios if item is not None]
audio_inputs.extend(
(waveform[..., : int(round(max_standalone_seconds * sample_rate))], sample_rate)
@@ -683,6 +685,16 @@ def encode_media(
Every visual participant must call this function with the same references.
Component scopes allow the diffusion runner to stage one codec at a time.
"""
# Validate before the non-leader return so all participants reject bad input.
audio_inputs = _effective_audio_inputs(
media.video_audios,
media.audios,
max_standalone_seconds=float(media.num_frames) / MINIMAX_H3_FPS,
)
embedded_audio_count = sum(item is not None for item in media.video_audios)
validate_reference_audio_waveforms([item for item in media.video_audios if item is not None])
if media.audio_mode != "lock_source":
validate_reference_audio_waveforms(media.audios)
visual_rows: list[torch.Tensor] = []
visual_shapes: list[tuple[int, int, int]] = []
video_edit_clean_rows: torch.Tensor | None = None
@@ -720,12 +732,6 @@ def encode_media(
audio_lengths: list[int] = []
audio_edit_clean_rows: torch.Tensor | None = None
audio_edit_source_t = 0
embedded_audio_count = sum(item is not None for item in media.video_audios)
audio_inputs = _effective_audio_inputs(
media.video_audios,
media.audios,
max_standalone_seconds=float(media.num_frames) / MINIMAX_H3_FPS,
)
if audio_inputs or media.audio_edit is not None:
if audio_vae is None:
raise RuntimeError("MiniMax H3 audio WVAE is not resident on the encoder leader")
@@ -28,6 +28,7 @@ MINIMAX_H3_PIPELINE = PipelineConfig(
model_arch="MiniMaxH3Encoder",
engine_output_type="latent",
prompt_transform_func=f"{_PROCESSOR}.prepare_encoder_prompt",
custom_process_next_stage_input_func=f"{_PROCESSOR}.encoder2diffusion_full_payload",
sampling_constraints={
"max_tokens": 1,
"temperature": 0.0,
@@ -45,6 +46,7 @@ MINIMAX_H3_PIPELINE = PipelineConfig(
requires_multimodal_data=False,
model_arch="MiniMaxH3Pipeline",
custom_process_input_func=f"{_PROCESSOR}.encoder2diffusion",
stage_input_payload_keys=("encoder_output",),
omni_kv_config={"need_recv_cache": False},
model_path_resolver=f"{_DIFFUSION_PIPELINE}.resolve_minimax_h3_diffusion_model_path",
inline_diffusion=True,