[Feat][sleepmode] add omni sleepmode and ack protocol (#2022)

This commit is contained in:
Vensen authored and GitHub committed 2026-04-21 08:19:53 +08:00
1 parent 618268d6b9
commit e076378df1
19 files changed
+1498 -105

No files matched your search

+42
View File
@@ -353,6 +353,8 @@ class DiffusionCacheConfig:
@dataclass
class OmniDiffusionConfig:
# Model and path configuration (for convenience)
stage_id: int = 0
model: str | None = None
model_class_name: str | None = None
@@ -508,6 +510,8 @@ class OmniDiffusionConfig:
# Step mode settings
step_execution: bool = False
# sleep mode
enable_sleep_mode: bool = False
# Maximum number of sequences to generate in a batch
max_num_seqs: int = 1
@@ -797,5 +801,43 @@ class AttentionBackendEnum(enum.Enum):
return self.name.lower()
@dataclass
class OmniACK:
"""
Handshake payload from Workers to Orchestrator.
"""
task_id: str
status: str
stage_id: int | None = None
rank: int | None = None
freed_bytes: int = 0
metadata: dict[str, Any] = field(default_factory=dict)
"""
Additional telemetry such as:
- max_contiguous_block: for fragmentation analysis.
- cuda_graph_recalled: boolean if graphs were successfully destroyed/rebuilt.
- latency_ms: time taken for the D2H/H2D transfer.
"""
error_msg: str | None = None
@dataclass
class OmniSleepTask:
"""Structured sleep instruction."""
task_id: str
level: int = 2
metadata: dict[str, Any] = field(default_factory=dict)
@dataclass
class OmniWakeTask:
"""Structured wake-up instruction."""
task_id: str
tags: list[str] | None = None
# Special message broadcast via scheduler queues to signal worker shutdown.
SHUTDOWN_MESSAGE = {"type": "shutdown"}