KEMBAR78
[None][feat] AutoDeploy: compiler backends based on nn.Module by lucaslie · Pull Request #8126 · NVIDIA/TensorRT-LLM · GitHub
Skip to content

Conversation

@lucaslie
Copy link
Member

@lucaslie lucaslie commented Oct 2, 2025

Summary by CodeRabbit

  • New Features

    • Pluggable compile backends with an explicit compile step.
    • Option to run transforms per sub-module.
    • Named dynamic shapes accessor, alongside tuple-based shapes.
  • Improvements

    • Enhanced logging with compile/transform timing and clearer messages.
    • More robust CUDA Graph capture with smarter batch-size heuristics.
    • Streamlined input flattening and shape handling.
  • Bug Fixes

    • Correct output-node detection in graph utilities.
    • Input-constraint cleanup now targets the intended input tensor.
  • Refactor

    • Unified compiler/registry interfaces and simplified compile workflow.

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.

Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
@lucaslie
Copy link
Member Author

lucaslie commented Oct 2, 2025

/bot run --disable-fail-fast

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 2, 2025

📝 Walkthrough

Walkthrough

Refactors the compile subsystem: renames and simplifies the compiler base and registry, removes compile_and_capture, and shifts callers to instantiate backends via CompileBackendRegistry and call compile(). Updates multiple backends to the new API. Reworks CUDA graph capture interfaces and input flattening. Adjusts transform/shim dynamic-shape APIs and adds per-GraphModule transform execution. Updates tests accordingly.

Changes

Cohort / File(s) Summary of changes
Compiler core and registry refactor
tensorrt_llm/_torch/auto_deploy/compile/compiler.py
Renames BackendRegistry→CompileBackendRegistry and BackendCompiler→CompilerBackend; constructor now uses model: nn.Module; removes compile_and_capture and _flatten_args; updates registry types/returns; keeps abstract compile().
Backend implementations migration
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_compile.py, .../backends/torch_opt.py, .../backends/torch_simple.py
Switch to CompileBackendRegistry and CompilerBackend; adjust init arg names; use self.model instead of self.gm; torch_opt adds compile() using torch.compile and logging; remove legacy _init_captured_graph.
CUDA graph backend and capture rework
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py
Introduces input flatten helpers; CapturedGraph now stores in/out specs internally; renames graphs→cudagraphs; updates capture/forward paths; TorchCudagraphCompiler updated to new base/registry and constructor (cuda_graph_batch_sizes, max_batch_size, num_batched_inputs); compile() builds CapturedGraph.
Callers switch to registry-based compile
examples/auto_deploy/build_and_run_flux.py, .../transform/library/compile_model.py
Replace compile_and_capture with CompileBackendRegistry.get(...)(...).compile(); pass args/kwargs per new API; update imports.
Transform framework enhancements
tensorrt_llm/_torch/auto_deploy/transform/interface.py, .../transformations/_graph.py, .../transform/library/cleanup_input_constraints.py
Adds with_transform_logging, timing logs, per-GraphModule execution via run_per_gm and _apply_per_gm; BaseTransform.call now nn.Module; _graph.py adds sentinel for missing values and extends add_graph_input to support kwargs; cleanup_input_constraints selects second placeholder.
Dynamic shape API adjustments
tensorrt_llm/_torch/auto_deploy/custom_ops/attention_interface.py, .../shim/interface.py
SequenceInfo.named_dynamic_shapes now Dict[str, DynamicShape]; Shim exposes named_dynamic_shapes and updates dynamic_shapes to Tuple[DynamicShape, ...]; import updates.
Utilities
tensorrt_llm/_torch/auto_deploy/utils/node_utils.py
Tightens output node detection: assign only on op=="output" and assert presence.
Tests updated to new APIs
tests/unittest/_torch/auto_deploy/unit/singlegpu/compile/test_compiler.py, .../test_captured_graph.py, .../test_cuda_graph_batch_sizes.py
Replace compile_and_capture with registry-based flow; adapt to CapturedGraph ctor changes and cudagraphs map; use new flatten helpers; adjust TorchCudagraphCompiler params and expectations.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Caller
  participant Registry as CompileBackendRegistry
  participant Backend as CompilerBackend (subclass)
  participant Model as nn.Module

  Caller->>Registry: get("<backend>")
  Registry-->>Caller: Compiler class
  Caller->>Backend: instantiate(model, args, kwargs, **compiler_kwargs)
  Backend->>Backend: compile()
  note over Backend: Backend-specific compile logic<br/>(e.g., torch.compile, CUDA graph setup)
  Backend-->>Caller: Compiled Model
  Caller->>Model: use compiled model
