Repository navigation
Conversation
📝 WalkthroughWalkthroughEnhanced the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tensorrt_llm/_torch/models/modeling_llava_next.py (1)
18-21: Consider importing the module instead of individual classes/functions.Per coding guidelines, Python imports should use
from package.subpackage import moduleform to maintain namespaces. While the existing imports in this file (lines 23-28) follow the same direct-import pattern, consider aligning with the guideline for new additions.♻️ Suggested refactor
-from tensorrt_llm.inputs.multimodal import (MultimodalInput, MultimodalParams, - default_hasher, - find_mm_token_positions, - hexdigest_to_int32) +from tensorrt_llm.inputs import multimodalThen update usages:
multimodal.MultimodalInputmultimodal.MultimodalParamsmultimodal.default_hashermultimodal.find_mm_token_positionsmultimodal.hexdigest_to_int32As per coding guidelines: "Python imports must use form
from package.subpackage import module(neverfrom module import Class)".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tensorrt_llm/_torch/models/modeling_llava_next.py` around lines 18 - 21, Replace the direct imports of MultimodalInput, MultimodalParams, default_hasher, find_mm_token_positions, and hexdigest_to_int32 with a module import (import tensorrt_llm.inputs.multimodal as multimodal) and update all references in this file to use the module namespace (e.g., replace MultimodalInput -> multimodal.MultimodalInput, MultimodalParams -> multimodal.MultimodalParams, default_hasher -> multimodal.default_hasher, find_mm_token_positions -> multimodal.find_mm_token_positions, hexdigest_to_int32 -> multimodal.hexdigest_to_int32) so the file follows the package.module import guideline.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tensorrt_llm/_torch/models/modeling_llava_next.py`:
- Around line 18-21: Replace the direct imports of MultimodalInput,
MultimodalParams, default_hasher, find_mm_token_positions, and
hexdigest_to_int32 with a module import (import tensorrt_llm.inputs.multimodal
as multimodal) and update all references in this file to use the module
namespace (e.g., replace MultimodalInput -> multimodal.MultimodalInput,
MultimodalParams -> multimodal.MultimodalParams, default_hasher ->
multimodal.default_hasher, find_mm_token_positions ->
multimodal.find_mm_token_positions, hexdigest_to_int32 ->
multimodal.hexdigest_to_int32) so the file follows the package.module import
guideline.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7ee1b4bd-cbf9-4f71-a999-41d0a5b31294
📒 Files selected for processing (1)
tensorrt_llm/_torch/models/modeling_llava_next.py
|
@NVIDIA/trt-llm-torch-models-vlm-devs Hi could you take a look at this? It is a multimodal issue. Maybe @chang-l can take a look as you are the author of this file? Thanks! |
|
👋 As part of an effort to reduce the TensorRT-LLM open-PR backlog, we're checking in on PRs with no activity in over 120 days. This one qualifies. Could you let us know whether you still plan to land it?
If we don't hear back within 14 days, we'll close this PR to keep the review queue manageable. Closing isn't a rejection: the branch, commits, and discussion are all preserved, and you can reopen or resubmit at any time. Thanks for the contribution! |
|
👋 Closing this as part of the TensorRT-LLM open-PR backlog cleanup. We pinged on 2026-08-10 about 120+ days of inactivity and didn't hear back within the 14-day window. This isn't a rejection — your branch, commits, and discussion are all preserved. If it's still relevant, just reopen the PR any time and we'll pick it back up; please rebase onto the latest |
Why
When LLaVA-Next receives pre-computed (raw) embeddings from an external encoder, the
_process_raw_embeddingpath does not producemultimodal_inputmetadata. Without it, the KV cache block-reuse mechanism cannot identify which token spans correspond to multimodal content, so cached KV blocks are never matched — defeating prefix caching for the disaggregated encode → prefill → decode pipeline.What Changed
_process_raw_embedding, compute per-image token counts, content-based hashes (default_hasher/hexdigest_to_int32), and start positions (find_mm_token_positions), then build aMultimodalInputand return it alongside the embeddings so the KV cache reuse path has the same metadata as the vision-processing path.Test Plan
e_pd_embedding_e2e_test.sh)Prior to this PR, I will get the below error with the 2nd identical request (because of KV cache hit)
After this PR, multiple identical requests will yield successfully with identical response
Summary by CodeRabbit