From b21ed583acca55acc6c41a737b7794009a09545f Mon Sep 17 00:00:00 2001 From: OlivierDehaene <23298448+OlivierDehaene@users.noreply.github.com> Date: Tue, 18 Jun 2024 13:56:16 +0200 Subject: [PATCH] fix logic --- Cargo.toml | 4 ---- router/src/infer/v3/scheduler.rs | 11 +++++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bc2da5a1..552c0bff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,10 +20,6 @@ tokenizers = { version = "0.19.1", features = ["http"] } hf-hub = { version = "0.3.1", features = ["tokio"] } [profile.release] -incremental = true - -[profile.release-binary] -inherits = "release" debug = 1 incremental = true panic = "abort" diff --git a/router/src/infer/v3/scheduler.rs b/router/src/infer/v3/scheduler.rs index 23a80764..3c7c59f5 100644 --- a/router/src/infer/v3/scheduler.rs +++ b/router/src/infer/v3/scheduler.rs @@ -407,14 +407,13 @@ async fn filter_batch( .block_allocation .as_ref() .map(|alloc| { - let max_blocks = match max_blocks { - Some(max_blocks) => max_blocks, - _ => unreachable!(), - }; - let blocks = alloc.blocks().to_vec(); let mut padded_blocks = blocks.clone(); - padded_blocks.resize(max_blocks - padded_blocks.len(), 0); + + if let Some(max_blocks) = max_blocks { + padded_blocks.resize(max_blocks, 0); + } + (blocks, padded_blocks) }) .unwrap_or_default();