Loading
sequenceDiagram
  autonumber
  actor Caller
  participant TC as TorchCudagraphCompiler
  participant CG as CapturedGraph
  participant CUDA as CUDA Graphs

  Caller->>TC: instantiate(model, cuda_graph_batch_sizes, num_batched_inputs, max_batch_size)
  TC->>TC: compile()
  TC->>CG: create CapturedGraph(model, batch_sizes, num_batched_inputs)
  CG->>CG: first forward: flatten args, record in_spec
  CG->>CUDA: capture per-batch graphs
  CG-->>TC: compiled module (wrapper)
  Caller->>CG: forward(args, kwargs)
  CG->>CG: flatten via recorded in_spec
  CG->>CUDA: replay cudagraph matching batch
  CG-->>Caller: outputs (unflattened via out_spec)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description retains only the unfilled template and the @coderabbitai placeholder without any actual summary, description of changes, test coverage details, or completed checklist items, leaving all required sections empty. Please replace the @coderabbitai placeholder with a concise summary of the changes, populate the Description and Test Coverage sections with relevant details, and complete the PR Checklist to describe tests, guidelines compliance, and documentation updates.
Docstring Coverage ⚠️ Warning Docstring coverage is 52.94% 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 template, includes the correct ticket and type prefix, and succinctly describes the primary change of refactoring AutoDeploy compiler backends to use nn.Module.
✨ 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

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

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/auto_deploy/utils/node_utils.py (1)

1-2: Add the required NVIDIA Apache-2.0 copyright header.

The coding guidelines require prepending the NVIDIA Apache-2.0 copyright header with the current year (2025) to all source files, including .py files.

Apply this diff to add the copyright header:

+# 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.
+
 """Common utils for torch fx graph transformation."""

As per coding guidelines.

🧹 Nitpick comments (4)
tensorrt_llm/_torch/auto_deploy/utils/node_utils.py (1)

321-327: LGTM! Output node validation is now more precise.

The change correctly tightens the logic by only assigning output_node when encountering a node with op == "output", and the assertion now directly checks for its presence. This improves clarity and correctness.

Optionally, the loop could break early once both input_id_node and output_node are found to improve efficiency:

 for node in gm.graph.nodes:
     if input_id_node is None and node.op == "placeholder":
         input_id_node = node
     if node.op == "output":
         output_node = node
+    if input_id_node is not None and output_node is not None:
+        break
tests/unittest/_torch/auto_deploy/unit/singlegpu/compile/test_captured_graph.py (1)

92-94: Drop debug prints from the test

These print calls make the unit test noisy and can mask genuine failures in CI logs. Please remove them.

tensorrt_llm/_torch/auto_deploy/compile/compiler.py (2)

12-18: Use ClassVar for the shared backend registry

Annotate _backend_registry as a ClassVar so static analyzers (RUF012) stop flagging it and to make the class-level intent explicit. Based on static analysis hints.


35-45: Preserve any extra compiler kwargs

compiler_kwargs are currently swallowed by the base class, so derived compilers (or future extensions) cannot inspect them. Either persist them (e.g., self.compiler_kwargs = compiler_kwargs) or drop the parameter if it is truly unused; otherwise options passed by callers get lost silently.

📜 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 4136942 and f237111.

