vllm_omni.diffusion.cache.teacache.coefficient_estimator ¶
BagelAdapter ¶
DataCollectionHook ¶
Bases: ModelHook
Hook to collect modulated inputs and model outputs for TeaCache coefficient estimation.
DefaultAdapter ¶
Default adapter for standard diffusers pipelines.
Flux2Adapter ¶
LongCatAdapter ¶
Bases: DefaultAdapter
Adapter for LongCat Image - NOTE: currently this model needs the vLLM context to be correctly configured to actually run the estimation, since it uses vLLM norm layers etc.
StableAudioAdapter ¶
TeaCacheCoefficientEstimator ¶
Model-agnostic helper class to collect data and estimate TeaCache coefficients.
estimate ¶
Estimate polynomial coefficients from collected data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
poly_order | int | Order of polynomial fit (default: 4) | 4 |
Returns:
| Type | Description |
|---|---|
list[float] | List of polynomial coefficients [a_n, a_{n-1}, ..., a_1, a_0] |
Raises:
| Type | Description |
|---|---|
RuntimeError | If no data has been collected |
calculate_relative_l1 ¶
Calculate relative L1 distance (Eq. 4 from TeaCache paper).