Skip to content

[https://nvbugs/5800725][fix] Always construct AutoProcessor and assign it to self.text_processor; keep Mistra#14072

Closed
tensorrt-cicd wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug5800725
Closed

[https://nvbugs/5800725][fix] Always construct AutoProcessor and assign it to self.text_processor; keep Mistra#14072
tensorrt-cicd wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug5800725

Conversation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

@tensorrt-cicd tensorrt-cicd commented May 13, 2026

Summary

  • Root cause: For mistral_large_3 self.text_processor was bound to MistralCommonImageProcessor, whose call requires a positional images arg.
  • Fix: Always construct AutoProcessor and assign it to self.text_processor; keep MistralCommonImageProcessor only as the multimodal processor for text+image inputs.
  • Automated fix generated by repair-bot

Test plan

  • Verify fix on the same GPU type as the original failure
  • Check for regressions in related tests

Links

Summary by CodeRabbit

  • Refactor
    • Updated internal Mistral model input processing logic to improve handling of different model variants.

Review Change Stack

…only path

MistralCommonImageProcessor.__call__ requires an images positional
argument and always applies apply_chat_template, so text-only inputs
(e.g. MMLU/GSM8K prompts) raised TypeError before any inference could
run. Construct AutoProcessor unconditionally and use it as
text_processor for mistral_large_3, matching the intent documented in
the adjacent comment.

Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

📝 Walkthrough

Walkthrough

Mistral3InputProcessor.__init__ refactors processor initialization by loading AutoProcessor unconditionally before the model_type conditional. For mistral_large_3, MistralCommonImageProcessor becomes the primary processor; for other types, auto_processor is used.

Changes

Processor Initialization Logic

Layer / File(s) Summary
Processor initialization refactoring
tensorrt_llm/_torch/models/modeling_mistral.py
AutoProcessor.from_pretrained is loaded unconditionally before model_type branching. The conditional assigns MistralCommonImageProcessor as _processor for mistral_large_3 (with auto_processor as text_processor), while other model types use auto_processor as _processor.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title references a valid NVBugs ID and includes a 'fix' type tag, but is incomplete/truncated, cutting off mid-word at 'Mistra'. Complete the title by adding the missing words after 'Mistra'. The full title should clearly describe what is being kept or fixed for Mistral models.
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 (3 passed)
Check name Status Explanation
Description check ✅ Passed The description includes a summary of root cause and fix, references the bug ticket, and notes that tests were performed, but lacks detail on which specific tests were run.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tensorrt_llm/_torch/models/modeling_mistral.py (1)

1-1: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add/update the NVIDIA copyright header for this modified source file.

This file is modified in the PR but currently has no NVIDIA copyright header at the top.

As per coding guidelines: "All TensorRT-LLM source files (.cpp, .h, .cu, .py) must contain an NVIDIA copyright header with the year of latest meaningful modification."

🤖 Prompt for 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.

In `@tensorrt_llm/_torch/models/modeling_mistral.py` at line 1, Add an NVIDIA
copyright header at the very top of the modified Python source file
modeling_mistral.py indicating the year of the latest meaningful modification;
insert the standard multi-line NVIDIA header (matching other TensorRT-LLM source
files) including the correct year and copyright line before any imports (e.g.,
before the existing "import copy"), and ensure the header format matches project
guidelines for .py files.
🤖 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.

Outside diff comments:
In `@tensorrt_llm/_torch/models/modeling_mistral.py`:
- Line 1: Add an NVIDIA copyright header at the very top of the modified Python
source file modeling_mistral.py indicating the year of the latest meaningful
modification; insert the standard multi-line NVIDIA header (matching other
TensorRT-LLM source files) including the correct year and copyright line before
any imports (e.g., before the existing "import copy"), and ensure the header
format matches project guidelines for .py files.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: be0aa801-e18b-4aed-833e-a33ac6a51f44

📥 Commits

Reviewing files that changed from the base of the PR and between c3dce70 and 3d509c9.

📒 Files selected for processing (1)
  • tensorrt_llm/_torch/models/modeling_mistral.py

@byshiue
Copy link
Copy Markdown
Collaborator

byshiue commented May 13, 2026

/bot run --only-multi-gpu-test --stage-list "GB200-4_GPUs-PyTorch-Post-Merge-1"

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator Author

PR_Github #48147 [ run ] triggered by Bot. Commit: 3d509c9 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator Author

PR_Github #48147 [ run ] completed with state SUCCESS. Commit: 3d509c9
/LLM/main/L0_MergeRequest_PR pipeline #37970 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

@byshiue
Copy link
Copy Markdown
Collaborator

byshiue commented May 14, 2026

/bot run --only-multi-gpu-test

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator Author

PR_Github #48259 [ run ] triggered by Bot. Commit: 3d509c9 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator Author

PR_Github #48259 [ run ] completed with state SUCCESS. Commit: 3d509c9
/LLM/main/L0_MergeRequest_PR pipeline #38073 (Partly Tested) 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

CI Agent Failure Analysis

Link to invocation

@byshiue
Copy link
Copy Markdown
Collaborator

byshiue commented May 15, 2026

/bot run

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator Author

PR_Github #48477 [ run ] triggered by Bot. Commit: 3d509c9 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator Author

PR_Github #48477 [ run ] completed with state SUCCESS. Commit: 3d509c9
/LLM/main/L0_MergeRequest_PR pipeline #38272 completed with status: 'SUCCESS'

CI Report

Link to invocation

@byshiue
Copy link
Copy Markdown
Collaborator

byshiue commented May 26, 2026

/bot run

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator Author

PR_Github #50296 [ run ] triggered by Bot. Commit: 3d509c9 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator Author

PR_Github #50296 [ run ] completed with state ABORTED. Commit: 3d509c9
LLM/main/L0_MergeRequest_PR #39826 (Blue Ocean) completed with status: ABORTED

Link to invocation

@byshiue byshiue closed this May 28, 2026
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.

2 participants