Skip to content

Conversation

@nifleisch
Copy link
Collaborator

@nifleisch nifleisch commented May 6, 2025

Description

This PR adds the PAB and FasterCache algorithms from diffusers (https://huggingface.co/docs/diffusers/main/api/cache).

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

I manually tested both caching mechanisms across all supported Diffusers pipelines, visually inspected the resulting images, videos, and measured the speed improvements (the relative speedups match this benchmark). For FLUX, I evaluated every supported combination of algorithms. I also implemented tests for each algorithm and their combinations.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional Notes

I attempted to enable compilation for these caching mechanisms but encountered errors. The core issue is that they introduce conditional logic into the attention layer, which prevents successful compilation.

@nifleisch nifleisch closed this May 6, 2025
@nifleisch nifleisch deleted the dev/add-diffusers-caching-algorithms branch May 6, 2025 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants