[Feat] Support step-boundary abort in diffusion (#1769)

Signed-off-by: jader <yjader@foxmail.com>
Signed-off-by: asukaqaq-s <1311722138@qq.com>
Co-authored-by: jader <yjader@foxmail.com>
This commit is contained in:
Wu JIAZHENandjader authored and GitHub committed 2026-04-01 17:25:02 +08:00
1 parent d40840b114
commit 3fd4a4dc27
23 files changed
+1379 -192

No files matched your search

+9
View File
@@ -492,6 +492,9 @@ class OmniDiffusionConfig:
# Step mode settings
step_execution: bool = False
# Maximum number of sequences to generate in a batch
max_num_seqs: int = 1
@property
def is_moe(self) -> bool:
num_experts = self.tf_model_config.get("num_experts", None)
@@ -658,6 +661,8 @@ class DiffusionOutput:
trajectory_latents: torch.Tensor | None = None
trajectory_decoded: list[torch.Tensor] | None = None
error: str | None = None
aborted: bool = False
abort_message: str | None = None
post_process_func: Callable[..., Any] | None = None
@@ -675,6 +680,10 @@ class DiffusionOutput:
peak_memory_mb: float = 0.0
class DiffusionRequestAbortedError(RuntimeError):
"""Raised when a diffusion request ends via user-visible abort."""
class AttentionBackendEnum(enum.Enum):
FA = enum.auto()
SLIDING_TILE_ATTN = enum.auto()