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

Deprecate legacy cache + use cache position #31491

Merged
merged 7 commits into from
Jun 21, 2024

Conversation

zucchini-nlp
Copy link
Member

What does this PR do?

This PR deprecates legacy cache in all models that currently support Cache class. Also, these models now rely on cache position and update-causal-mask to get 4d attention mask. Tests are passing on my end, will activate slow tests with commit msg on PR later

@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
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

🔥 super nice! Thanks for porting this and adding the deprecation
I think in the futur we will want to use generation_config.cache_config.ma_length maybe instead of calling get_max_length() but anyways super good porting!

src/transformers/models/dbrx/modeling_dbrx.py Outdated Show resolved Hide resolved
@zucchini-nlp
Copy link
Member Author

I think in the futur we will want to use generation_config.cache_config.ma_length maybe instead of calling get_max_length()

Yes, sounds good if we can start adopting cache config for all cache related arguments

Copy link
Member

@gante gante left a comment

Choose a reason for hiding this comment

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

💛

@zucchini-nlp zucchini-nlp merged commit 730a440 into huggingface:main Jun 21, 2024
22 checks passed
itazap pushed a commit that referenced this pull request Jun 21, 2024
* tmp

* update models

* revert utils

* delete

* Update src/transformers/models/dbrx/modeling_dbrx.py

Co-authored-by: Arthur <[email protected]>

* modify warning msg

---------

Co-authored-by: Arthur <[email protected]>
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.

4 participants