Skip to content

standalone-indexer: hash image blocks from tokens only - #43

Merged
Shang-Pin merged 1 commit into
v41-partial-skipfrom
mm-plain-hash
Sep 22, 2026
Merged

Shang-Pin merged 1 commit into
v41-partial-skipfrom
mm-plain-hash

Conversation

@Shang-Pin

Copy link
Copy Markdown

Problem

vLLM attaches each image's identifier to stored blocks in extra_keys. The shared ZMQ normalizer mixes it into the block's tokens hash, but the standalone indexer's queriers hash plain token ids: deepapi's probe, and the engine local-indexer TreeDumps served by /kv_recover. Every query stops matching at a conversation's first image block, for all three flavors (reality, routing, h24).

Measured on frank/DeepSeek-V4.1-Flash, 2026-09-22:

  • deepapi or_conv complete lines: indexer 0.931 vs actual 0.923 under 100k tokens, but 0.769 vs 0.961 over 500k (long agent sessions with screenshots).
  • Live ZMQ capture of one engine pod, both DP ranks, 20 min: for chains whose first image fell in the window, a plain probe matched exactly up to the image block and an image-aware probe matched the whole chain.
chain blocks first image at plain probe image-aware probe
589 217 217 589
2432 1098 1098 2432
3054 1569 1569 3054
6450 358 358 6450

Change

  • ZmqEventNormalizer::with_plain_mm_hashing() strips block_mm_infos before conversion.
  • The standalone listener uses it. The library default is unchanged, since Dynamo's own router queries with image info.

Trade-off: prompts sharing text but carrying different images at the same position index as the same prefix, so the indexer can over-report a hit.

Validation

  • cargo test -p dynamo-kv-router --features kube-discovery --lib: 608 passed, including the new test_plain_mm_hashing_matches_token_only_probe.
  • h24 line: #(see companion PR), 615 passed.

Stacked on #41.

🤖 Generated with Claude Code

vLLM attaches each image's identifier to a stored block in extra_keys,
and the shared ZMQ normalizer mixed it into the block's tokens hash. The
standalone indexer's queriers hash plain token ids: deepapi's probe does,
and so do the engine local-indexer TreeDumps served by /kv_recover. Every
query therefore stopped matching at a conversation's first image block.

Measured on frank/DeepSeek-V4.1-Flash with a live ZMQ capture: for
chains whose first image fell in the window, a plain probe matched
exactly up to the image block (217, 1098, 1569, 358 blocks) while an
image-aware probe matched the whole chain (589, 2432, 3054, 6450). The
indexer predicted 0.77 vs actual 0.96 on prompts over 500k tokens.

Add ZmqEventNormalizer::with_plain_mm_hashing() and use it in the
standalone listener. The library default is unchanged for Dynamo's own
router, which queries with image info.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Shang-Pin
Shang-Pin deployed to external_collaborator September 22, 2026 20:53 — with GitHub Actions Active
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 22, 2026
@Shang-Pin

Copy link
Copy Markdown
Author

h24-line companion: #44 (615 tests passed there).

@Shang-Pin
Shang-Pin changed the base branch from recover-hardening to v41-partial-skip September 22, 2026 23:07
@Shang-Pin
Shang-Pin marked this pull request as ready for review September 22, 2026 23:07
@Shang-Pin
Shang-Pin merged commit 890696d into v41-partial-skip Sep 22, 2026
15 of 28 checks passed

This branch was successfully deployed

1 active deployment
external_collaborator — c707ba7a Deployed Sep 22, 2026 by Shang-Pin via ok-to-test #45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant