Skip to content

Conversation

yechank-nvidia
Copy link
Collaborator

@yechank-nvidia yechank-nvidia commented Sep 30, 2025

Summary by CodeRabbit

  • Tests
    • Updated multimodal tests to use local test data instead of remote URLs, standardizing media references across image, video, and mixed cases.
    • Improves test stability, speeds up runs, removes network dependency, enables offline execution, and reduces CI flakiness.
    • No changes to public APIs or user-facing behavior.
    • Simplifies test data management across environments.

@yechank-nvidia yechank-nvidia requested a review from a team as a code owner September 30, 2025 07:49
@yechank-nvidia
Copy link
Collaborator Author

/bot run

@yechank-nvidia yechank-nvidia self-assigned this Sep 30, 2025
Copy link
Contributor

coderabbitai bot commented Sep 30, 2025

📝 Walkthrough

Walkthrough

Replaces hard-coded remote media URLs with local filesystem paths in a single test file by introducing pathlib.Path and a test_data_root. All multimodal test inputs now reference local files via str(test_data_root / ""). No public interfaces are changed.

Changes

Cohort / File(s) Summary
Qwen2.5-VL tests
tests/unittest/_torch/modeling/test_modeling_qwen2_5vl.py
Import pathlib.Path; define test_data_root; replace hard-coded HF URLs with local paths for image, multiple_image, video, and mixture_text_image test inputs; construct paths via str(test_data_root / "").

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description is entirely absent and does not include any of the required template sections such as summary, detailed description, test coverage, or the PR checklist. Please add a pull request description that completes the summary, description, test coverage, and PR checklist sections according to the repository’s template.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title follows the repository’s convention by including a valid NVBugs ID and the [fix] type, and it concisely and accurately summarizes the primary change to the image loading logic in the tests.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

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

Copy link
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

Caution

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

⚠️ Outside diff range comments (1)
tests/unittest/_torch/modeling/test_modeling_qwen2_5vl.py (1)

1-1: Add required copyright header.

Per coding guidelines, all Python source files must include the NVIDIA Apache-2.0 copyright header with the current year (2025) at the top of the file.

Add the copyright header before the imports:

+# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import os
🧹 Nitpick comments (1)
tests/unittest/_torch/modeling/test_modeling_qwen2_5vl.py (1)

111-112: Simplify using Path's division operator.

Since you're using pathlib.Path, leverage its division operator instead of mixing with os.path.join for cleaner, more idiomatic code.

Apply this diff:

-        test_data_root = Path(
-            os.path.join(llm_models_root(), "multimodals", "test_data"))
+        test_data_root = Path(llm_models_root()) / "multimodals" / "test_data"
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e87c89c and c86ee5b.

📒 Files selected for processing (1)
  • tests/unittest/_torch/modeling/test_modeling_qwen2_5vl.py (2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Use only spaces, no tabs; indent with 4 spaces.

Files:

  • tests/unittest/_torch/modeling/test_modeling_qwen2_5vl.py
**/*.py

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.py: Python code must target Python 3.8+.
Indent Python code with 4 spaces; do not use tabs.
Maintain module namespace when importing; prefer 'from package.subpackage import foo' then 'foo.SomeClass()' instead of importing the class directly.
Python filenames should be snake_case (e.g., some_file.py).
Python classes use PascalCase names.
Functions and methods use snake_case names.
Local variables use snake_case; prefix 'k' for variables that start with a number (e.g., k_99th_percentile).
Global variables use upper SNAKE_CASE prefixed with 'G' (e.g., G_MY_GLOBAL).
Constants use upper SNAKE_CASE (e.g., MY_CONSTANT).
Avoid shadowing variables from an outer scope.
Initialize all externally visible members of a class in the constructor.
Prefer docstrings for interfaces that may be used outside a file; comments for in-function or file-local interfaces.
Use Google-style docstrings for classes and functions (Sphinx-parsable).
Document attributes and variables inline so they render under the class/function docstring.
Avoid reflection when a simpler, explicit approach suffices (e.g., avoid dict(**locals()) patterns).
In try/except, catch the most specific exceptions possible.
For duck-typing try/except, keep the try body minimal and use else for the main logic.

Files:

  • tests/unittest/_torch/modeling/test_modeling_qwen2_5vl.py
**/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).

Files:

  • tests/unittest/_torch/modeling/test_modeling_qwen2_5vl.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Pre-commit Check
🔇 Additional comments (1)
tests/unittest/_torch/modeling/test_modeling_qwen2_5vl.py (1)

5-5: LGTM!

The Path import is appropriate for constructing filesystem paths in a cross-platform manner.

Comment on lines 114 to 128
if modality == "image":
return ["Describe the natural environment in the image."], \
["https://huggingface.co/datasets/YiYiXu/testing-images/resolve/main/seashore.png"]
[str(test_data_root / "seashore.png")]
elif modality == "multiple_image":
return ["Describe the difference between the two images."], \
["https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/inpaint.png",
"https://huggingface.co/datasets/Sayali9141/traffic_signal_images/resolve/main/61.jpg"]
[str(test_data_root / "inpaint.png"),
str(test_data_root / "61.jpg")]
elif modality == "video":
return ["Tell me what you see in the video briefly."], \
["https://huggingface.co/datasets/Efficient-Large-Model/VILA-inference-demos/resolve/main/OAI-sora-tokyo-walk.mp4"]
[str(test_data_root / "OAI-sora-tokyo-walk.mp4")]
elif modality == "mixture_text_image":
return ["Describe the scene in the image briefly.",
"Who invented the internet?"], \
["https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/inpaint.png",
[str(test_data_root / "inpaint.png"),
""]
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify test data files exist at the specified paths.

The local filesystem paths look correctly constructed using Path. Ensure that the test data files (seashore.png, inpaint.png, 61.jpg, OAI-sora-tokyo-walk.mp4) exist in the <llm_models_root>/multimodals/test_data/ directory before running these tests.

Run this script to verify the test data files exist:


🏁 Script executed:

#!/bin/bash
# Description: Check if test data files exist at expected locations

# Determine LLM_MODELS_ROOT (respecting env var or using default)
LLM_MODELS_ROOT="${LLM_MODELS_ROOT:-/scratch.trt_llm_data/llm-models}"
TEST_DATA_DIR="$LLM_MODELS_ROOT/multimodals/test_data"

echo "Checking test data directory: $TEST_DATA_DIR"

# Check if directory exists
if [ ! -d "$TEST_DATA_DIR" ]; then
    echo "ERROR: Test data directory does not exist: $TEST_DATA_DIR"
    exit 1
fi

# Check each required file
files=("seashore.png" "inpaint.png" "61.jpg" "OAI-sora-tokyo-walk.mp4")
missing_files=()

for file in "${files[@]}"; do
    if [ ! -f "$TEST_DATA_DIR/$file" ]; then
        missing_files+=("$file")
    fi
done

if [ ${#missing_files[@]} -gt 0 ]; then
    echo "ERROR: Missing test data files:"
    printf '  - %s\n' "${missing_files[@]}"
    exit 1
else
    echo "SUCCESS: All required test data files exist"
    ls -lh "$TEST_DATA_DIR"
fi

Length of output: 182


Test data directory missing: tests will fail

The directory ${LLM_MODELS_ROOT}/multimodals/test_data (used by test_data_root in test_modeling_qwen2_5vl.py) does not exist. Add the multimodals/test_data folder with the required files or update test_data_root to point at the correct location before running these tests.

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20351 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20351 [ run ] completed with state SUCCESS
/LLM/release-1.1/L0_MergeRequest_PR pipeline #27 completed with status: 'FAILURE'

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