fix: make qkv compatible with torch.compile in next diffusers release#302
Merged
fix: make qkv compatible with torch.compile in next diffusers release#302
Conversation
10 tasks
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.
Description
The current main branch in
diffusersis undergoing a large refactorization for attention computation.The attention processors still exist but Flux and Wan have now a local version of their own processor. Also qkv fusing was changed: it is now taking place in the AttentionMixin class (not anymore in the transformer class itself).
Sister PR in pruna_pro is here.
Related Issue
The combination qkv_diffusers+torch_compile is taking forever to compute on the latest diffusers codebase
Type of Change
How Has This Been Tested?
Tested on Flux-dev with diffusers==0.34.0 and diffusers==0.35.0dev0
On Flux-dev, the generation time goes from 10.44s (original) to 5.12s (with
qkv_diffusers+fp8+torch_compile).The warm-up time (first inference) takes 56.16s.
Checklist
Additional Notes