📒 Files selected for processing (16)
  • examples/auto_deploy/build_and_run_flux.py (2 hunks)
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_compile.py (1 hunks)
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py (8 hunks)
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_opt.py (2 hunks)
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_simple.py (1 hunks)
  • tensorrt_llm/_torch/auto_deploy/compile/compiler.py (2 hunks)
  • tensorrt_llm/_torch/auto_deploy/custom_ops/attention_interface.py (1 hunks)
  • tensorrt_llm/_torch/auto_deploy/shim/interface.py (2 hunks)
  • tensorrt_llm/_torch/auto_deploy/transform/interface.py (8 hunks)
  • tensorrt_llm/_torch/auto_deploy/transform/library/cleanup_input_constraints.py (1 hunks)
  • tensorrt_llm/_torch/auto_deploy/transform/library/compile_model.py (2 hunks)
  • tensorrt_llm/_torch/auto_deploy/transformations/_graph.py (7 hunks)
  • tensorrt_llm/_torch/auto_deploy/utils/node_utils.py (1 hunks)
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/compile/test_captured_graph.py (3 hunks)
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/compile/test_compiler.py (2 hunks)
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/compile/test_cuda_graph_batch_sizes.py (7 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/auto_deploy/unit/singlegpu/compile/test_compiler.py
  • examples/auto_deploy/build_and_run_flux.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/compile/test_captured_graph.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/cleanup_input_constraints.py
  • tensorrt_llm/_torch/auto_deploy/compile/compiler.py
  • tensorrt_llm/_torch/auto_deploy/shim/interface.py
  • tensorrt_llm/_torch/auto_deploy/custom_ops/attention_interface.py
  • tensorrt_llm/_torch/auto_deploy/transformations/_graph.py
  • tensorrt_llm/_torch/auto_deploy/utils/node_utils.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/compile_model.py
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_simple.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/compile/test_cuda_graph_batch_sizes.py
  • tensorrt_llm/_torch/auto_deploy/transform/interface.py
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_opt.py
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_compile.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/auto_deploy/unit/singlegpu/compile/test_compiler.py
  • examples/auto_deploy/build_and_run_flux.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/compile/test_captured_graph.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/cleanup_input_constraints.py
  • tensorrt_llm/_torch/auto_deploy/compile/compiler.py
  • tensorrt_llm/_torch/auto_deploy/shim/interface.py
  • tensorrt_llm/_torch/auto_deploy/custom_ops/attention_interface.py
  • tensorrt_llm/_torch/auto_deploy/transformations/_graph.py
  • tensorrt_llm/_torch/auto_deploy/utils/node_utils.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/compile_model.py
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_simple.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/compile/test_cuda_graph_batch_sizes.py
  • tensorrt_llm/_torch/auto_deploy/transform/interface.py
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_opt.py
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_compile.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/auto_deploy/unit/singlegpu/compile/test_compiler.py
  • examples/auto_deploy/build_and_run_flux.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/compile/test_captured_graph.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/cleanup_input_constraints.py
  • tensorrt_llm/_torch/auto_deploy/compile/compiler.py
  • tensorrt_llm/_torch/auto_deploy/shim/interface.py
  • tensorrt_llm/_torch/auto_deploy/custom_ops/attention_interface.py
  • tensorrt_llm/_torch/auto_deploy/transformations/_graph.py
  • tensorrt_llm/_torch/auto_deploy/utils/node_utils.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/compile_model.py
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_simple.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/compile/test_cuda_graph_batch_sizes.py
  • tensorrt_llm/_torch/auto_deploy/transform/interface.py
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_opt.py
  • tensorrt_llm/_torch/auto_deploy/compile/backends/torch_compile.py
🧬 Code graph analysis (12)
tests/unittest/_torch/auto_deploy/unit/singlegpu/compile/test_compiler.py (5)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_compile.py (1)
  • compile (17-19)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py (1)
  • compile (232-243)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_opt.py (1)
  • compile (26-28)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_simple.py (1)
  • compile (10-11)
tensorrt_llm/_torch/auto_deploy/compile/compiler.py (3)
  • compile (47-48)
  • CompileBackendRegistry (12-31)
  • get (25-27)
examples/auto_deploy/build_and_run_flux.py (5)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_compile.py (1)
  • compile (17-19)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py (1)
  • compile (232-243)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_opt.py (1)
  • compile (26-28)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_simple.py (1)
  • compile (10-11)
tensorrt_llm/_torch/auto_deploy/compile/compiler.py (3)
  • compile (47-48)
  • CompileBackendRegistry (12-31)
  • get (25-27)
tests/unittest/_torch/auto_deploy/unit/singlegpu/compile/test_captured_graph.py (1)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py (3)
  • compile (232-243)
  • CapturedGraph (28-177)
  • _args_kwargs_flatten_spec (16-19)
tensorrt_llm/_torch/auto_deploy/compile/compiler.py (2)
tensorrt_llm/_torch/auto_deploy/custom_ops/attention_interface.py (3)
  • register (924-932)
  • decorator (925-930)
  • get (935-937)
tensorrt_llm/_torch/auto_deploy/transform/interface.py (2)
  • register (483-490)
  • get (493-495)
tensorrt_llm/_torch/auto_deploy/shim/interface.py (1)
tensorrt_llm/_torch/auto_deploy/custom_ops/attention_interface.py (4)
  • GetCacheCallable (773-774)
  • SequenceInfo (35-746)
  • dynamic_shapes (332-334)
  • named_dynamic_shapes (307-329)
tensorrt_llm/_torch/auto_deploy/custom_ops/attention_interface.py (1)
tensorrt_llm/_torch/auto_deploy/shim/interface.py (1)
  • named_dynamic_shapes (43-47)
tensorrt_llm/_torch/auto_deploy/transform/library/compile_model.py (4)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_compile.py (1)
  • compile (17-19)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py (1)
  • compile (232-243)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_simple.py (1)
  • compile (10-11)
tensorrt_llm/_torch/auto_deploy/compile/compiler.py (3)
  • compile (47-48)
  • CompileBackendRegistry (12-31)
  • get (25-27)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py (1)
tensorrt_llm/_torch/auto_deploy/compile/compiler.py (4)
  • CompileBackendRegistry (12-31)
  • CompilerBackend (34-48)
  • register (16-22)
  • compile (47-48)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_simple.py (4)
tensorrt_llm/_torch/auto_deploy/compile/compiler.py (4)
  • CompileBackendRegistry (12-31)
  • CompilerBackend (34-48)
  • register (16-22)
  • compile (47-48)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_compile.py (1)
  • compile (17-19)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py (1)
  • compile (232-243)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_opt.py (1)
  • compile (26-28)
tensorrt_llm/_torch/auto_deploy/transform/interface.py (4)
tensorrt_llm/_torch/auto_deploy/models/factory.py (1)
  • ModelFactory (23-294)
tensorrt_llm/_torch/auto_deploy/shim/interface.py (2)
  • CachedSequenceInterface (11-88)
  • args (23-25)
tensorrt_llm/_torch/auto_deploy/transformations/_graph.py (4)
  • canonicalize_graph (174-187)
  • lift_to_meta (79-92)
  • named_graphmodules (95-99)
  • run_shape_prop (218-243)
tensorrt_llm/logger.py (1)
  • warning (132-133)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_opt.py (3)
tensorrt_llm/_torch/auto_deploy/compile/compiler.py (3)
  • CompileBackendRegistry (12-31)
  • register (16-22)
  • compile (47-48)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py (2)
  • TorchCudagraphCompiler (181-257)
  • compile (232-243)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_compile.py (1)
  • compile (17-19)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_compile.py (4)
tensorrt_llm/_torch/auto_deploy/compile/compiler.py (4)
  • CompileBackendRegistry (12-31)
  • CompilerBackend (34-48)
  • register (16-22)
  • compile (47-48)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py (1)
  • compile (232-243)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_opt.py (1)
  • compile (26-28)
tensorrt_llm/_torch/auto_deploy/compile/backends/torch_simple.py (1)
  • compile (10-11)
🪛 Ruff (0.13.2)
tensorrt_llm/_torch/auto_deploy/compile/compiler.py

13-13: Mutable class attributes should be annotated with typing.ClassVar

(RUF012)


40-40: Unused method argument: compiler_kwargs

(ARG002)

tensorrt_llm/_torch/auto_deploy/transform/interface.py

305-305: Do not catch blind exception: Exception

(BLE001)

⏰ 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 (4)
tensorrt_llm/_torch/auto_deploy/custom_ops/attention_interface.py (1)

307-307: LGTM: Type annotation corrected.

The return type annotation now correctly reflects the implementation. The property returns a Dict[str, DynamicShape] where DynamicShape = Dict[int, Dim] (integer keys for tensor dimension indices), consistent with the implementation at lines 315-322 which uses integer indices (0, 1) as keys.

tensorrt_llm/_torch/auto_deploy/shim/interface.py (2)

1-1: LGTM: Import updates support type consistency.

The removal of Any and addition of DynamicShape from custom_ops.attention_interface align with the type annotation improvements in this file and maintain type safety.

Also applies to: 7-7


38-47: LGTM: Dynamic shapes refactored to use named mapping.

The refactoring introduces a named mapping (named_dynamic_shapes) that aggregates shapes from info.named_dynamic_shapes and static shapes for caches. The dynamic_shapes property now derives values from this mapping, consistent with the pattern in attention_interface.py (lines 331-334). Caches use empty dicts {} as DynamicShape to indicate static (non-dynamic) shapes.

tensorrt_llm/_torch/auto_deploy/transform/library/cleanup_input_constraints.py (1)

24-57: Validate placeholder indexing in transform pipeline
Only one find_nodes(op="placeholder")[1] occurrence was found; manually ensure all graphs have at least two placeholders, that the second is correct for constraint cleanup, document the first placeholder’s role, and update any other dependent transforms.

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20557 [ run ] triggered by Bot

@suyoggupta
Copy link
Collaborator

trying to understand the main change here to focus on: Is it the use of _apply_per_gm instead of _apply in transform/interface.py -- which gives the ability to apply transformations per submodule in the model?

if so, then I find the PR title a bit confusing (compiler backends based on nn.Module)

Copy link
Collaborator

@laikhtewari laikhtewari left a comment

Choose a reason for hiding this comment

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

Maybe we can exclude examples/autodeploy from required review by doc owners given prototype status

@tensorrt-cicd
Copy link
Collaborator

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

@suyoggupta suyoggupta self-requested a review October 3, 2025 16:12
@lucaslie lucaslie merged commit aaf2c3c into NVIDIA:main Oct 3, 2025
7 of 9 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in AutoDeploy Board Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants