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

[ Adaptation Prompt] Fix llama rotary embedding issue with transformers main #1459

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

younesbelkada
Copy link
Contributor

Currently the adaptation prompt slow tests are failing on transformers main due to a recent refactor to add compatibility with static cache. huggingface/transformers#27931

That PR broke the adaptation prompt forward pass, as module.rotary_emb forward pass now have position_ids as a required argument, thus breaking the current impmelementation of llama roatary embedding as we don't pass position_ids in PEFT.

In addition, cos / sin are now directly indexed through that method, therefore we don't need to call our method that also indexes cos / sin with positon_ids. As computing the query states given cos / sin is a one-liner, I slighlty modified the logic in llama_compute_query_states to make sure the forward pass works fine with transformers main

cc @pacman100 @BenjaminBossan

@HuggingFaceDocBuilderDev

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.

Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this, LGTM.

Too bad that the signature changed and we have to resort to inspect, but I guess there isn't really a better way.

@younesbelkada younesbelkada merged commit 2347743 into huggingface:main Feb 13, 2024
14 checks passed
@younesbelkada younesbelkada deleted the fix-peft-slow-tests-2 branch February 13, 2024 11:26
BenjaminBossan pushed a commit to BenjaminBossan/peft that referenced this pull request Mar 14, 2024
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.

3 participants