ixf copy_blocks
This commit is contained in:
@@ -2290,10 +2290,8 @@ class PagedAttention:
|
||||
kv_caches: List[torch.Tensor],
|
||||
src_to_dists: torch.Tensor,
|
||||
) -> None:
|
||||
key_caches = [kv_cache[0] for kv_cache in kv_caches]
|
||||
value_caches = [kv_cache[1] for kv_cache in kv_caches]
|
||||
# BI100 CoreX 3.2.3: ixformer exposes vllm_copy_blocks, not
|
||||
# copy_blocks. Call the vendor symbol directly instead of going
|
||||
# through ops.copy_blocks (which hits the missing name).
|
||||
import ixformer.functions as _ixf
|
||||
_ixf.vllm_copy_blocks(key_caches, value_caches, src_to_dists)
|
||||
for kv_cache in kv_caches:
|
||||
src = src_to_dists[:, 0].long()
|
||||
dst = src_to_dists[:, 1].long()
|
||||
kv_cache[0][dst] = kv_cache[0][src]
|
||||
kv_cache[1][dst] = kv_cache[1][src]
|
||||
Reference in New Issue
Block a user