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

v2.1.2 causes ImportError with Rotary #519

Closed
bjoernpl opened this issue Sep 5, 2023 · 8 comments
Closed

v2.1.2 causes ImportError with Rotary #519

bjoernpl opened this issue Sep 5, 2023 · 8 comments

Comments

@bjoernpl
Copy link

bjoernpl commented Sep 5, 2023

The changes introduced in b28ec23 cause an ImportError:

    from flash_attn.layers.rotary import apply_rotary_emb_func
File "/opt/conda/lib/python3.10/site-packages/flash_attn/layers/rotary.py", line 8, in <module>
    from flash_attn.ops.triton.rotary import apply_rotary
ModuleNotFoundError: No module named 'flash_attn.ops.triton'

I would expect any added dependencies to be installed with the pip install. Currently using

pip install flash-attn --no-build-isolation
pip install git+https://github.com/HazyResearch/flash-attention.git#subdirectory=csrc/rotary

Reverting to v2.1.1 solves this issue for me:

pip install flash-attn==2.1.1 --no-build-isolation
pip install git+https://github.com/HazyResearch/flash-attention.git@v2.1.1#subdirectory=csrc/rotary
@Kyeongpil
Copy link
Contributor

Kyeongpil commented Sep 5, 2023

I think this issue is caused by missing init file.
#516

@Bec-k
Copy link

Bec-k commented Sep 5, 2023

Then need to wait when it's getting merged into main branch.

@Birch-san
Copy link

I think more than just the init file is missing. creating that init file wasn't enough to fix importing of rotary embeddings for me.
I think the entirety of ops/triton is missing from the PyPI distribution.

@tridao
Copy link
Contributor

tridao commented Sep 5, 2023

Should be fixed in v2.2.0 (might take CI 9-10 hours to finish compiling all the CUDA wheels).

@Kyeongpil
Copy link
Contributor

Kyeongpil commented Sep 6, 2023

v2.2.0 was released, and ops/triton is successfully included :)

@Qubitium
Copy link
Contributor

Qubitium commented Sep 6, 2023

But I am getting rotary issue #523 with manually compiled 2.2.0 since pypi is not ready.

@goog
Copy link

goog commented Sep 6, 2023

Version: 2.1.2.post3 has the same problem,
pip install flash-attn==2.1.1 --no-build-isolation hang long time in china, so could you give another method to get the whl not by github(so fuck block)

@tridao
Copy link
Contributor

tridao commented Sep 6, 2023

so could you give another method to get the whl not by github

We welcome contributions on this front.

@tridao tridao closed this as completed Sep 19, 2023
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

No branches or pull requests

7 participants