[TRTLLM-12417][feat] Exact multimodal cache hashing + EPD unlock for videos#13724
Closed
venkywonka wants to merge 27 commits into
Closed
[TRTLLM-12417][feat] Exact multimodal cache hashing + EPD unlock for videos#13724venkywonka wants to merge 27 commits into
venkywonka wants to merge 27 commits into
Conversation
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Validation: - Local rc13 feature container: pytest tests/unittest/inputs/test_inputs_multimodal_item_runs.py tests/unittest/_torch/executor/test_kv_cache_v2_multimodal_item_runs.py tests/unittest/disaggregated/test_disaggregated_multimodal_item_runs.py -q => 21 passed, 2 warnings. - Lyris GB200 source-built feature env: post-build focused validation => 21 passed, 5 warnings; import-origin red_flags=[]; CUDA smoke saw NVIDIA GB200. - Lyris binding probe: multimodal_item_runs=True and multimodal_hash_positions=False. - Local Qwen2-VL-2B MMMU 30-image A/B smoke: upstream baseline 40.0, feature 40.0, delta 0.0. Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
Signed-off-by: venkywonka <23023424+venkywonka@users.noreply.github.com>
venkywonka
force-pushed
the
mm-cache-hash-span-contract-narrow-validated
branch
from
May 6, 2026 05:16
d94c103 to
bd07578
Compare
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR makes multimodal prompt-layout bookkeeping exact for non-contiguous multimodal token layouts.
The PR also pipecleans metadata transport to enable video support for EPD disagg.
The legacy cache contract reduced each multimodal item
to a single approximate prompt span. That loses the real prompt geometry when an
item is represented by multiple prompt-token runs or when special wrapper tokens
belong to the multimodal layout but do not consume encoder-output rows.
The PR introduces
multimodal_item_runsas the canonical internal layout. Eachmultimodal item carries ordered contiguous prompt-token runs, plus local
non_embed_offsetsfor multimodal wrapper tokens.Runtime code derives
embedding lengths, prompt lengths, cache-key spans, disaggregated prompt
expansion, and backend request metadata from that canonical layout.
Goals
lossy single start/length span.
nanobind bindings, executor request construction, serialization, Triton
backend request transport, and disaggregated handoff.
framing gaps do not inherit multimodal content hashes, while later sparse
multimodal islands still get the correct hash and item offset.
video layouts where markers do not one-to-one map to contiguous embeddings. This unlocks EPD for videos.
PR; multimodal disaggregated JSON transport remains a follow-up.
Review Map
tensorrt_llm/inputs/, multimodal modeling helpers, and focused input tests.C++ executor/batch-manager request types, nanobind bindings, pyexecutor
request plumbing,
MultimodalInputserialization, and serialization tests.C++ block-key generation, KV-cache manager tests, Python V2 resource-manager
cache-key estimation, cache-event tests, and item-run offset handling.
DisaggregatedParams, LLM preprocessing, result handoff, Qwen VL promptexpansion, and disaggregated item-run tests.
Triton inflight batcher utilities and tests for validated item-run transport.
Qwen3.5 MoE VLM custom model/shim paths and tests for single-run item staging
plus explicit sparse same-item rejection.
OpenAI protocol/server paths now avoid exposing non-JSON-safe multimodal
disaggregated state in this PR.
Test Coverage
blockKeyTestkvCacheManagerTestmultimodalInputTestserializeUtilsTestutilsTestrewrite:
git diff --checkpassedaccuracy 40.0,
mm_keys=654feature; both returned the same multimodal response
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why.
PR follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths.
Any new dependencies have been scanned for license and vulnerabilities.
CODEOWNERS updated if ownership changes.
Documentation updated as needed.
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.