Repository navigation
[KV offload] Parallel-agnostic fs-tier cache for single full-attention group #44733
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
Changes from 1 commit
2d3ceda
c89e547
784b39a
105e214
a05a5c4
33b7ad9
0de9314
290632d
ab9e80b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ | |
| from typing_extensions import override | ||
|
|
||
| from vllm.logger import init_logger | ||
| from vllm.v1.kv_cache_interface import FullAttentionSpec | ||
| from vllm.v1.kv_offload.base import OffloadKey, ReqContext | ||
| from vllm.v1.kv_offload.file_mapper import FileMapper | ||
| from vllm.v1.kv_offload.tiering.base import ( | ||
|
|
@@ -89,11 +90,18 @@ def __init__( | |
| ) | ||
| self._block_size: int = primary_kv_view.strides[0] | ||
|
|
||
| # Create file mapper | ||
| # A single full-attention group has a parallelism-invariant offloaded | ||
| # block, so share its cache across parallel sizes. Replicated KV (MLA, | ||
| # small-GQA) is world_size-scaled and fails closed on the load size check. | ||
| kv_cache_groups = offloading_spec.kv_cache_config.kv_cache_groups | ||
| parallel_agnostic = len(kv_cache_groups) == 1 and isinstance( | ||
| kv_cache_groups[0].kv_cache_spec, FullAttentionSpec | ||
| ) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's move this logic inside the FileMapper (so other tiers can "enjoy" it as well).
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right, |
||
| self.file_mapper = FileMapper.from_offloading_spec( | ||
| root_dir=root_dir, | ||
| offloading_spec=offloading_spec, | ||
| gpu_blocks_per_file=offloading_spec.block_size_factor, | ||
| parallel_agnostic=parallel_agnostic, | ||
| ) | ||
|
|
||
| # Write config file | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.