-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Reduce by 2 the memory requirement in generate() 🔥🔥🔥
#30536
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
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
750955d
Fix contrastive_search for new cache structure, and improve performan…
Cyrilvallez c8a43a8
Fix _contrastive_search for non-standard cache using ellipsis slicing
Cyrilvallez 9342fff
Fix all outputs.logits memory leaks for all decoding strategies!
Cyrilvallez 15e8615
Fix small error in _contrastive_search()
Cyrilvallez c0e40d4
Make all necessary change and revert for the new class
Cyrilvallez 1de3148
Apply coding style
Cyrilvallez e170e96
Remove pipes in type hints for compatibility
Cyrilvallez d7c4359
correct type hint
Cyrilvallez 3986f1d
apply style
Cyrilvallez b9f7e04
Use DynamicCache by default and solve conflicts
Cyrilvallez 614e052
Fix rebase issues
Cyrilvallez 241b851
Add `_supports_dynamic_cache_class` in models for models that support…
Cyrilvallez d31eea4
Create generation config to return legacy format by default, or to ch…
Cyrilvallez 17525ab
style
Cyrilvallez c47e6ce
Fix case when use_cache is False
Cyrilvallez b9bbfd9
Remove default DynamicCache in assiste_decoding if assistant_model do…
Cyrilvallez 3b59cf6
Update prepare_inputs_for_generation() for case with empty DynamicCache
Cyrilvallez 2a809ad
Correct return of args in _assisted_decoding
Cyrilvallez e96adcb
Remove EfficientDynamicCache as it is no longer needed
Cyrilvallez 20174ec
Correct mistake in generation config
Cyrilvallez 7e39b92
Move cache logic of assisted decoding to AssistedCandidateGenerator._…
Cyrilvallez f3e3161
change DynamicCache function names from "split" to "batch_split" for …
Cyrilvallez 8abe055
Remove `_supports_dynamic_cache_class` attribute after rebase
Cyrilvallez e9d0b25
Correct missing line lost in conflict resolution during rebasing
Cyrilvallez c902dc1
Add special case for Jamba
Cyrilvallez 2f83867
Fix jamba test
Cyrilvallez 2c51e03
Coding style
Cyrilvallez 3c0999b
coding style
Cyrilvallez b494dd5
Correct missing import in rebasing
Cyrilvallez 70a0185
Simplify _validate_model_kwargs based on removal of _supports_dynamic…
Cyrilvallez d38a966
Simplify code paths in _contrastive_search
Cyrilvallez c8edaef
coding style
Cyrilvallez 1e020d6
Update docstrings of cache methods
Cyrilvallez 7bd2e3e
Update prepare_inputs_for_generation() -> past_key_values are always …
Cyrilvallez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to update the docstring of the class to explain why we have these methods! 🤗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be updated!