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

Cache: add new flag to distinguish models that Cache but not static cache #30800

Merged
merged 4 commits into from
May 16, 2024

Conversation

gante
Copy link
Member

@gante gante commented May 14, 2024

What does this PR do?

See title :)

Models like Jamba (will only ever support HybridMambaAttentionDynamicCache) or Mistral (currently only supports dynamic caches, like SinkCache) need a distinction in terms of support flags, to run the appropriate checks and tests.

Without this flag, we have the following bad practices:

  1. manually skip tests
  2. don't do cache support checks in generate

@gante gante requested a review from zucchini-nlp May 14, 2024 12:05
@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.

@gante gante changed the title Jamba: set _supports_cache_class to False, jamba has its own cache type Cache: add new flag to distinguish models that Cache but not static cache May 14, 2024
@gante gante requested a review from ArthurZucker May 14, 2024 12:45
Copy link
Member

@zucchini-nlp zucchini-nlp 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 the tests!

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.

Alright, not super fan of increasing the things a model supports by adding more attributes, but fine for now.

@gante
Copy link
Member Author

gante commented May 16, 2024

@ArthurZucker we can remove this attribute when we update all Llama-copied models to support the static cache :D

@gante gante merged commit 9d889f8 into huggingface:main May 16, 2024
23 checks passed
@gante gante deleted the jamba_cache branch May 16, 2024 11:08
itazap pushed a commit that referenced this pull request May 24, 2024
… cache (#30800)

* jamba cache

* new flag

* generate exception
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.

None yet

4 participants