[Mooncake] Allow Mamba cache mode none for capacity-only workers (#60712)

Signed-off-by: Wei Zhao <51183510+wzhao18@users.noreply.github.com>
Signed-off-by: wzhao18 <wzhao18.sz@gmail.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Wei Zhao
2026-10-13 23:13:58 +00:00
committed by GitHub
co-authored by Codex Claude Opus 5.5
parent 96fc2da315
commit 8082b62f32
3 changed files with 112 additions and 18 deletions
@@ -172,15 +172,24 @@ class MooncakeStoreScheduler:
for group_id, group in enumerate(store_groups)
if isinstance(group.kv_cache_spec, MambaSpec)
}
assert all(
spec.mamba_cache_mode == "align" for spec in mamba_groups.values()
), "MooncakeStoreScheduler requires mamba_cache_mode='align'"
self._boundary_state_group_ids = frozenset(mamba_groups)
self._store_coord = MooncakeStoreCoordinator.from_kv_cache_config(
kv_cache_config, vllm_config, self._block_size, self._hash_block_size
# Mirrors MooncakeStoreConnector._capacity_only.
self._capacity_only = (
self.kv_role == "kv_consumer"
and not self.enable_lookup
and not self.save_decode_cache
)
self.enable_partial_hash_hits = self._store_coord.enable_partial_hash_hits
self._store_coord: MooncakeStoreCoordinator | None = None
self.enable_partial_hash_hits = False
if not self._capacity_only:
assert all(
spec.mamba_cache_mode == "align" for spec in mamba_groups.values()
), "MooncakeStoreScheduler requires mamba_cache_mode='align'"
self._store_coord = MooncakeStoreCoordinator.from_kv_cache_config(
kv_cache_config, vllm_config, self._block_size, self._hash_block_size
)
self.enable_partial_hash_hits = self._store_coord.enable_partial_hash_hits
self._gpu_block_pool: BlockPool | None = None
self._num_workers = vllm_config.parallel_config.world_size
@@ -511,7 +520,8 @@ class MooncakeStoreScheduler:
meta.add_request(req_meta)
self._finished_partial_tail_metas.clear()
self._reference_save_blocks(meta)
if not self._capacity_only:
self._reference_save_blocks(meta)
return meta
def _apply_current_save_block_ids(
@@ -546,6 +556,7 @@ class MooncakeStoreScheduler:
"""
pool = self._gpu_block_pool
coord = self._store_coord
assert coord is not None
block_sizes = [g.kv_cache_spec.block_size for g in coord.kv_cache_groups]
for req_meta in meta.requests:
if not req_meta.can_save:
@@ -629,6 +640,7 @@ class MooncakeStoreScheduler:
completed_token_len=request.num_computed_tokens,
)
coord = self._store_coord
assert coord is not None
req_meta.boundary_puts = [
*_partial_tail_non_mamba_puts(
coord,