[Elastic EP] Support Model Runner V2 (#53934)

Signed-off-by: almogtavor <almogtavor@gmail.com>
Signed-off-by: Almog Tavor <70065337+almogtavor@users.noreply.github.com>
This commit is contained in:
Almog Tavor
2026-09-29 00:20:40 +00:00
committed by GitHub
parent c68eb98b69
commit 171d1b9ef6
12 changed files with 171 additions and 80 deletions
+5
View File
@@ -15,6 +15,9 @@ from vllm.v1.worker.gpu.buffer_utils import (
class BlockTables:
# Set by the elastic EP warmup so KV writes land in the null block.
redirect_writes_to_null_block = False
def __init__(
self,
block_sizes: list[int],
@@ -126,6 +129,8 @@ class BlockTables:
bpk = self.blocks_per_kv_block[i]
if bpk > 1:
block_ids = [b * bpk + k for b in block_ids for k in range(bpk)]
if self.redirect_writes_to_null_block:
block_ids = [0] * len(block_ids)
end = start + len(block_ids)
row_capacity = self.block_tables[i].gpu.shape[1]
if end > row_capacity: