Skip to content

Add ChebyshevCacheConfig extrapolation cache hook to enable_cache - #33

Open
remyx-ai[bot] wants to merge 2 commits into
mainfrom
chebbooster-a-training-free-approach-for-efficient-diffusion-v2
Open

Add ChebyshevCacheConfig extrapolation cache hook to enable_cache#33
remyx-ai[bot] wants to merge 2 commits into
mainfrom
chebbooster-a-training-free-approach-for-efficient-diffusion-v2

Conversation

@remyx-ai

@remyx-ai remyx-ai Bot commented Sep 11, 2026

Copy link
Copy Markdown

What does this PR do?

Adds a new training-free ChebyshevCacheConfig + apply_chebyshev_cache cache hook that reuses expensive DiT module outputs across denoising steps by evaluating a barycentric interpolant with Chebyshev-Lobatto weights. This is the paper's central mechanism: it replaces Taylor-series reuse (TaylorSeer) with a barycentric Chebyshev weighting that stays numerically stable as extrapolation order grows, avoiding the Runge oscillations Taylor-based reuse suffers over long cache intervals.

Key details:

  • Call site: CacheMixin.enable_cache (src/diffusers/models/cache_utils.py) dispatches to apply_chebyshev_cache via a new elif isinstance(config, ChebyshevCacheConfig) branch (mirroring TaylorSeer/MagCache/FasterCache), and disable_cache removes the registered _CHEBYSHEV_CACHE_HOOK. Any DiT/UNet transformer exposing enable_cache(config) can invoke it exactly like the existing cache hooks.
  • Offline/online decoupling: barycentric weights depend only on node count and are precomputed once (chebyshev_barycentric_weights), then applied cheaply per prediction step via the second barycentric form.
  • Scheduling: warmup (disable_cache_before_step), cooldown (disable_cache_after_step), and periodic full-compute refresh (cache_interval), plus a skip_predict_identifiers zero-tensor 'skip' mode for the FLOPs-reduction angle.
  • Public API: ChebyshevCacheConfig (and apply_chebyshev_cache) are exported from src/diffusers/__init__.py, making from diffusers import ChebyshevCacheConfig importable by external users; backed by dummy objects and a test file.

Intentionally out of scope:

  • True Chebyshev-Lobatto node sampling of denoising timesteps — the hook uses the model's actual (roughly equispaced) compute-step indices as interpolation nodes rather than resampling onto Chebyshev-Gauss-Lobatto abscissae. Only the barycentric weights are Chebyshev-derived.
  • The paper's reported quantitative validation (up to 3.68x latency / 5.12x FLOPs, FID across DiT-XL/2, PixArt-Σ, FLUX.1-dev) — no benchmark harness or trained-model evaluation is shipped (requires GPU model weights and a latency/FID pipeline the repo does not host in unit tests).
  • Per-model default identifier tuning / recommended configs — left to the caller via cache_identifiers/skip_predict_identifiers, defaulting to generic attention-block regexes.

Test results: Tests could not run in CI — the runner lacks this repo's dependencies (a collection/import error, not a code failure): ModuleNotFoundError: No module named 'accelerate' while importing examples/test_examples_utils.py. Run the suite locally to validate.

Before submitting

Who can review?

@sayakpaul @DN6 @yiyixuxu

Drafted by Outrider — paper: arXiv:2608.23429v1.

Discovery context

Drafted by an autonomous discovery loop — Remyx ranks recent arXiv papers against this team's research interest and shipping history; Claude Code selects the candidate most directly implementable against this repo from the lookback window and drafts it.

Paper: ChebBooster: A Training-Free Approach for Efficient Diffusion Transformer Inference via Chebyshev-Inspired Extrapolation

Reference: https://github.com/Kiramei/ChebBooster

License: MIT (class: permissive, compat: 1.00, source: github) — permissive, safe to adopt.

Research interest: [crossrepo-eval] huggingface/diffusers

Why this paper for this team: Highly relevant for diffusers users working with Diffusion Transformers (DiTs) such as PixArt-Alpha or future DiT-based Stable Diffusion models, where inference speed is a major concern. ChebBooster offers a training-free, numerically stable extrapolation framework based on Chebyshev polynomials, accelerating DiT inference up to 3.68x and reducing FLOPs by 5.12x. Its compatibility with various DiT models (DiT-XL/2, PixArt-Σ, FLUX.1-dev) lets users boost inference efficiency without retraining.

Why this candidate: ChebBooster is a training-free Chebyshev-polynomial extrapolation for DiT cache reuse — the identical I/O contract as the repo's existing per-module cache hooks (TaylorSeer, MagCache, FasterCache), which it explicitly claims to improve upon. It wires into the already-in-production enable_cache dispatcher as one more XxxCacheConfig + apply_xxx_cache + elif branch, so the maintainer's integration decision is anchored on a contract already worth integrating. Code is MIT (compat 1.00), so no no-code override is needed.

Suggested experiment: Load a DiT-based model (e.g., PixArt-Alpha) from diffusers. Implement the core Chebyshev extrapolation logic of ChebBooster. Compare inference latency and generated image quality (e.g., FID or visual inspection) across various numbers of sampling steps, demonstrating the speedup and stability against a standard sampler.

Co-Authored-By: remyx-ai[bot] <289541483+remyx-ai[bot]@users.noreply.github.com>

@remyx-ai remyx-ai Bot added outrider:needs-judgment Outrider refinement chain stage label outrider:fidelity-done Outrider refinement chain stage label labels Sep 11, 2026
Convention-shape patches extracted from huggingface/diffusers's recent merged PRs. Algorithm logic is left untouched. Ruff auto-fixed lint-trivial issues on patched files.
@remyx-ai
remyx-ai Bot force-pushed the chebbooster-a-training-free-approach-for-efficient-diffusion-v2 branch from 17658c4 to 3d93435 Compare September 11, 2026 14:30
@remyx-ai remyx-ai Bot removed the outrider:fidelity-done Outrider refinement chain stage label label Sep 11, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 11, 2026
@remyx-ai
remyx-ai Bot marked this pull request as ready for review September 11, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation hooks models outrider:needs-judgment Outrider refinement chain stage label tests utils

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants