Skip to content

Conversation

QiJune
Copy link
Collaborator

@QiJune QiJune commented Oct 22, 2025

Summary by CodeRabbit

  • Refactor
    • Reorganized cache transceiver configuration handling and module imports to improve internal code structure and maintainability.
    • Streamlined configuration conversion and backend selection logic for consistency across components.

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.

@QiJune QiJune requested review from a team as code owners October 22, 2025 01:35
@QiJune
Copy link
Collaborator Author

QiJune commented Oct 22, 2025

/bot run

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

📝 Walkthrough

Walkthrough

The changes refactor CacheTransceiverConfig import locations from bindings.executor to llmapi.llm_args, eliminate PybindMirror wrapper indirection, transition backend selection logic from enum constants to string literals, and consolidate pybind conversion calls at usage sites.

Changes

Cohort / File(s) Summary
Config import consolidation
tensorrt_llm/_torch/pyexecutor/_util.py, tensorrt_llm/_torch/pyexecutor/kv_cache_transceiver.py
Import CacheTransceiverConfig from tensorrt_llm.llmapi.llm_args instead of tensorrt_llm.bindings.executor; update type annotations to use the new import location
Backend selection and conversion logic
tensorrt_llm/_torch/pyexecutor/kv_cache_transceiver.py
Replace enum-based backend constants (DEFAULT, NIXL, UCX, MPI) with string literals; update environment variable mapping and comparisons; add ._to_pybind() conversion calls when passing cache_transceiver_config to underlying bindings constructors
PybindMirror removal
tensorrt_llm/_torch/pyexecutor/py_executor_creator.py
Remove PybindMirror import and conversion; pass cache_transceiver_config directly from llm_args without PybindMirror.maybe_to_pybind() wrapping

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

The changes involve heterogeneous modifications across three files: import path consolidation, backend selection logic refactoring with string literal conversions, and removal of a wrapper layer. While individual changes are straightforward, the distributed nature and interaction between removal of PybindMirror indirection and addition of direct ._to_pybind() calls requires careful verification of the conversion flow and backend handling correctness.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description is incomplete and fails to meet the template requirements. While the description follows the correct PR title format with the JIRA ticket and chore type, the critical content sections are empty: the "Description" section (which should explain the issue and solution) contains only an HTML comment placeholder, and the "Test Coverage" section is also blank. Without these sections, readers lack essential information about what changes were made, why they were necessary, and what test coverage validates the changes. The checklist shows minimal engagement (only one item marked), further indicating incomplete preparation of the PR. The PR author should fill in the Description section with a clear explanation of the refactoring—specifically why limiting the scope of pybind-based CacheTransceiverConfig is beneficial and how the import path and conversion logic changes achieve this goal. Additionally, the Test Coverage section must list the specific tests (or test files) that validate these changes, such as tests covering the modified files (py_executor_creator.py, kv_cache_transceiver.py, and _util.py). Finally, the author should review and check the appropriate items in the PR Checklist to demonstrate thorough preparation.
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 PR title "[TRTLLM-8812][chore] Limit the scope of pybind based CacheTransceiverConfig" accurately reflects the primary changes in the changeset. According to the raw summary, the pull request refactors how CacheTransceiverConfig's pybind conversion is handled across multiple files—moving the import source, removing PybindMirror conversion in py_executor_creator.py, and centralizing the pybind conversion to specific call sites in kv_cache_transceiver.py via the ._to_pybind() method. The title is specific, clear, and conveys the main intent of limiting/narrowing the scope of pybind-based CacheTransceiverConfig usage.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent 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 50d4e5b and 8f16dc7.

📒 Files selected for processing (3)
  • tensorrt_llm/_torch/pyexecutor/_util.py (2 hunks)
  • tensorrt_llm/_torch/pyexecutor/kv_cache_transceiver.py (4 hunks)
  • tensorrt_llm/_torch/pyexecutor/py_executor_creator.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:

  • tensorrt_llm/_torch/pyexecutor/py_executor_creator.py
  • tensorrt_llm/_torch/pyexecutor/kv_cache_transceiver.py
  • tensorrt_llm/_torch/pyexecutor/_util.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/_torch/pyexecutor/py_executor_creator.py
  • tensorrt_llm/_torch/pyexecutor/kv_cache_transceiver.py
  • tensorrt_llm/_torch/pyexecutor/_util.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/_torch/pyexecutor/py_executor_creator.py
  • tensorrt_llm/_torch/pyexecutor/kv_cache_transceiver.py
  • tensorrt_llm/_torch/pyexecutor/_util.py
🧬 Code graph analysis (2)
tensorrt_llm/_torch/pyexecutor/kv_cache_transceiver.py (2)
cpp/include/tensorrt_llm/batch_manager/cacheTransceiver.h (1)
  • tensorrt_llm (40-279)
tensorrt_llm/llmapi/llm_args.py (12)
  • CacheTransceiverConfig (1408-1425)
  • _to_pybind (872-873)
  • _to_pybind (1028-1029)
  • _to_pybind (1038-1039)
  • _to_pybind (1048-1049)
  • _to_pybind (1070-1075)
  • _to_pybind (1090-1097)
  • _to_pybind (1154-1167)
  • _to_pybind (1210-1213)
  • _to_pybind (1325-1342)
  • _to_pybind (1398-1404)
  • _to_pybind (1422-1425)
tensorrt_llm/_torch/pyexecutor/_util.py (3)
cpp/include/tensorrt_llm/batch_manager/cacheTransceiver.h (1)
  • tensorrt_llm (40-279)
cpp/include/tensorrt_llm/executor/serialization.h (1)
  • tensorrt_llm (27-367)
tensorrt_llm/llmapi/llm_args.py (1)
  • CacheTransceiverConfig (1408-1425)
⏰ 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 (5)
tensorrt_llm/_torch/pyexecutor/_util.py (2)

14-19: Import path realignment to public llm_args type looks good.

Using tensorrt_llm.llmapi.llm_args.CacheTransceiverConfig here aligns the surface with other arg schemas. No issues.


670-671: No issues found. Type hint correctly uses public CacheTransceiverConfig from tensorrt_llm.llmapi.llm_args.

The verification confirms there are no remaining references to the old bindings type. The parameter type on line 670 properly reflects the public API surface, and downstream conversion via _to_pybind handles the necessary binding.

tensorrt_llm/_torch/pyexecutor/py_executor_creator.py (2)

18-21: Removal of PybindMirror dependency is appropriate.

Keeping only TorchLlmArgs and moving pybind conversion to the usage site simplifies the flow.


297-299: Pass-through of llm_args.cache_transceiver_config is correct.

The verification confirms that kv_cache_transceiver.py line 117 explicitly calls _to_pybind() on the cache_transceiver_config passed through from py_executor_creator.py lines 297–299, validating the direct pass-through approach. No other sites expect a pybind-level config.

tensorrt_llm/_torch/pyexecutor/kv_cache_transceiver.py (1)

117-118: Good: pybind conversion centralized here.

Using cache_transceiver_config._to_pybind() at construction keeps pybind scope local.


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.

@tensorrt-cicd
Copy link
Collaborator

PR_Github #22106 [ run ] triggered by Bot. Commit: 8f16dc7

Signed-off-by: junq <[email protected]>
@QiJune
Copy link
Collaborator Author

QiJune commented Oct 22, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #22106 [ run ] completed with state SUCCESS. Commit: 8f16dc7
/LLM/main/L0_MergeRequest_PR pipeline #16668 completed with status: 'FAILURE'

@tensorrt-cicd
Copy link
Collaborator

PR_Github #22116 [ run ] triggered by Bot. Commit: ac9fff0

@tensorrt-cicd
Copy link
Collaborator

PR_Github #22116 [ run ] completed with state SUCCESS. Commit: ac9fff0
/LLM/main/L0_MergeRequest_PR pipeline #16677 completed with status: 'FAILURE'

Copy link
Collaborator

@leslie-fang25 leslie-fang25 left a comment

Choose a reason for hiding this comment

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

LGTM

@QiJune
Copy link
Collaborator Author

QiJune commented Oct 22, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #22129 [ run ] triggered by Bot. Commit: ac9fff0

@tensorrt-cicd
Copy link
Collaborator

PR_Github #22129 [ run ] completed with state SUCCESS. Commit: ac9fff0
/LLM/main/L0_MergeRequest_PR pipeline #16687 completed with status: 'FAILURE'

@QiJune
Copy link
Collaborator Author

QiJune commented Oct 23, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #22223 [ run ] triggered by Bot. Commit: 28987b4

@QiJune QiJune requested a review from Shixiaowei02 October 23, 2025 02:49
@QiJune QiJune enabled auto-merge (squash) October 23, 2025 05:34
@tensorrt-cicd
Copy link
Collaborator

PR_Github #22223 [ run ] completed with state SUCCESS. Commit: 28987b4
/LLM/main/L0_MergeRequest_PR pipeline #16756 completed with status: 'FAILURE'

@QiJune
Copy link
Collaborator Author

QiJune commented Oct 23, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #22263 [ run ] triggered by Bot. Commit: 28987b4

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