-
-
Notifications
You must be signed in to change notification settings - Fork 20.4k
[kv_offload] Add multi-tier KV cache offloading framework #40020
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 8 commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
84c6059
[kv_offload] Add tiered KV offloading framework
ronensc cc1ae59
Fix rebase issues: remove block_size
ronensc c3d6cb6
Fix rebase issues: add ReqContext and update lookup()
ronensc f05638b
Fix rebase issues: make pre-commit happy
ronensc 7d3798d
Address review: pass filtered keys to submit_load
ronensc 7374bf2
propagate request context to submit_load()
ronensc 51654d9
Addredd review: Refactor get_primary_kv_tensor() -> create_kv_memoryv…
ronensc 9dc1757
Address review: remove support for store_threshold
ronensc 93a2a67
Change SecondaryTierManager.lookup() to accept single key instead of …
ronensc f1975be
Add ReqContext to SecondaryTierManager.lookup()
ronensc 70bfa59
Change _initiate_promotion() to handle single key
ronensc f8a0438
Address review: re-organize file tree structure
ronensc 98ffa48
Address review: remove tier_name from config
ronensc b8897c3
Address review: rename dummy -> example
ronensc 56c3735
Remove unused ExampleLoadStoreSpec class
ronensc 675e056
Address review: widen JobMetadata.keys from list to Sequence
ronensc a9426da
Address review: replace `LoadStoreSpec` with `block_ids: np.ndarray`
ronensc 2ba6523
Make pre-commit happy
ronensc 4d63460
Merge remote-tracking branch 'origin/main' into tier-offload
ronensc bafc17e
Fix merge issues: Iterable to Sequence
ronensc 34605d7
Merge remote-tracking branch 'origin/main' into tier-offload
ronensc ad714be
Fix merge issues: update imports
ronensc 4efc9e5
Merge branch 'main' into tier-offload
ronensc 2029d46
Fix merge issues: update imports
ronensc 282cfe7
Fix merge issues: change keys type
ronensc 6ffec8b
Fix merge issues: sequence -> collection
ronensc e80f48b
Change SecondaryTierManager.lookup() to accept single key instead of …
ronensc 6875f73
Remove unnecessary list materialism
ronensc 7e77867
Refactor tiering.lookup()
ronensc 82af98a
cherry-pick: Update lookup() to return None when block isn't ready
ronensc b4df136
batch and defer submit_load per tier and request
ronensc 83375fb
Merge branch 'main' into tier-offload
ronensc eac6e0f
cherry-pick: Add ReqContext to touch, complete_load, complete_store
ronensc 80b671d
Add context to tiering offloading manager methods
ronensc 727d9cf
Invoke _process_finished_jobs() once per engine step
ronensc 1c15206
Remove redundant tests
ronensc 7f472ca
Merge branch 'main' into tier-offload
ronensc e1cf201
Address review: update docstrings of SecondaryTierManager methods
ronensc 9a64da1
Address review: remove hedging language
ronensc d72847e
Address feedback: clarify a comment
ronensc 489a960
Address review: save the extra function call by alias
ronensc ab56407
Address review: assert zero-copy access to primary kv tensor
ronensc be11bf9
Fix merge issue
ronensc 8aac05e
Address review: unify _store_jobs and _load_jobs into _transfer_jobs
ronensc f19ba04
Address review: replace error logging with assert
ronensc 3e187e1
Rename primary_store_result-> primary_write_result
ronensc cf2cc5e
Address review: return False in lookup() when primary is full
ronensc c199492
Address review: remove in-flight block tracking from example
ronensc bb56ba5
Merge remote-tracking branch 'origin/main' into tier-offload
ronensc d73e4f5
Address review: rename _PendingPromotion -> PendingPromotion
ronensc 9644068
Address review: add test_tiering_offloading()
ronensc b7cc952
Address review: refactor lookup
ronensc 7cc7326
Address review: wire primary_kv_memoryview during init
ronensc 1129c1d
Add shutdown to SecondaryTierManager
ronensc c1e0a25
Pass vllm_config to SecondaryTierManager
ronensc d63db1e
Address review: move create_kv_memoryview to SharedOffloadRegion
ronensc 414def6
cherry-pick: Add req_id to ReqContext for per-request tracking
ronensc 8ef126b
Address review: use req_id instead of id(req_context) for pending pro…
ronensc 6a2bfc6
Address review: replace `from __future__ import annotations` with str…
ronensc 100418f
Address review: make mmap_region non-optional in CPUPrimaryTierOffloa…
ronensc 648746e
Merge branch 'main' into tier-offload
ronensc f0782e6
Fix mypy errors
ronensc 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Copyright contributors to the vLLM project | ||
| """ | ||
| Secondary tier implementations for KV cache offloading. | ||
|
|
||
| This package contains various secondary tier storage backends that can be used | ||
| with the TieringOffloadingManager for multi-tier KV cache management. | ||
| """ | ||
|
|
||
| from vllm.v1.kv_offload.secondary_tiers.dummy import ( | ||
| DummyLoadStoreSpec, | ||
| DummySecondaryTier, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "DummyLoadStoreSpec", | ||
| "DummySecondaryTier", | ||
| ] |
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.