Add ChebyshevCacheConfig extrapolation cache hook to enable_cache - #33
Open
remyx-ai[bot] wants to merge 2 commits into
Open
Add ChebyshevCacheConfig extrapolation cache hook to enable_cache#33remyx-ai[bot] wants to merge 2 commits into
remyx-ai[bot] wants to merge 2 commits into
Conversation
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
Bot
force-pushed
the
chebbooster-a-training-free-approach-for-efficient-diffusion-v2
branch
from
September 11, 2026 14:30
17658c4 to
3d93435
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds a new training-free
ChebyshevCacheConfig+apply_chebyshev_cachecache 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:
CacheMixin.enable_cache(src/diffusers/models/cache_utils.py) dispatches toapply_chebyshev_cachevia a newelif isinstance(config, ChebyshevCacheConfig)branch (mirroring TaylorSeer/MagCache/FasterCache), anddisable_cacheremoves the registered_CHEBYSHEV_CACHE_HOOK. Any DiT/UNet transformer exposingenable_cache(config)can invoke it exactly like the existing cache hooks.chebyshev_barycentric_weights), then applied cheaply per prediction step via the second barycentric form.disable_cache_before_step), cooldown (disable_cache_after_step), and periodic full-compute refresh (cache_interval), plus askip_predict_identifierszero-tensor 'skip' mode for the FLOPs-reduction angle.ChebyshevCacheConfig(andapply_chebyshev_cache) are exported fromsrc/diffusers/__init__.py, makingfrom diffusers import ChebyshevCacheConfigimportable by external users; backed by dummy objects and a test file.Intentionally out of scope:
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 importingexamples/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
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
diffusersusers 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_cachedispatcher as one moreXxxCacheConfig+apply_xxx_cache+elifbranch, 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>