vllm_omni.diffusion.cache.stepcache ¶
StepCache: velocity-based step skipping for DreamZero-style DiT denoising.
Unlike block-level Cache-DiT, this backend skips entire DiT forwards during the pipeline denoise loop when successive velocity predictions are highly aligned.
Usage
from vllm_omni import Omni
omni = Omni( model="...", cache_backend="step_cache", )
Alternative: environment variable¶
export DIFFUSION_CACHE_BACKEND=step_cache¶
Modules:
| Name | Description |
|---|---|
backend | StepCache backend implementation. |
config | Configuration for step-level DiT velocity caching. |
state | Mutable state for step-level DiT velocity caching. |
CUSTOM_STEPCACHE_ENABLERS module-attribute ¶
CUSTOM_STEPCACHE_ENABLERS = {
"DreamZeroPipeline": enable_dreamzero_stepcache
}
CUSTOM_STEP_CACHE_DIT_ENABLERS module-attribute ¶
CUSTOM_STEP_CACHE_DIT_ENABLERS = CUSTOM_STEPCACHE_ENABLERS
enable_dreamzero_step_cache_dit module-attribute ¶
enable_dreamzero_step_cache_dit = enable_dreamzero_stepcache
StepCacheBackend ¶
Bases: CacheBackend
Velocity cosine step-skipping cache backend for DreamZero.
Attaches :class:StepCacheConfig and :class:StepCacheState to supported pipelines. The denoise loop calls :meth:StepCacheState.should_run_step to decide whether to run predict_noise.
Example
from vllm_omni.diffusion.data import DiffusionCacheConfig backend = StepCacheBackend(DiffusionCacheConfig()) backend.enable(pipeline) backend.refresh(pipeline, num_inference_steps=16)
StepCacheConfig dataclass ¶
Runtime config for velocity-based step skipping.
Skips entire DiT forwards when successive video velocity predictions are highly aligned (cosine similarity above configured thresholds).
Reference: DreamZero paper DiT Caching / dreamzero.git should_run_model.
sim_thresholds class-attribute instance-attribute ¶
from_diffusion_cache_config classmethod ¶
from_diffusion_cache_config(
config: DiffusionCacheConfig,
) -> StepCacheConfig
StepCacheState ¶
Per-generation mutable state (skip countdown).
should_run_step ¶
Return True when the DiT forward should execute at this scheduler step.
enable_dreamzero_stepcache ¶
enable_dreamzero_stepcache(
pipeline: Any, config: DiffusionCacheConfig
) -> None
Enable stepcache for DreamZeroPipeline.