-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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
🧹 Remove deprecated RotaryEmbedding parts in the Attention layers #34858
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make sure we only remove where it is needed, make mandatory and should be good to go!
kv_seq_len = key_states.shape[-2] | ||
if past_key_value is not None: | ||
kv_seq_len += cache_position[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unwanted change I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nop, this is actually doing nothing (never used, no purpose here) so I cleaned it up!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed not linked to the rotary though, but as I'm cleaning stuff, let's remove it as the same time
@ArthurZucker should be good to go! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, btw one thing we can include: default rope initialization should be in the function itself!
Looks like there is a regression? |
True! Aria relies on Llama and was merged in the meantime - #35208 correctly reapplies new Llama change to Aria |
This PR resolves the failing adoption prompt tests in the CI using transformers installed from source. In this transformers PR: huggingface/transformers#34858 the module.rotary_emb attribute has been removed, which adoption prompt so far assumed was present. Instead, the position_embeddings are now already computed and can be taken directly from the kwargs.
This PR resolves the failing adoption prompt tests in the CI using transformers installed from source. In this transformers PR: huggingface/transformers#34858 the module.rotary_emb attribute has been removed, which adoption prompt so far assumed was present. Instead, the position_embeddings are now already computed and can be taken directly from the kwargs.
This PR resolves the failing adoption prompt tests in the CI using transformers installed from source. In this transformers PR: huggingface/transformers#34858 the module.rotary_emb attribute has been removed, which adoption prompt so far assumed was present. Instead, the position_embeddings are now already computed and can be taken directly from the kwargs.
What does this PR do?
This cleans-up the (expired) deprecated cycle for the rotary embeddings and fully move them to the Model instead of the Attention. Also removes deprecated EmbeddingClasses, and fix the tests accordingly.