Unverified Commit e450c2c7 authored by Alec's avatar Alec Committed by GitHub
Browse files

fix: dynamo-run add warning if block-size different (#1233)

parent 4426e937
......@@ -185,6 +185,16 @@ impl ModelManager {
kv_cache_block_size: usize,
) -> anyhow::Result<Arc<KvRouter>> {
if let Some(kv_chooser) = self.get_kv_chooser(model_name) {
// Check if the existing router has a different block size
if kv_chooser.block_size() != kv_cache_block_size {
tracing::warn!(
model_name = %model_name,
existing_block_size = %kv_chooser.block_size(),
requested_block_size = %kv_cache_block_size,
"KV Router block size mismatch! Model is requesting a different kv_cache_block_size than the existing router. \
This will cause routing to fail silently. Consider using the same block size or restarting the router."
);
}
return Ok(kv_chooser);
}
self.create_kv_chooser(model_name, component, kv_cache_block_size)
......
......@@ -144,6 +144,11 @@ impl KvRouter {
let worker_id = self.scheduler.schedule(overlap_scores, isl_tokens).await?;
Ok(worker_id)
}
/// Get the block size this router was configured with
pub fn block_size(&self) -> usize {
self.block_size
}
}
#[async_trait]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment