Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edited attention.py for older xformers #1270

Conversation

Lime-Cakes
Copy link
Contributor

@Lime-Cakes Lime-Cakes commented Nov 13, 2022

Older versions of xformers require query, key, value to be contiguous, this calls .contiguous() on q/k/v before passing to xformers.

Tested with 0.14 version of xformers built by metrolobo, specifically, this release, on T4 GPU and torch==1.12.0+cu113. It seemed this problem isn't encountered on other versions.

Testing with the 'official' release on pip isn't possible, as the 0.13 version currently on pip cannot be installed, regardless of gpu/version.

Edit: I did not run test with the other versions of prebuilt wheels, or other GPU but T4. Let me know if it fails on other versions.

Older versions of xformers require query, key, value to be contiguous, this calls .contiguous() on q/k/v before passing to xformers.
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@patrickvonplaten
Copy link
Contributor

Can confirm! Thanks a lot for your PR :-)

@patrickvonplaten patrickvonplaten merged commit 33d7e89 into huggingface:main Nov 14, 2022
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
Older versions of xformers require query, key, value to be contiguous, this calls .contiguous() on q/k/v before passing to xformers.
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.

None yet

3 participants