Skip to content

feat: implement cache_context for pab and fastercache. - #14900

Open
sayakpaul wants to merge 2 commits into
mainfrom
refactor-pab-fastercache
Open

sayakpaul wants to merge 2 commits into
mainfrom
refactor-pab-fastercache

Conversation

@sayakpaul

@sayakpaul sayakpaul commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

In #14663, we decided to move away from using pipeline states in caching (through callbacks). This PR propagates the same for PAB and FasterCache.

As a result of the changes, the changeset looks bigger. But the core changes are in:

  • src/diffusers/hooks/faster_cache.py
  • src/diffusers/hooks/pyramid_attention_broadcast.py
  • tests/models/testing_utils/cache.py
  • tests/pipelines/testing_utils/cache.py

@github-actions github-actions Bot added documentation Improvements or additions to documentation models tests modular-pipelines pipelines hooks size/L PR with diff > 200 LOC labels Sep 29, 2026
@sayakpaul

Copy link
Copy Markdown
Member Author

/diffusers-bot pytest tests/models -k "cache"

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

✅ pytest tests/models -k "cache" passed on GPU — view logs.

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

pipe = self.pipeline_class(**components)
pipe.set_progress_bar_config(disable=None)

self.pab_config.current_timestep_callback = lambda: pipe.current_timestep

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't be required after #14669. @DN6 can we get that PR first please, otherwise it would be too many merge conflicts to resolve.

This branch has not been deployed

No deployments
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 modular-pipelines pipelines size/L PR with diff > 200 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants