Skip to content

Conversation

venkywonka
Copy link
Collaborator

@venkywonka venkywonka commented Oct 21, 2025

Summary by Author

  • Initially, the guidance was to avoid including the ATTRIBUTIONS-Python.md in the wheel, as it is not "shipped" along with the wheel. But updated guidance recommends to include it.

Summary by CodeRabbit

  • Refactor
    • Consolidated platform-specific license file handling into a centralized utility, ensuring correct attribution files are bundled for x86_64 and ARM64 architectures during package installation.

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

  • 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

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

For guidance on mapping tests to stage names, see docs/source/reference/ci-overview.md
and the scripts/test_to_stage_mapping.py helper.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

@venkywonka venkywonka requested a review from a team as a code owner October 21, 2025 17:16
@venkywonka
Copy link
Collaborator Author

/bot run --skip-test

@coderabbitai coderabbitai bot changed the title [None] @coderabbitai title [None] [refactor] Extract license selection into utility Oct 21, 2025
@venkywonka venkywonka self-assigned this Oct 21, 2025
@venkywonka venkywonka changed the title [None] [refactor] Extract license selection into utility [None] [refactor] Include Python attributions Oct 21, 2025
@venkywonka venkywonka changed the title [None] [refactor] Include Python attributions [None] [refactor] Include Python attributions in wheel packaging Oct 21, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 21, 2025

📝 Walkthrough

Walkthrough

The changes refactor platform-specific license file selection by extracting the logic from setup.py into a new centralized utility function get_license_files() in tensorrt_llm._packaging_utils.py. The test file is updated to use this new utility instead of duplicating the platform detection logic.

Changes

Cohort / File(s) Summary
Package configuration
setup.py
Removed old get_license() function and replaced its usage in the license_files parameter with a call to the new get_license_files() utility; added import from tensorrt_llm._packaging_utils.
Licensing utility
tensorrt_llm/_packaging_utils.py
Added new public function get_license_files() that determines platform-specific license files (x86_64, arm64, or aarch64) using sysconfig.get_platform(), raising RuntimeError for unrecognized platforms.
Test updates
tests/unittest/test_pip_install.py
Removed get_expected_license_files() logic and updated verify_license_files() to import and call get_license_files() from the packaging utility at runtime instead of duplicating platform detection.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

The changes follow a consistent refactoring pattern—moving existing platform-detection logic to a centralized location. The new function is straightforward, and the affected files implement a homogeneous transformation with minimal complexity.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description Check ⚠️ Warning The PR description is largely incomplete compared to the repository's template requirements. While the author provided a brief one-line summary explaining the rationale for the change (updating guidance to include ATTRIBUTIONS-Python.md), the critical sections for Description and Test Coverage are empty except for placeholder comments. The PR Checklist section is also incomplete with only one item checked but no substantive information provided about adherence to coding guidelines, test cases provided, dependency scanning, or reviewer appropriateness. The template explicitly requests clear explanations of what and why, relevant test cases, and verification of multiple checklist items.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "[None] [refactor] Include Python attributions in wheel packaging" directly aligns with the main objective of the changeset. The raw summary shows that the core change is refactoring the license file selection logic by extracting it from setup.py to a centralized utility function while ensuring Python attribution files are included in the wheel across different architectures. The title accurately captures both the refactoring nature of the change and the specific inclusion of Python attributions, making it clear and actionable.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • 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

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: 0

🧹 Nitpick comments (1)
tensorrt_llm/_packaging_utils.py (1)

18-35: Consider adding return type annotation and addressing static analysis hint.

The platform detection logic is correct and appropriately raises an error for unsupported architectures.

Optional improvements:

  1. Add return type annotation to the function signature: def get_license_files() -> List[str]:
  2. Per static analysis (TRY003), consider shortening the exception message or creating a custom exception class.

Apply this diff to add the return type annotation:

+from typing import List
+
 def get_license_files():
+def get_license_files() -> List[str]:
     """Get the list of license files to include in the package based on platform.

For the exception message, you could simplify it:

     else:
-        raise RuntimeError(f"Unrecognized CPU architecture: {platform_tag}")
+        raise RuntimeError(f"Unsupported platform: {platform_tag}")

Or create a custom exception (more elaborate):

class UnsupportedPlatformError(RuntimeError):
    """Raised when the CPU architecture is not supported."""
    pass

# Then use:
raise UnsupportedPlatformError(f"Platform {platform_tag} is not supported")
📜 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 8dc4aac and a6ee1f5.

📒 Files selected for processing (3)
  • setup.py (2 hunks)
  • tensorrt_llm/_packaging_utils.py (1 hunks)
  • tests/unittest/test_pip_install.py (1 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:

  • tensorrt_llm/_packaging_utils.py
  • tests/unittest/test_pip_install.py
  • setup.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:

  • tensorrt_llm/_packaging_utils.py
  • tests/unittest/test_pip_install.py
  • setup.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:

  • tensorrt_llm/_packaging_utils.py
  • tests/unittest/test_pip_install.py
  • setup.py
🧬 Code graph analysis (2)
tests/unittest/test_pip_install.py (1)
tensorrt_llm/_packaging_utils.py (1)
  • get_license_files (18-35)
setup.py (1)
tensorrt_llm/_packaging_utils.py (1)
  • get_license_files (18-35)
🪛 Ruff (0.14.1)
tensorrt_llm/_packaging_utils.py

35-35: Avoid specifying long messages outside the exception class

(TRY003)

🔇 Additional comments (4)
tensorrt_llm/_packaging_utils.py (1)

1-15: LGTM!

The Apache 2.0 license header with the current year (2025) and module docstring comply with the coding guidelines.

tests/unittest/test_pip_install.py (1)

11-13: LGTM! Excellent use of lazy import pattern.

The lazy import of get_license_files() inside the function, after package installation, correctly ensures that the test validates the installed package's behavior. The comment clearly explains the rationale.

setup.py (2)

23-24: LGTM! Proper centralization of license file selection.

The import of get_license_files() from the local source tree at setup time is correct and eliminates code duplication.


249-249: LGTM! Clean usage of the centralized utility function.

The use of get_license_files() for the license_files parameter correctly delegates platform-specific logic to the shared utility.

@tensorrt-cicd
Copy link
Collaborator

PR_Github #22079 [ run ] triggered by Bot. Commit: a6ee1f5

@tensorrt-cicd
Copy link
Collaborator

PR_Github #22079 [ run ] completed with state FAILURE. Commit: a6ee1f5
/LLM/main/L0_MergeRequest_PR pipeline #16648 (Partly Tested) 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