MCPcopy Create free account
hub / github.com/LMCache/LMCache / split_layers

Method split_layers

lmcache/utils.py:598–613  ·  view source on GitHub ↗

Split the key into multiple keys for each layer

(self, num_layers: int)

Source from the content-addressed store, hash-verified

596 return s
597
598 def split_layers(self, num_layers: int) -> List["LayerCacheEngineKey"]:
599 """Split the key into multiple keys for each layer"""
600 keys = []
601 for layer_id in range(num_layers):
602 keys.append(
603 LayerCacheEngineKey(
604 model_name=self.model_name,
605 world_size=self.world_size,
606 worker_id=self.worker_id,
607 chunk_hash=self.chunk_hash,
608 dtype=self.dtype,
609 request_configs=self.request_configs,
610 layer_id=layer_id,
611 )
612 )
613 return keys
614
615 @staticmethod
616 def from_string(s):

Callers

nothing calls this directly

Calls 1

LayerCacheEngineKeyClass · 0.85

Tested by

no test coverage detected