Skip to content

Commit 021416f

Browse files
committed
fix: use stride list length when broadcasting buffer strides
from_buffers broadcast the stride list with a modulo against len(block_lengths); a shorter stride list would raise IndexError and a longer one silently misaligned strides. Modulo against len(block_strides) matches the length/stride broadcast pairs production registers. Addresses the review finding on cache_layout.py. Signed-off-by: zhaosusu <zhaosusu1@h-partners.com>
1 parent e169af3 commit 021416f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎vllm_ascend/distributed/kv_transfer/kv_pool/ascend_store/cache_layout.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def from_buffers(
3030
else ()
3131
)
3232
strides = (
33-
tuple(block_strides[index % len(block_lengths)] for index in range(len(base_addresses)))
33+
tuple(block_strides[index % len(block_strides)] for index in range(len(base_addresses)))
3434
if block_strides and block_lengths
3535
else lengths
3636
)

0 commit comments

Comments
 (0)