Repository navigation
[TRTLLM-15824][feat] Enable EVS handoff for Nemotron-H in EPD - #19702
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: NVIDIA/TensorRT-LLM/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughThe encoder records per-video retained-token counts, and the executor carries them with multimodal embedding handles. Disaggregated prefill validates those counts and uses them to rebuild video placeholder layouts. Attached embeddings bypass the raw-input EVS merge path. ChangesEVS video embedding handoff
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant NemotronHMultimodalEncoder
participant MultimodalEncoderRunner
participant MultimodalResult
participant EarlyStopWithMMResult
participant PyResult
NemotronHMultimodalEncoder->>MultimodalEncoderRunner: Provide video embeddings with retained-count metadata
MultimodalEncoderRunner->>MultimodalResult: Return embeddings and aligned metadata
MultimodalResult->>EarlyStopWithMMResult: Validate metadata count against embeddings
EarlyStopWithMMResult->>PyResult: Pass per-embedding metadata
PyResult->>PyResult: Attach metadata to embedding handles
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The video handoff preserves retained-token metadata and finalized prompt layouts. No actionable merge-blocking risk remains; end-to-end execution was not verified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Preserve per-tubelet retained-token counts in encoder results and carry per-item metadata through the runner, sampler, and embedding handles. Use those counts to finalize video prompt layouts before prefill scheduling and consume attached embeddings without repeating the EVS layout rewrite. Forward the configured pruning rate to encoder preprocessing and validate handoff counts against tubelet and embedding sizes. Cover sparse result batches, singleton and multiple videos, zero-token tubelets, malformed metadata, and chunked prefill with CPU regression tests. Signed-off-by: Yueh-Ting Chen <[email protected]>
560c87e to
87219cd
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #75820 [ run ] triggered by Bot. Commit: |
mikeiovine
left a comment
There was a problem hiding this comment.
Stamp on behalf of runtime devs, delegating proper review to @NVIDIA/trt-llm-models-devs; please ping me if you think this is not accurate
|
PR_Github #75820 [ run ] completed with state
|
yechank-nvidia
left a comment
There was a problem hiding this comment.
LGTM on modeling-side.
|
Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
/bot run --disable-fail-fast |
|
PR_Github #75965 [ run ] triggered by Bot. Commit: |
|
PR_Github #75965 [ run ] completed with state
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Semantic conflict reviewThe verdict of record is the Latest recorded state: No semantic conflict found (best effort) for head Best-effort AI judgment for the recorded revisions. PASS, FAIL and INCONCLUSIVE may be incomplete or incorrect. PR authors and reviewers should independently verify the evidence and relevant behavior. This semantic review and its status/workflow are advisory, not required merge checks under current repository rules; other merge requirements still apply. Advisory status does not make a confirmed defect safe to ignore.
Processed request and reply comments are minimized to reduce timeline noise; they remain expandable for audit. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
/bot skip --comment "Skipping CI. Locally verifyied running EPD with EVS." |
|
PR_Github #76057 [ skip ] triggered by Bot. Commit: |
|
PR_Github #76057 [ skip ] completed with state |
Nemotron-H already supports EVS in aggregated inference, but its encoder-to-prefill handoff did not preserve the retained-token layout needed for EVS under EPD. This MR enables that handoff for video-only requests, including multiple videos per request; audio and mixed-modality handoff remain unsupported.
Other model families have separate support gaps:
These gaps can be addressed in follow-up MRs, keeping this MR’s EVS enablement scoped to Nemotron-H.
The shared changes forward
video_pruning_rateto encoder preprocessing and transport optional per-item metadata through the runner, sampler, and embedding handles without interpreting its contents. Nemotron-H produces per-tubelet retained-token counts and uses them on prefill to validate and finalize the prompt layout before scheduling. Prefill then consumes the attached embeddings without repeating the EVS layout rewrite.Validation:
test_handoff_rebuilds_pruned_video_layoutcovers prompt reconstruction;test_mm_encoder_handoff_preserves_per_item_metadata_in_sparse_batchcovers the combined runner-to-handle transport.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.
Dev Engineer Review
The change passes per-video retained-token counts from the encoder through embedding handles to Nemotron-H disaggregated prefill. The prefill path uses those counts to rebuild the video prompt layout and avoids reapplying the EVS rewrite to attached embeddings. The metadata transport adds an optional argument to
PyResult.append_mm_embeddings; calls without metadata retain the prior behavior.The documented scope is video-only. Audio and mixed-modality handoff remain unsupported. Follow-up work is identified for Qwen2.5-VL, Qwen3-VL, Qwen3.5, and Cosmos3. Runtime validation remains pending; pytest collection was reported blocked by missing
mpi4py. Current review findings were not provided.QA Engineer Review
Two unit-test files changed. They cover sparse-batch metadata transport and Nemotron-H EVS handoff, including singleton and multiple videos, tokenized and text prompts, zero-token tubelets, invalid retained-count metadata, and chunked prefill. Neither test file appears in the searched
test-db/CI orqa/manual-QA lists. The tests exercise the new handoff paths, but integration-list coverage and runtime validation need follow-up. Coverage verdict: needs follow-up.Per-File QA Perspective
tensorrt_llm/_torch/models/modeling_nemotron_h_multimodal.py— Verify retained-count validation, prompt-layout reconstruction, and prefill with attached video embeddings. Confirm behavior for EVS-disabled requests and unsupported mixed-modality inputs.tensorrt_llm/_torch/pyexecutor/engine/runners/mm_encoder.py— Verify metadata remains aligned with payload-bearing items in sparse encoder batches.tensorrt_llm/_torch/pyexecutor/llm_request.py— Verify optional metadata is matched to embedding lengths and stored on the corresponding handles. The API change should preserve calls that omit metadata.tensorrt_llm/_torch/pyexecutor/sampler/sampler.py— Verify batch-size validation and per-item metadata forwarding; confirm batches without metadata retain their existing behavior.tensorrt_llm/llmapi/mm_encoder.py— Verify configuredvideo_pruning_ratereaches input-processor creation, and that no keyword is passed when the value isNone.tests/unittest/_torch/executor/engine/test_runners.py— Covers sparse encoder batches, embedding serialization, and video metadata transport. No matching entry was found in the searched CI or manual-QA lists.tests/unittest/_torch/modeling/test_modeling_nemotron_h_multimodal.py— Setsvideo_pruning_ratein the handoff fixture and removes the prior rejection test for EVS video embeddings. No matching entry was found in the searched CI or manual-QA lists.tests/unittest/_torch/modeling/test_nemotron_h_multimodal_preprocessing.py— Adds EVS handoff layout and invalid-metadata checks, encoder metadata tests, and prefill tests for regular and chunked inputs. No matching entry was found in the searched CI or manual-QA lists.