vllm_omni.diffusion.offloader.base ¶
OffloadBackend ¶
Bases: ABC
Base class for CPU offload backends
disable abstractmethod ¶
Disable offloading and cleanup resources.
Removes all registered hooks. Does NOT move modules back to original devices (caller responsible for that).
enable abstractmethod ¶
Enable offloading on the pipeline.
Discovers modules, moves them to appropriate devices, and registers forward hooks for swapping/prefetching.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline | Module | Diffusion pipeline model (e.g., Wan22Pipeline) | required |
OffloadConfig dataclass ¶
from_od_config classmethod ¶
from_od_config(
od_config: OmniDiffusionConfig,
) -> OffloadConfig
Extract and validate offload settings from OmniDiffusionConfig.
For now, enforces mutual exclusion between model-level and layer-wise offloading. Layer-wise takes priority if both are enabled.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
od_config | OmniDiffusionConfig | OmniDiffusionConfig with offload settings | required |
Returns:
| Type | Description |
|---|---|
OffloadConfig | OffloadConfig with validated settings |