Skip to content

Commit b2065a2

Browse files
committed
change enumerate dict to dict.items
1 parent a5f845a commit b2065a2

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

vllm/v1/worker/hpu_model_runner.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,12 +2538,8 @@ def copy_kv_blocks(
25382538
src_device=src_device,
25392539
dst_device=dst_device,
25402540
)
2541-
2542-
for idx, (layer, kv_layer) in enumerate(src_kv_caches):
2543-
if direction == "h2d":
2544-
k, v = kv_layer[0], kv_layer[1]
2545-
else:
2546-
k, v = kv_layer
2541+
for layer, kv_layer in src_kv_caches.items():
2542+
k, v = kv_layer[0], kv_layer[1]
25472543
dst_kv_caches[layer][0][dst_indices].copy_(k[src_indices], non_blocking = False)
25482544
dst_kv_caches[layer][1][dst_indices].copy_(v[src_indices], non_blocking = False)
25492545

0 commit comments

Comments
 (0)