Skip to content

vllm_omni.diffusion.cache.magcache.state

MagCache state management.

This module contains the MagCacheState class which manages the internal state for MagCache caching logic, including residuals, accumulated metrics, and step tracking.

MagCacheState

State management for MagCache caching logic.

accumulated_err instance-attribute

accumulated_err: float = 0.0

accumulated_ratio instance-attribute

accumulated_ratio: float = 1.0

accumulated_steps instance-attribute

accumulated_steps: int = 0

calibration_ratios instance-attribute

calibration_ratios: list[float] = []

cos_dises instance-attribute

cos_dises: list[float] = []

head_block_input instance-attribute

head_block_input: Tensor | tuple[Tensor, Tensor] | None = (
    None
)

norm_ratios instance-attribute

norm_ratios: list[float] = []

norm_stds instance-attribute

norm_stds: list[float] = []

previous_residual instance-attribute

previous_residual: Tensor | tuple[Tensor, Tensor] | None = (
    None
)

should_compute instance-attribute

should_compute: bool = True

step_index instance-attribute

step_index: int = 0

reset

reset() -> None

Reset all state variables for a new inference run.