[Spec] Avoid tensor scalar reads in spec decode allocation (#35377)

This commit is contained in:
paulzhang-tm
2026-08-26 14:51:31 -07:00
committed by GitHub
parent 45c85c198b
commit 06694071c6
+3 -2
View File
@@ -706,5 +706,6 @@ def alloc_for_spec_decode(
len(reqs),
)
for i, req in enumerate(reqs):
req.kv.kv_allocated_len = max(req.kv.kv_allocated_len, int(nxt_kv_lens_cpu[i]))
nxt_kv_lens_list = nxt_kv_lens_cpu.tolist()
for req, nxt_kv_len in zip(reqs, nxt_kv_lens_list, strict=True):
req.kv.kv_allocated_len = max(req.kv.kv_allocated_len, nxt_kv_len)