MCPcopy Create free account
hub / github.com/EverMind-AI/MSA / update_router_kcache

Method update_router_kcache

src/utils/cache.py:165–172  ·  view source on GitHub ↗
(
        self,
        key_states: torch.Tensor,
        layer_idx: int,
    )

Source from the content-addressed store, hash-verified

163 return super().update(key_states, value_states, layer_idx, cache_kwargs)
164
165 def update_router_kcache(
166 self,
167 key_states: torch.Tensor,
168 layer_idx: int,
169 ) -> Tuple[torch.Tensor, torch.Tensor]:
170 if key_states is not None and torch.is_tensor(key_states) and key_states.is_cuda:
171 key_states = key_states.cpu()
172 return super().update_router_kcache(key_states, layer_idx)
173
174class CustomQuantizeDynamicCache(QuantoQuantizedCache):
175 """

Callers

nothing calls this directly

Calls 1

update_router_kcacheMethod · 0.45

Tested by

no test coverage detected