[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:
@@ -294,7 +294,11 @@ def _warmup_kernels(
|
||||
model_runner.scheduler_config.max_num_batched_tokens
|
||||
// max(prompt_len, decode_query_len),
|
||||
)
|
||||
if max_blocks_per_req > 0:
|
||||
block_tables = getattr(model_runner, "block_tables", None)
|
||||
null_blocks = block_tables is not None and (
|
||||
block_tables.redirect_writes_to_null_block
|
||||
)
|
||||
if max_blocks_per_req > 0 and not null_blocks:
|
||||
# Reserve block 0 (null block) and ensure we have enough blocks.
|
||||
# Encoder-only models allocate no KV blocks, so this cap doesn't apply.
|
||||
num_reqs = min(
|
||||
@@ -450,4 +454,6 @@ def _warmup_kernels(
|
||||
cleanup_output.finished_req_ids = set(req_ids)
|
||||
worker_execute_model(cleanup_output)
|
||||
model_runner.kv_connector.set_disabled(False)
|
||||
if model_runner.kv_block_zeroer is not None:
|
||||
model_runner.kv_block_zeroer.zero_block_ids([0])
|
||||
torch.accelerator.synchronize()
|
||||
|
||||
Reference in New Issue
Block a user