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

Offloaded cache: fix generate #34921

Merged
merged 5 commits into from
Nov 28, 2024

Conversation

zucchini-nlp
Copy link
Member

What does this PR do?

Fixes #34718 and adds tests. Also had to fix some inconsistencies in the code so that the test passes for all models, for ex using max_batch_size instead of batch_size in all cache classes

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

Cool thanks!

Comment on lines +1257 to +1263
@property
def batch_size(self):
logger.warning_once(
f"The 'batch_size' attribute of {self.__class__.__name__} is deprecated and will be removed in "
"v4.49. Use the more precisely named 'self.max_batch_size' attribute instead."
)
return self.max_batch_size
Copy link
Collaborator

Choose a reason for hiding this comment

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

cool, let's make sure all our codes uses max_batch_size as logger warning is incompatible with compile

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, I check the generation files and the repo, seems like all changes are done already. Plus the compile tests on llama still pass

@zucchini-nlp zucchini-nlp merged commit 5e8c1d7 into huggingface:main Nov 28, 2024
26 checks passed
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
* fix cache impl

* require_torch_gpu

* fix mamba

* fix copies
BernardZach pushed a commit to innovationcore/transformers that referenced this pull request Dec 6, 2024
* fix cache impl

* require_torch_gpu

* fix mamba

* fix copies
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.

ValueError: Invalid cache_implementation (offloaded).
3 participants
  NODES
COMMUNITY 2
innovation 1
Project 5
USERS 1