(
self,
num_layers: int,
cache_size: int,
num_heads: int,
head_dim: int,
dtype: torch.dtype,
device: torch.device,
)
| 6 | from lightx2v.common.ops.attn.utils.all2all import all2all_head2seq, all2all_seq2head |
| 7 | |
| 8 | |
| 9 | class KVCacheView(NamedTuple): |
| 10 | key: torch.Tensor |
| 11 | value: torch.Tensor |
| 12 | |
| 13 | @property |
| 14 | def bindings(self) -> tuple[torch.Tensor, ...]: |
| 15 | return self.key, self.value |
| 16 | |
| 17 | |
| 18 | class BaseKVCachePool: |
| 19 | def __init__( |
| 20 | self, |
| 21 | num_layers: int, |
| 22 | cache_size: int, |
| 23 | num_heads: int, |
| 24 | head_dim: int, |
| 25 | dtype: torch.dtype, |
nothing calls this directly
no outgoing calls
no test coverage detected