[Bugfix][Diffusion] Fix MiniMax-H3 model-level CPU offload residency (#6072)

Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
This commit is contained in:
R0CKSTAR authored and GitHub committed 2026-08-21 10:30:53 +00:00
1 parent 4f7c08c0eb
commit 260db8bab5
7 files changed
+553 -102

No files matched your search

+21
View File
@@ -4,6 +4,7 @@
from abc import ABC, abstractmethod
from dataclasses import dataclass
from enum import Enum
from typing import Protocol, runtime_checkable
import torch
from torch import nn
@@ -14,6 +15,26 @@ from vllm_omni.diffusion.data import OmniDiffusionConfig
logger = init_logger(__name__)
@runtime_checkable
class SupportsModelCpuOffload(Protocol):
"""Pipeline-owned lifecycle for model-level CPU offload.
Pipelines with non-forward component entry points (for example VAE
``decode_latent`` methods) need to activate those stages explicitly, so
generic forward-hook discovery cannot manage their full lifecycle.
"""
def enable_omni_model_cpu_offload(
self,
*,
device: torch.device,
pin_memory: bool,
use_hsdp: bool,
) -> None: ...
def disable_omni_model_cpu_offload(self) -> None: ...
class OffloadStrategy(Enum):
NONE = "none"
MODEL_LEVEL = "model_level" # Sequential offloading between DiT and encoders