Skip to content

Conversation

@leslie-fang25
Copy link
Collaborator

@leslie-fang25 leslie-fang25 commented Oct 17, 2025

Summary by CodeRabbit

Release Notes

  • Refactor
    • Reorganized configuration class imports for improved API consistency across executor initialization.
    • Updated internal configuration handling to streamline peft cache and scheduler setup processes.

Description

Limit the scope of pybind configs as of scheduler_config and peft_cache_config

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.

Details

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.

@leslie-fang25 leslie-fang25 force-pushed the leslie/refine_scheduler_config_and_peft_cache_config branch from 04c632c to 2d772eb Compare October 17, 2025 06:39
@leslie-fang25
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21671 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21671 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #16330 completed with status: 'SUCCESS'
Pipeline passed with automatic retried tests. Check the rerun report for details.

@leslie-fang25 leslie-fang25 marked this pull request as ready for review October 20, 2025 01:36
@leslie-fang25 leslie-fang25 requested a review from a team as a code owner October 20, 2025 01:36
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

📝 Walkthrough

Walkthrough

The changes reorganize public API imports, moving PeftCacheConfig, SchedulerConfig, and CapacitySchedulerPolicy from tensorrt_llm.bindings.executor to tensorrt_llm.llmapi.llm_args. Configuration handling is updated to use explicit _to_pybind() conversions and refactored PEFT cache instantiation logic across three related executor modules.

Changes

Cohort / File(s) Summary
Import path consolidation
tensorrt_llm/_torch/pyexecutor/py_executor.py
PeftCacheConfig import moved from tensorrt_llm.bindings.executor to tensorrt_llm.llmapi.llm_args
Import path consolidation & function signature updates
tensorrt_llm/_torch/pyexecutor/_util.py
SchedulerConfig added to llmapi.llm_args imports; create_py_executor_instance() signature updated to use PeftCacheConfig and SchedulerConfig from llm_args instead of trtllm bindings; PEFT cache config construction logic changed to instantiate directly or use provided config; explicit _to_pybind() calls added for config manager assignments
Import path consolidation & config handling refactoring
tensorrt_llm/_torch/pyexecutor/py_executor_creator.py
CapacitySchedulerPolicy moved from tensorrt_llm.bindings.executor to tensorrt_llm.llmapi.llm_args imports; scheduler config converted from generic PybindMirror.maybe_to_pybind() to direct usage; PEFT cache config changed from conversion to deep copy; chunking policy computation now calls _to_pybind() on context_chunking_policy when present

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description is largely incomplete compared to the required template. The Description section contains only a single sentence that restates the title without explaining the motivation, rationale, or detailed context for why these changes are necessary or what problem they solve. The Test Coverage section is entirely empty with no tests listed, despite the raw_summary indicating medium to high code review effort and the modification of multiple public API signatures and function implementations across three files. While the PR checklist is present and marked complete, the lack of documented test coverage contradicts the checklist requirement to provide test cases for code changes of this magnitude.
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 "[TRTLLM-8483][chore] Refine scheduler_config and peft_cache_config in create_py_executor" directly aligns with the main changeset. The raw_summary shows that the primary changes involve refining how scheduler_config and peft_cache_config are handled in create_py_executor by moving imports from tensorrt_llm.bindings.executor to tensorrt_llm.llmapi.llm_args and adjusting function signatures accordingly. The title follows the proper format with a valid JIRA ticket, lowercase type label, and a specific, concise summary that clearly communicates the core change to someone reviewing the commit history.
✨ 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: 1

🧹 Nitpick comments (3)
tensorrt_llm/_torch/pyexecutor/py_executor_creator.py (2)

218-218: Guard against missing scheduler_config.

llm_args.scheduler_config can be None; this is later dereferenced (and also required downstream in create_py_executor_instance). Default it to a fresh SchedulerConfig to avoid NPEs.

Apply:

-from tensorrt_llm.llmapi.llm_args import (CapacitySchedulerPolicy,
-                                          KvCacheConnectorConfig, LoadFormat,
-                                          PybindMirror, TorchLlmArgs)
+from tensorrt_llm.llmapi.llm_args import (CapacitySchedulerPolicy,
+                                          KvCacheConnectorConfig, LoadFormat,
+                                          PybindMirror, TorchLlmArgs,
+                                          SchedulerConfig)

-    scheduler_config = llm_args.scheduler_config
+    scheduler_config = llm_args.scheduler_config or SchedulerConfig()

457-461: Chunking policy conversion is correct.

Converts to pybind enum when provided; otherwise defaults to FIRST_COME_FIRST_SERVED as intended. Optionally, use getattr(...) to be extra defensive, but not required if you adopt the SchedulerConfig() default above.

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

747-747: Pass the effective PEFT config to PyExecutor.

You compute peft_cache_config_model (possibly adjusted by LoRA-derived sizes) but pass the original peft_cache_config to PyExecutor. Passing peft_cache_config_model keeps PyExecutor.peft_cache_config aligned with the manager actually created and makes downstream introspection consistent.

Apply:

-        peft_cache_config=peft_cache_config)
+        peft_cache_config=peft_cache_config_model)
📜 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 023e515 and 2d772eb.

📒 Files selected for processing (3)
  • tensorrt_llm/_torch/pyexecutor/_util.py (5 hunks)
  • tensorrt_llm/_torch/pyexecutor/py_executor.py (1 hunks)
  • tensorrt_llm/_torch/pyexecutor/py_executor_creator.py (3 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.py
  • tensorrt_llm/_torch/pyexecutor/py_executor_creator.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.py
  • tensorrt_llm/_torch/pyexecutor/py_executor_creator.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.py
  • tensorrt_llm/_torch/pyexecutor/py_executor_creator.py
  • tensorrt_llm/_torch/pyexecutor/_util.py
🧠 Learnings (1)
📚 Learning: 2025-08-26T09:37:10.463Z
Learnt from: jiaganc
PR: NVIDIA/TensorRT-LLM#7031
File: tensorrt_llm/bench/dataclasses/configuration.py:90-104
Timestamp: 2025-08-26T09:37:10.463Z
Learning: In TensorRT-LLM, the `get_pytorch_perf_config()` method returns `self.pytorch_config` which can contain default `cuda_graph_config` values, so `llm_args` may already have this config before the extra options processing.

Applied to files:

  • tensorrt_llm/_torch/pyexecutor/py_executor_creator.py
🧬 Code graph analysis (3)
tensorrt_llm/_torch/pyexecutor/py_executor.py (2)
cpp/include/tensorrt_llm/executor/serialization.h (1)
  • tensorrt_llm (27-367)
tensorrt_llm/llmapi/llm_args.py (1)
  • PeftCacheConfig (1062-1128)
tensorrt_llm/_torch/pyexecutor/py_executor_creator.py (1)
tensorrt_llm/llmapi/llm_args.py (13)
  • ContextChunkingPolicy (1004-1010)
  • CapacitySchedulerPolicy (994-1000)
  • _to_pybind (833-834)
  • _to_pybind (989-990)
  • _to_pybind (999-1000)
  • _to_pybind (1009-1010)
  • _to_pybind (1031-1036)
  • _to_pybind (1051-1058)
  • _to_pybind (1115-1128)
  • _to_pybind (1170-1173)
  • _to_pybind (1285-1302)
  • _to_pybind (1358-1364)
  • _to_pybind (1382-1385)
tensorrt_llm/_torch/pyexecutor/_util.py (1)
tensorrt_llm/llmapi/llm_args.py (13)
  • SchedulerConfig (1040-1058)
  • PeftCacheConfig (1062-1128)
  • _to_pybind (833-834)
  • _to_pybind (989-990)
  • _to_pybind (999-1000)
  • _to_pybind (1009-1010)
  • _to_pybind (1031-1036)
  • _to_pybind (1051-1058)
  • _to_pybind (1115-1128)
  • _to_pybind (1170-1173)
  • _to_pybind (1285-1302)
  • _to_pybind (1358-1364)
  • _to_pybind (1382-1385)
🔇 Additional comments (5)
tensorrt_llm/_torch/pyexecutor/py_executor.py (1)

35-35: Import relocation to llmapi looks correct.

Using PeftCacheConfig from tensorrt_llm.llmapi.llm_args aligns with the new config flow; no behavior change here.

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

16-17: Import reshuffle LGTM.

CapacitySchedulerPolicy moved to llmapi; ContextChunkingPolicy/GuidedDecodingConfig remain in bindings. Consistent with the new conversion points.

Also applies to: 19-20


221-223: Deep copy of peft_cache_config is a good containment measure.

Prevents accidental mutation of llm_args while still allowing local adjustments.

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

14-16: Importing PeftCacheConfig/SchedulerConfig from llmapi is correct.

Matches the new public configuration flow.


663-665: PEFT config construction and conversion look good.

Using a model instance and calling _to_pybind() at the call site isolates pybind usage and keeps llm_args clean.

Also applies to: 681-681

@leslie-fang25 leslie-fang25 force-pushed the leslie/refine_scheduler_config_and_peft_cache_config branch from 2d772eb to 4a993cc Compare October 20, 2025 02:09
@leslie-fang25
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21827 [ run ] triggered by Bot. Commit: 4a993cc

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21827 [ run ] completed with state SUCCESS. Commit: 4a993cc
/LLM/main/L0_MergeRequest_PR pipeline #16451 completed with status: 'FAILURE'

@leslie-fang25
Copy link
Collaborator Author

/bot run

@leslie-fang25
Copy link
Collaborator Author

/bot run --disable-fail-fast

@leslie-fang25 leslie-fang25 requested a review from QiJune October 20, 2025 07:39
@leslie-fang25 leslie-fang25 requested a review from a team as a code owner October 20, 2025 09:04
Copy link
Collaborator

@QiJune QiJune left a comment

Choose a reason for hiding this comment

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

LGTM

@leslie-fang25
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21881 [ run ] triggered by Bot. Commit: a6325ae

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21881 [ run ] completed with state FAILURE. Commit: a6325ae
/LLM/main/L0_MergeRequest_PR pipeline #16495 completed with status: 'FAILURE'

@leslie-fang25
Copy link
Collaborator Author

/bot run

… create_py_executor

Signed-off-by: leslie-fang25 <leslief@nvidia.com>
Signed-off-by: leslie-fang25 <leslief@nvidia.com>
Signed-off-by: leslie-fang25 <leslief@nvidia.com>
Signed-off-by: leslie-fang25 <leslief@nvidia.com>
@tensorrt-cicd
Copy link
Collaborator

PR_Github #21962 [ run ] triggered by Bot. Commit: a6325ae

@leslie-fang25 leslie-fang25 force-pushed the leslie/refine_scheduler_config_and_peft_cache_config branch from a6325ae to be3d092 Compare October 21, 2025 01:11
@leslie-fang25
Copy link
Collaborator Author

/bot run --disable-fail-fast

@leslie-fang25
Copy link
Collaborator Author

Hi @suyoggupta @lucaslie, please kindly help to take a look of this change. Thanks.

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21968 [ run ] triggered by Bot. Commit: be3d092

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21962 [ run ] completed with state ABORTED. Commit: a6325ae
LLM/main/L0_MergeRequest_PR #16559 (Blue Ocean) completed with status: ABORTED

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21968 [ run ] completed with state SUCCESS. Commit: be3d092
/LLM/main/L0_MergeRequest_PR pipeline #16564 completed with status: 'FAILURE'

@leslie-fang25
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #22006 [ run ] triggered by Bot. Commit: be3d092

@tensorrt-cicd
Copy link
Collaborator

PR_Github #22006 [ run ] completed with state SUCCESS. Commit: be3d092
/LLM/main/L0_MergeRequest_PR pipeline #16593 completed with status: 'SUCCESS'
Pipeline passed with automatic retried tests. Check the rerun report for details.

@leslie-fang25 leslie-fang25 merged commit 50d4e5b into NVIDIA:main Oct 22, 2025
5 checks passed
yufeiwu-nv pushed a commit to yufeiwu-nv/TensorRT-LLM that referenced this pull request Oct 24, 2025
… create_py_executor (NVIDIA#8451)

Signed-off-by: leslie-fang25 <leslief@nvidia.com>
Signed-off-by: yufeiwu-nv <230315618+yufeiwu-nv@users.noreply.github.com>
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Nov 1, 2025
… create_py_executor (NVIDIA#8451)

Signed-off-by: leslie-fang25 <leslief@nvidia.com>
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Nov 3, 2025
… create_py_executor (NVIDIA#8451)

Signed-off-by: leslie-fang25 <leslief@nvidia.com>
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Nov 3, 2025
… create_py_executor (NVIDIA#8451)

Signed-off-by: leslie-fang25 <leslief@nvidia.com>
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Nov 3, 2025
… create_py_executor (NVIDIA#8451)

Signed-off-by: leslie-fang25 <leslief@nvidia.com>
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