-
Notifications
You must be signed in to change notification settings - Fork 30.7k
[cache refactor] Move all the caching logic to a per-layer approach #39106
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
Cyrilvallez
merged 44 commits into
huggingface:main
from
manueldeprada:cache-refactor-1
Jul 22, 2025
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
1c3cbcc
Squash for refactor: Replace monolithic cache classes with modular La…
manueldeprada 04d7a0b
fix quantized, add tests
manueldeprada 26c28af
remove CacheProcessorList
manueldeprada 16a6624
raushan review, arthur review
manueldeprada aec9ccd
joao review: minor things
manueldeprada e80c68a
remove cache configs, make CacheLayer a mixin (joaos review)
manueldeprada 27916bc
back to storage inside Cache()
manueldeprada fd83e14
remove cachebase for decorator
manueldeprada c200447
no more __getattr__
manueldeprada f327570
Merge branch 'main' of github.com:huggingface/transformers into cache…
manueldeprada 5b1b1f1
fix tests
manueldeprada 58dbcfe
joaos review except docs
manueldeprada 0c6d2ff
fix ast deprecations for python 3.14: replace node.n by node.value an…
manueldeprada 6a77408
Revert "back to storage inside Cache()"
manueldeprada 13ec4a4
cyril review
manueldeprada 7029a90
simplify cache export
manueldeprada 5fa9901
Merge branch 'main' of github.com:huggingface/transformers into cache…
manueldeprada dd7458b
fix lfm2 cache
manueldeprada dc08253
HybridChunked to layer
manueldeprada a952124
BC proxy object for cache.key_cache[i]=...
manueldeprada dbbc4d5
reorder classes
manueldeprada 4bb48fc
bfff come on LFM2
manueldeprada 00b1f96
better tests for hybrid and hybridChunked
manueldeprada def346e
Merge branch 'main' of github.com:huggingface/transformers into cache…
manueldeprada 38e8603
complete coverage for hybrid chunked caches (prefill chunking)
manueldeprada 34a3022
reimplementing HybridChunked
manueldeprada 4222653
cyril review
manueldeprada 063459c
Merge branch 'main' of github.com:huggingface/transformers into cache…
manueldeprada 1acc648
fix ci
manueldeprada ca39ffe
docs for cache refactor
manueldeprada 731d0b7
docs
manueldeprada 574b820
Merge branch 'main' of github.com:huggingface/transformers into cache…
manueldeprada a479470
oopsie
manueldeprada 9c0bdcc
oopsie
manueldeprada 04091ed
Merge branch 'main' into cache-refactor-1
manueldeprada 8642bb6
Merge branch 'main' of github.com:huggingface/transformers into cache…
manueldeprada 83968bd
Merge branch 'cache-refactor-1' of https://github.com/manueldeprada/t…
manueldeprada 0c4700d
fix after merge
manueldeprada b3a35e9
cyril review
manueldeprada e4878ad
arthur review
manueldeprada 38fb99d
Merge branch 'main' of github.com:huggingface/transformers into cache…
manueldeprada 8df1595
opsie
manueldeprada ad65a02
fix lfm2
manueldeprada d9fbb04
opsie2
manueldeprada 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
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.
Missing:
Cache
(and its methods)