bugfix revise interface get cpu copy for npu mem pool to align with gpu (#27802)

This commit is contained in:
McZyWu
2026-06-15 17:24:10 +08:00
committed by GitHub
parent 1180b70440
commit bf186cf8fc
@@ -245,7 +245,7 @@ class NPUMHATokenToKVPool(MHATokenToKVPool):
# NPUMHATokenToKVPool stores buffers as
# (num_pages, page_size, head_num, head_dim) # use_fia=False
# (num_pages*page_size, 1, head_num, head_dim) # use_fia=True
def get_cpu_copy(self, indices):
def get_cpu_copy(self, indices, mamba_indices=None):
torch.npu.synchronize()
buf_of_layers = []
for local_layer_id in range(self.layer_num):
@@ -260,7 +260,7 @@ class NPUMHATokenToKVPool(MHATokenToKVPool):
torch.npu.synchronize()
return kv_cache_cpu
def load_cpu_copy(self, kv_cache_cpu, indices):
def load_cpu_copy(self, kv_cache_cpu, indices, mamba_indices=None):
torch.npu.synchronize()
chunk_size = self.cpu_offloading_chunk_size
for local_layer_id in range(self.layer_num):