Skip to content

Offloaded cache: fix generate#34921

Merged
zucchini-nlp merged 5 commits intohuggingface:mainfrom
zucchini-nlp:offloaded-cache
Nov 28, 2024
Merged

Offloaded cache: fix generate#34921
zucchini-nlp merged 5 commits intohuggingface:mainfrom
zucchini-nlp:offloaded-cache

Conversation

@zucchini-nlp
Copy link
Copy Markdown
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
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
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
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