MCPcopy Create free account
hub / github.com/FastMAS/KVCOMM / _split_cache

Function _split_cache

KVCOMM/llm/kvcomm_engine.py:495–502  ·  view source on GitHub ↗

Split a cache into multiple segments by the given lengths (sum sizes).

(cache: DynamicCache, sizes: Sequence[int])

Source from the content-addressed store, hash-verified

493
494
495def _split_cache(cache: DynamicCache, sizes: Sequence[int]) -> List[DynamicCache]:
496 """Split a cache into multiple segments by the given lengths (sum sizes)."""
497 offsets = []
498 start = 0
499 for size in sizes:
500 offsets.append((start, start + size))
501 start += size
502 return [cache.slice(start=s, end=e) for s, e in offsets]
503
504
505def _install_dynamic_cache_extensions() -> None:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected