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

An Issue on Reproducing Streamingllm #3

Open
Ocean-627 opened this issue May 23, 2024 · 1 comment
Open

An Issue on Reproducing Streamingllm #3

Ocean-627 opened this issue May 23, 2024 · 1 comment

Comments

@Ocean-627
Copy link

Congratulations on your excellent work! I attempted to run bash scripts/run_streamingllm_lm.sh to reproduce the results of streaming_llm, but I encountered the following error:

TypeError: llama_pos_shift_attention_forward() got an unexpected keyword argument 'padding_mask'

It seems that the transformers library version needs to be below 4.34.0, but this project requires version 4.34.1. Have you encountered the same issue? If so, do you have any solutions? Thank you very much!

@howard-yen
Copy link
Collaborator

Thank you for your interest in our work :)
I did run into a similar issue, apologies for not including the fixes in the original repo. To fix this issue, I applied a patch on top of the original streaming_llm repo. To apply the fix:

  1. clone the original repo
  2. replace the file streaming_llm/pos_shift/modify_llama.py with this file; the only changes I made to this file is adding the padding_mask argument to the pos_shift forward function, and also added supported for FlashAttention2.
  3. Install this version of the streaming_llm from source via python setup.py develop in the base directory. Alternatively, you can also just add this new version to your path (in case you don't want to go through the installation process).

This should work with transformers==4.34.1, which is what I tested it on. There are other libraries (e.g., AttentionSink) that also implement this, but I cannot speak to how they perform compared to the original repo. If you do get a chance to check them out, please let me know how they go.

Please let me know if you have any other questions :)

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

2 participants