Repository navigation
[TRTLLM-14304][feat] Integrate embeddings cache with encoder side-stream - #16554
Conversation
220dd1d to
fa22df4
Compare
|
/bot run |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughChangesMultimodal model interfaces are standardized around shared encoder and language-model hooks. Gemma4 and Qwen3-VL wrappers gain centralized multimodal processing, encoder-cache support, deepstack handling, and updated token contracts. Prefetch ordering, compatibility fallbacks, tests, and supported-model documentation are updated. Multimodal model integration
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant MultimodalModelMixin
participant Gemma4MultimodalModelBase
participant VisionAudioEncoders
participant LanguageModel
MultimodalModelMixin->>Gemma4MultimodalModelBase: select multimodal params
Gemma4MultimodalModelBase->>VisionAudioEncoders: encode multimodal inputs
VisionAudioEncoders-->>Gemma4MultimodalModelBase: packed embeddings
Gemma4MultimodalModelBase->>LanguageModel: forward with multimodal extras
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/unittest/_torch/multimodal/test_multimodal_mixin.py`:
- Around line 262-269: Update test_encoder_cache_requires_model_opt_in to
reference the public encoder_cache_active property on DummyMultimodalModel
instead of the nonexistent _encoder_cache_active attribute, while preserving the
assertion that the cache is inactive and _get_multimodal_encoder_cache() returns
None.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 643c2135-56e9-45e6-92f6-84de30895f71
📒 Files selected for processing (13)
docs/source/models/supported-models.mdtensorrt_llm/_torch/models/modeling_multimodal_mixin.pytensorrt_llm/_torch/models/modeling_multimodal_utils.pytensorrt_llm/_torch/pyexecutor/_util.pytensorrt_llm/_torch/pyexecutor/model_engine.pytensorrt_llm/_torch/pyexecutor/py_executor.pytensorrt_llm/_torch/tensor_lru_cache.pytensorrt_llm/inputs/multimodal.pytensorrt_llm/llmapi/llm_args.pytests/unittest/_torch/multimodal/test_mm_encoder_cross_iter_prefetch.pytests/unittest/_torch/multimodal/test_multimodal_mixin.pytests/unittest/_torch/test_tensor_lru_cache.pytests/unittest/llmapi/test_llm_args.py
|
PR_Github #60462 [ run ] triggered by Bot. Commit: |
|
PR_Github #60462 [ run ] completed with state
|
|
/bot run |
|
PR_Github #60491 [ run ] triggered by Bot. Commit: |
|
PR_Github #60491 [ run ] completed with state
|
fa22df4 to
e084f4d
Compare
|
/bot run |
|
PR_Github #60565 [ run ] triggered by Bot. Commit: |
|
PR_Github #60565 [ run ] completed with state
|
|
/bot run |
|
PR_Github #62335 [ run ] triggered by Bot. Commit: |
|
PR_Github #62335 [ run ] completed with state
|
|
/bot run |
|
PR_Github #62564 [ run ] triggered by Bot. Commit: |
d295fba to
ba4a8a0
Compare
|
/bot run |
|
PR_Github #62579 [ run ] triggered by Bot. Commit: |
|
PR_Github #62564 [ run ] completed with state |
|
PR_Github #62579 [ run ] completed with state
|
|
/bot run |
|
PR_Github #62691 [ run ] triggered by Bot. Commit: |
|
PR_Github #62691 [ run ] completed with state
|
* Why? Side-stream multimodal encoder prefetch and the persistent embeddings cache were mutually exclusive, preventing requests from benefiting from both overlapped encoder work and cross-request embedding reuse. * What? Allow supported multimodal models to use both features together. Prefetch now reads and populates the persistent cache while preserving CUDA stream ordering and tensor lifetimes. Signed-off-by: William Zhang <[email protected]>
Signed-off-by: William Zhang <[email protected]>
Signed-off-by: William Zhang <[email protected]>
ba4a8a0 to
4d1d2f7
Compare
|
/bot run |
|
PR_Github #62811 [ run ] triggered by Bot. Commit: |
|
PR_Github #62811 [ run ] completed with state
|
|
/bot run |
|
PR_Github #62840 [ run ] triggered by Bot. Commit: |
|
PR_Github #62840 [ run ] completed with state
|
|
/bot run |
|
PR_Github #62946 [ run ] triggered by Bot. Commit: |
|
PR_Github #62946 [ run ] completed with state |
Dev Engineer Review
multimodal_token_idswith legacymm_token_idsfallback.get_language_model_extra_forward_kwargsAPI is consistent across wrappers, and verify the single-modality-per-request restriction does not regress supported use cases.QA Engineer Review
test_cross_iter_prefetch_materializes_on_side_streamtest_prepare_multimodal_indices_uses_mixin_token_idstest_prepare_multimodal_indices_uses_legacy_token_idstest_encoder_cache_reuses_image_embedding_across_requeststest_chunked_prefill_reuses_cached_vision_embeddingstest_mixed_modality_batch_preserves_request_ordertest_chunk_without_multimodal_tokens_is_inactivetest_single_request_with_multiple_modalities_raisestest_qwen3vl_deepstack_fusion_reuses_registered_bufferDescription
Test Coverage
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.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.