vllm_omni.diffusion.cache.cachedit ¶
Public API for the Cache-DiT diffusion cache backend.
Modules:
| Name | Description |
|---|---|
backend | Generic Cache-DiT backend lifecycle and integration. |
config | Configuration types and conversion helpers for Cache-DiT. |
model_specific | Model-specific Cache-DiT adapters and enablers. |
runtime | Declarative request-scoped Cache-DiT lifecycle. |
BagelCachedAdapter ¶
Bases: CachedAdapter
Custom CachedAdapter for Bagel that uses BagelCachedContextManager and BagelCachedBlocks.
CacheDiTAdapterConfig dataclass ¶
CacheDiTBackend ¶
Bases: CacheBackend
Manage Cache-DiT through the common diffusion cache lifecycle.
disable ¶
disable(pipeline: SupportsComponentDiscovery) -> None
Remove Cache-DiT hooks so later requests use native forwards.
refresh ¶
refresh(
pipeline: SupportsComponentDiscovery,
num_inference_steps: int,
verbose: bool = True,
) -> None
CacheDiTConfig dataclass ¶
Cache-DiT-specific projection of the shared diffusion cache config.
force_refresh_step_hint class-attribute instance-attribute ¶
force_refresh_step_hint: int | None = None
force_refresh_step_policy class-attribute instance-attribute ¶
force_refresh_step_policy: str = 'once'
max_continuous_cached_steps class-attribute instance-attribute ¶
max_continuous_cached_steps: int = 3
from_diffusion_config classmethod ¶
from_diffusion_config(
config: DiffusionCacheConfig,
) -> CacheDiTConfig
Project the shared config onto fields consumed by Cache-DiT.
to_calibrator_config ¶
Build the optional TaylorSeer calibrator configuration.
to_db_cache_config ¶
Build the third-party cache configuration used during installation.
CacheDiTEnableResult dataclass ¶
Custom-enabler result with the exact targets needed for teardown.
CacheDiTRequestSpec dataclass ¶
Desired Cache-DiT state for one request.
installation_key identifies configurations that require reinstalling hooks when switching between them. Step-count changes only require a context refresh.
RequestScopedCacheDiTRuntime ¶
Reconcile declarative request state with installed Cache-DiT hooks.
adopt ¶
adopt(
backend: CacheDiTBackend, *, installation_key: str
) -> None
Assume ownership of an already-enabled startup backend.
prepare ¶
prepare(spec: CacheDiTRequestSpec | None) -> None
Apply the minimal transition needed before the request denoise.
None disables installed hooks. An unchanged installation key only refreshes request context; a changed key disables the previous hooks before installing the requested profile.
SensenovaCachedAdapter ¶
cache_summary ¶
cache_summary(
pipeline: SupportsComponentDiscovery,
details: bool = True,
) -> None
Log Cache-DiT statistics for every transformer on the pipeline.
enable_cache_for_dit ¶
enable_cache_for_dit(
pipeline: SupportsComponentDiscovery,
cache_config: DiffusionCacheConfig,
block_adapter: BlockAdapter | None = None,
adapter_cls: type[CachedAdapter] | None = None,
get_pipeline_transformer: Callable[
[SupportsComponentDiscovery], Module
] = _default_get_pipeline_transformer,
) -> RefreshCacheContextFunc
Enable Cache-DiT for a standard single-transformer DiT pipeline.