[NPU][Diffusion] MiniMax-H3 RainFusion end_step tail fallback (#6037)

Signed-off-by: HAAZZZEEEE <wang-taicheng@qq.com>
This commit is contained in:
HAAZZZEEEE authored and GitHub committed 2026-08-29 18:36:05 +08:00
1 parent a5b8c82788
commit c50b7de167
8 files changed
+243 -14

No files matched your search

+17
View File
@@ -1,3 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
from __future__ import annotations
from contextlib import contextmanager
@@ -34,6 +37,7 @@ class ForwardContext:
split_text_embed_in_sp: bool = False
denoise_step_idx: int | None = None
denoise_timestep: float | None = None
total_denoise_steps: int | None = None
# Per-request reference latent for img2img DiT models (e.g. Ming)
ref_latent: torch.Tensor | None = None
# whether to split the text embed in sequence parallel, if True, the text embed will be split in sequence parallel
@@ -255,6 +259,16 @@ def set_forward_context_denoise_timestep(timestep: float | None) -> None:
_forward_context.denoise_timestep = None if timestep is None else float(timestep)
def set_forward_context_denoise_total_steps(total_steps: int | None) -> None:
"""Set the total denoise step count on the active ForwardContext.
Denoise loops publish it so tail-fallback gates (e.g. ``end_step`` in
RAINFUSION_ATTN) know when the final denoise steps begin.
"""
if _forward_context is not None:
_forward_context.total_denoise_steps = total_steps
class DenoiseProgressMixin:
def record_denoise_step(
self,
@@ -262,8 +276,11 @@ class DenoiseProgressMixin:
timestep=None,
scheduler=None,
normalized_timestep: float | None = None,
total_steps: int | None = None,
) -> None:
set_forward_context_denoise_step_idx(step_idx)
if _forward_context is not None:
_forward_context.total_denoise_steps = total_steps
if _forward_context is None:
return
if normalized_timestep is not None: