fix(kvevents): keep the cache salt after later MM items in the many:1 realign #4138
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 320 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.345
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #4138"
general
weight: 0.35
ahg-g
What type of PR is this?
/kind bug
What this PR does / why we need it:
vLLM v0.19 appends
cache_saltto block 0's extra keys after that block's(identifier, offset)MM tuples. When the router'sblockSizeTokensis bigger than the engine's block size,realignExtraFeaturesmerged engine blocks in engine order, so an MM item starting after engine block 0 landed after the salt ([salt img]), while the request side puts the salt after all of router block 0's items ([img salt]). Block 0's key differed, and every later key chains off it, so the whole salted multimodal prompt missed.This PR keeps the salt apart from the MM hashes:
BlockExtraFeaturesgets aCacheSaltfield. The block hash takes it afterMMHashes, so the hash input, and every existing key, stays the same.ParseRawExtraKeysstores a bare string asCacheSaltwhen any entry of the event is a tuple. The layout is decided per event: with the item starting in engine block 1, engine block 0 holds only the salt.CacheSaltto the canonical block holding its engine block, so it no longer sits between MM items.setCacheSalt, renamed fromfoldCacheSalt) setsCacheSaltinstead of appending toMMHashes.Events whose MM items are bare identifiers (vLLM v0.18.x and earlier) and salted events with no MM tuples (including SGLang's) can't tell the salt apart, so it stays in
MMHashesas before. The 1:many branch is unchanged and still copies the salt to every sub-block; that is #3788.Tests:
TestBlockStoredEvent_SaltedMMExtraKeysMatchRequestKeysfeeds salted v0.19 events (engine block 16, router block 64) and looks up the request keys: no items, an image in engine block 0, an image starting in engine block 1 (fails onmain), and the latter with a LoRA adapter.TestParseRawExtraKeys_CacheSaltcovers the parse cases, including LoRA name + item + salt in block 0 and a salted event with no tuples.TestMMFeatures_CacheSaltHashesAfterMMHasheschecks thatCacheSalthashes the same as the salt appended toMMHashes.TestRealignExtraFeaturescase for the many:1 merge with the salt alone in engine block 0.@Thisish3, could you run this through the differential harness from #3811?
Which issue(s) this PR fixes:
Fixes #3787
Release note _(write
NONEif no user-facing change)_:``
release-note
``Fixed salted multimodal prompts missing the precise prefix cache when the router's block size is larger than vLLM's and an image starts after the first engine block.