Skip to content

[https://nvbugs/5813192][fix] Make trust_remote_code opt-in in MultimodalModelRunner#12669

Merged
yibinl-nvidia merged 2 commits intoNVIDIA:mainfrom
yibinl-nvidia:fix/trust-remote-code-5813192
Apr 8, 2026
Merged

[https://nvbugs/5813192][fix] Make trust_remote_code opt-in in MultimodalModelRunner#12669
yibinl-nvidia merged 2 commits intoNVIDIA:mainfrom
yibinl-nvidia:fix/trust-remote-code-5813192

Conversation

@yibinl-nvidia
Copy link
Copy Markdown
Collaborator

@yibinl-nvidia yibinl-nvidia commented Apr 1, 2026

Summary by CodeRabbit

  • New Features
    • Added --trust_remote_code CLI flag for multimodal model loading, enabling users to control remote code execution during model initialization (disabled by default for enhanced security).

Description

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)

  • 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.

@yibinl-nvidia yibinl-nvidia self-assigned this Apr 1, 2026
@yibinl-nvidia yibinl-nvidia requested review from a team as code owners April 1, 2026 21:07
Signed-off-by: Yibin Li <109242046+yibinl-nvidia@users.noreply.github.com>
@yibinl-nvidia yibinl-nvidia force-pushed the fix/trust-remote-code-5813192 branch from 800b96b to d5b0ce4 Compare April 1, 2026 21:11
@yibinl-nvidia yibinl-nvidia changed the title [https://nvbugs/1234567][fix] Make trust_remote_code opt-in in MultimodalModelRunner [https://nvbugs/5813192][fix] Make trust_remote_code opt-in in MultimodalModelRunner Apr 1, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

📝 Walkthrough

Walkthrough

A CLI flag --trust_remote_code is added to the argument parser, and the corresponding runtime code is updated to use this configurable flag via getattr instead of always hardcoding trust_remote_code=True when loading Hugging Face models, tokenizers, and processors.

Changes

Cohort / File(s) Summary
CLI Argument Definition
examples/models/core/multimodal/utils.py
Added --trust_remote_code boolean flag (action='store_true', default=False) to the argument parser in add_common_args().
Runtime Configuration
tensorrt_llm/runtime/multimodal_model_runner.py
Updated model, tokenizer, and processor loading to use configurable trust_remote_code via getattr(self.args, "trust_remote_code", False) instead of hardcoding trust_remote_code=True across multiple Hugging Face loading call sites.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete. It contains only the template structure with placeholder comments and a checked checklist item, but lacks any actual description of the issue, solution, or test coverage information. Provide a detailed description of the issue being fixed, the solution implemented, and list the relevant tests that validate these changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: making trust_remote_code opt-in in MultimodalModelRunner, and properly includes the NVBugs ticket and fix type.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@examples/models/core/multimodal/utils.py`:
- Around line 130-136: The return parser is incorrectly indented inside the
parser.add_argument(...) call causing a syntax error; move the return statement
out to the same indentation level as the parser.add_argument(...) call so that
return parser executes after the add_argument call (locate the
parser.add_argument invocation for '--trust_remote_code' and un-indent the
return parser to be outside that call).
🪄 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: Pro

Run ID: 52b92403-9ee6-4ffd-bd92-919bc661cc65

📥 Commits

Reviewing files that changed from the base of the PR and between b427d3b and d5b0ce4.

📒 Files selected for processing (2)
  • examples/models/core/multimodal/utils.py
  • tensorrt_llm/runtime/multimodal_model_runner.py

Comment thread examples/models/core/multimodal/utils.py Outdated
Signed-off-by: Yibin Li <109242046+yibinl-nvidia@users.noreply.github.com>
@yibinl-nvidia
Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #41571 [ run ] triggered by Bot. Commit: 555dbf1 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #41571 [ run ] completed with state SUCCESS. Commit: 555dbf1
/LLM/main/L0_MergeRequest_PR pipeline #32482 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@yibinl-nvidia
Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #41685 [ run ] triggered by Bot. Commit: 555dbf1 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #41685 [ run ] completed with state SUCCESS. Commit: 555dbf1
/LLM/main/L0_MergeRequest_PR pipeline #32587 completed with status: 'SUCCESS'

CI Report

Link to invocation

@yibinl-nvidia yibinl-nvidia merged commit 01cf581 into NVIDIA:main Apr 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants