style: cargo fmt --workspace (whitespace/wrapping only, no semantic change)
Whole-workspace rustfmt pass picked up while iterating on Mamba GPU backward work. Verified formatting-only via diff sampling; no logic changed. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
@@ -564,7 +564,6 @@ pub struct BatchScheduler {
|
||||
last_stats_reset: Arc<RwLock<Instant>>,
|
||||
|
||||
// ── Prefix / SnapKV integration ─────────────────────────────────────────
|
||||
|
||||
/// Optional paged KV cache used for prefix-cache lookups.
|
||||
///
|
||||
/// When `Some`, [`submit_request`] checks for a matching prefix in the
|
||||
@@ -653,11 +652,8 @@ impl BatchScheduler {
|
||||
// under contention; fall back to a miss if the lock is busy.
|
||||
if let Ok(cache) = cache_arc.try_lock() {
|
||||
if cache.prefix_caching_enabled() {
|
||||
let tokens_u32: Vec<u32> = request
|
||||
.input_tokens
|
||||
.iter()
|
||||
.map(|&t| t as u32)
|
||||
.collect();
|
||||
let tokens_u32: Vec<u32> =
|
||||
request.input_tokens.iter().map(|&t| t as u32).collect();
|
||||
let pages = cache.lookup_prefix(&tokens_u32);
|
||||
if pages.is_some() {
|
||||
debug!(
|
||||
@@ -1248,7 +1244,10 @@ mod tests {
|
||||
|
||||
// No prefix was registered, so there should be no hit pages.
|
||||
let hit_pages = scheduler.get_prefix_hit_pages(request_id).await;
|
||||
assert!(hit_pages.is_none(), "Expected no prefix-cache hit on empty cache");
|
||||
assert!(
|
||||
hit_pages.is_none(),
|
||||
"Expected no prefix-cache hit on empty cache"
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
@@ -1288,7 +1287,10 @@ mod tests {
|
||||
|
||||
// Now the prefix should be in the cache.
|
||||
let hit = cache_arc.lock().await.lookup_prefix(&prompt_tokens_u32);
|
||||
assert!(hit.is_some(), "Prefix should be registered after notify_prefill_complete");
|
||||
assert!(
|
||||
hit.is_some(),
|
||||
"Prefix should be registered after notify_prefill_complete"
|
||||
);
|
||||
assert_eq!(hit.unwrap(), vec![page_id]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user