-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Hybrid recurrent cache #13979
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
Hybrid recurrent cache #13979
Changes from 35 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
ec8fe17
feat: Add llama_model_is_hybrid API call
gabe-l-hart 5e2f2c3
feat: Add c++ side constants for attention layer indices hparam
gabe-l-hart 05f1958
feat: Add support for distinguishing recurrent vs non-recurrent layer…
gabe-l-hart fc9e0b5
feat: Auto-fill hparams.recurrent_layer_arr based on whether the mode…
gabe-l-hart fb26e95
refactor: rename *_is_hybrid -> *_is_hybrid_recurrent
gabe-l-hart 40e9187
feat: Add layer filter to recurrent cache
gabe-l-hart 13332a7
fix: Use per-layer sizing everywhere in kv caches
gabe-l-hart c71eaa3
feat: First pass at llama_kv_cache_hybrid_recurrent
gabe-l-hart 423c894
feat: Construct hybrid recurrent cache for hybrid recurrent models
gabe-l-hart 6c6ec00
fix: Fix wrong bool condition for split equal in hybrid cache
gabe-l-hart cf03d4a
fix: Fix shift logic to defer to unified cache
gabe-l-hart e3c1631
feat: Support hybrid recurrent in llama-graph
gabe-l-hart a9b5fe9
fix: Fix logic for initializing inputs and attn layers for hybrid caches
gabe-l-hart d369936
fix: Update recurrent cache for changes to remove intermediate kv_cac…
gabe-l-hart 911e694
fix: Fix status for init_update sig for recurrent cache state
gabe-l-hart de9297f
fix: Add missing padding to n_ctx for hybrid cache construction
gabe-l-hart 9c1a604
fix: Update clear signature for data argument after rebase
gabe-l-hart f6d5f05
fix: Remove errant virtual destructor leftover from previous impl att…
gabe-l-hart 833dfb5
fix: Use per-layer n_embd_k/v_s calls for mamba (1) layers
gabe-l-hart 1dd1213
refactor: Remove n_embd_k/v_s from unified cache
gabe-l-hart b42c8b4
refactor: Remove layer index from n_embd_k/v_s
gabe-l-hart d5d7628
refactor: Remove n_embd_k/v_gqa from recurrent cache
gabe-l-hart d8c929f
feat: Allow custom layer filters for hybrid recurrent
gabe-l-hart 1510016
fix: Remove logits_all after rebase
gabe-l-hart 7ba463b
fix: Remove llama_model_is_hybrid_Recurrent public API
gabe-l-hart 4ec4e6a
refactor: Use llama_memory_state_ptr for child states in hybrid memor…
gabe-l-hart 11cd80d
feat: Overhaul build_recurrent_state / build_inp_s_copy to match atte…
gabe-l-hart 9db44a2
fix: Fix resize vs reserve and skip null tensors in size computation
gabe-l-hart 5046d41
fix: Fix initialization of child states
gabe-l-hart faf4119
refactor: Use a common build_recurrent_state method that is cache-agn…
gabe-l-hart 59fee24
recurrent : rework graph inputs + add TODOs
ggerganov c80e68c
Merge pull request #2 from ggml-org/gabe-l-hart/HybridRecurrentCache
gabe-l-hart 8488f5e
refactor: Make status and child states const in hybrid and iswa
gabe-l-hart 88213a9
refactor: Rename llama_kv_cache_[recurrent|hybrid_recurrent] to remov…
gabe-l-hart 8e39e04
refactor!: Rename all k/v related values for recurrent/hybrid to r/s
gabe-l-hart 6403f19
refacor: _recurrent -> _recr for brevity
gabe-l-hart d0565e8
style: Fix spacing for ref
gabe-l-hart 35c0233
refactor: recurrent_layer() -> is_recurrent()
gabe-l-hart 304f86e
style: Fix spacing for size_s_bytes declaration
gabe-l-hart 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.
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.
Uh oh!
There was an error while loading. Please reload this page.