-
Notifications
You must be signed in to change notification settings - Fork 30k
New DynamicSlidingWindowLayer & associated Cache #40039
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
base: main
Are you sure you want to change the base?
Conversation
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. |
534a6a4
to
41d55aa
Compare
All good now, slow tests on mistral, gemma2 and t5gemma are all similar to main (only a slight fa2 issue that surfaced on a slow test for mistral, but it's unrelated and solved by #40002) |
[For maintainers] Suggested jobs to run (before merge) run-slow: arcee, aria, bitnet, cohere, cohere2, csm, deepseek_v2, deepseek_v3, diffllama, doge, dots1, emu3, ernie4_5, exaone4, fsmt, gemma2 |
What does this PR do?
As per the title. To avoid wasting memory for models with sliding window. As I don't want to reintroduce static hybrid caches by default to avoid all the pitfalls of automatic compilation, but don't want to waste that memory, this is definitely the way to go.
The only change that is needed is to pass the
config
toDynamicCache
, to be able to parsesliding_window
/layer_types
. If we don't, then the behavior is exactly the same as before.See the following figures for an illustration: