Skip to content

[#9306][refactor] Refactor AutoDeployConfig into LlmArgs - #10613

Merged
lucaslie merged 1 commit into
NVIDIA:mainfrom
2ez4bz:dev-ad-llm-args
Jan 22, 2026
Merged

[#9306][refactor] Refactor AutoDeployConfig into LlmArgs#10613
lucaslie merged 1 commit into
NVIDIA:mainfrom
2ez4bz:dev-ad-llm-args

Conversation

@2ez4bz

@2ez4bz 2ez4bz commented Jan 13, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Refactor
    • Consolidated auto-deployment configuration by replacing AutoDeployConfig with a unified LlmArgs class for consistent argument handling across the framework.
    • Improved LLM instantiation to use a cleaner model serialization approach.

✏️ Tip: You can customize this high-level summary in your review settings.

Description

  • Why?

We would like to be able to use a TorchLlmArgs config in
AutoDeploy's own version with minimal changes.

  • What?

This PR refactors the configs such, that:

  • AutoDeployConfig is inlined into AD's LlmArgs.
  • LlmArgs now inherits from the TorchLlmArgs. As a result,
    fields that could be removed (due to literally having exactly the
    same schema as in the base class)
  • free_mem_ratio and cuda_graph_batch_sizes are deprecated
    and moved to their respective config classes.

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

  • Update tava architecture diagram if there is a significant design change in PR.

  • 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.

@2ez4bz
2ez4bz marked this pull request as ready for review January 13, 2026 22:28
@2ez4bz
2ez4bz requested review from a team as code owners January 13, 2026 22:28
@2ez4bz

2ez4bz commented Jan 13, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

@coderabbitai

coderabbitai Bot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The pull request consolidates configuration handling by migrating from AutoDeployConfig to LlmArgs. Changes include removing AutoDeployConfig from the public API, updating type annotations across examples and tests, adding new fields to LlmArgs (build_config, backend, gpus_per_node), introducing validators, and adjusting LLM instantiation to use model_dump() instead of to_llm_kwargs().

Changes

Cohort / File(s) Summary
Core API Refactoring
tensorrt_llm/_torch/auto_deploy/llm_args.py
Restructured LlmArgs class inheriting from DynamicYamlMixInForSettings, TorchLlmArgs, and BaseSettings. Added fields: build_config, backend, gpus_per_node. Introduced field validators (ensure_no_build_config, ensure_no_custom_parallel_config) and model validators (setup_hidden_state_capture, validate_parallel_config, validate_and_init_tokenizer). Removed legacy fields and methods; replaced to_llm_kwargs() with model_dump() override to sanitize internal fields for LLM API.
Example Usage Updates
examples/auto_deploy/build_and_run_ad.py
Updated ExperimentConfig.args type from AutoDeployConfig to LlmArgs. Changed type annotations in sync_model_with_args(), sync_prompt_batch_size_with_args_max_batch_size(), and adjust_args_for_benchmark(). Replaced config.args.to_llm_kwargs() with config.args.model_dump(exclude_unset=True) in LLM instantiation.
Test File Updates
tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_hybrid_patches.py, tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_modeling_nemotron_h.py
Updated imports and constructor calls from AutoDeployConfig(**llm_args) to LlmArgs(**llm_args).
Test Configuration Validation
tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_build_small_single.py
Removed AutoDeployConfig import; widened type expectations to LlmArgs and adjusted test logic to use model_dump() for constructing expected configurations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 29.41% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description explains the why (use TorchLlmArgs in AutoDeploy with minimal changes) and what (inline AutoDeployConfig, make LlmArgs inherit from TorchLlmArgs, deprecate fields), but the Test Coverage section is left empty and no specific tests are documented. Complete the Test Coverage section by listing specific test files or test cases that validate the refactoring (e.g., the updated unit tests in test_hybrid_patches.py, test_modeling_nemotron_h.py, and test_ad_build_small_single.py).
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main refactoring change: converting AutoDeployConfig into LlmArgs, which aligns with the primary purpose of the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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)
tensorrt_llm/_torch/auto_deploy/llm_args.py (1)

1-3: Missing NVIDIA copyright header.

As per coding guidelines, all TensorRT-LLM source files should contain an NVIDIA copyright header with the year of latest meaningful modification. This file is missing the required header.

🤖 Fix all issues with AI agents
In @tensorrt_llm/_torch/auto_deploy/llm_args.py:
- Around line 104-115: The setup_hidden_state_capture validator assumes
self.transforms["detect_hidden_states_for_capture"] exists and can KeyError;
before setting keys ensure the transform dict exists by checking if
"detect_hidden_states_for_capture" in self.transforms and creating/initializing
it if missing (e.g., set to an empty dict or with default structure), then
assign capture_hidden_states=True and
eagle3_layers_to_capture=self.speculative_config.eagle3_layers_to_capture; keep
the method signature and return self (target symbols:
setup_hidden_state_capture, self.transforms, "detect_hidden_states_for_capture",
speculative_config.eagle3_layers_to_capture).
🧹 Nitpick comments (2)
tensorrt_llm/_torch/auto_deploy/llm_args.py (2)

261-276: Variable shadowing: kwargs parameter is reassigned.

The parameter kwargs is reassigned on line 263 to the result of super().model_dump(), which shadows the original function parameter. As per coding guidelines, avoid shadowing variables declared in an outer scope.

♻️ Proposed fix
-    def model_dump(self, *args, **kwargs):
+    def model_dump(self, *args, **dump_kwargs):
         """Convert the arguments to a dictionary that can be used as kwargs for the LLM API."""
-        kwargs = super().model_dump(*args, **kwargs)
+        result = super().model_dump(*args, **dump_kwargs)

         # ensure we remove the mode and yaml_default fields since they otherwise may conflict each
         # other.
         if "mode" not in self.model_fields_set:
-            kwargs.pop("mode", None)
+            result.pop("mode", None)
         if "yaml_default" not in self.model_fields_set:
-            kwargs.pop("yaml_default", None)
+            result.pop("yaml_default", None)

         # We never want these.
-        kwargs.pop("build_config", None)
-        kwargs.pop("mpi_session", None)
+        result.pop("build_config", None)
+        result.pop("mpi_session", None)

-        return kwargs
+        return result

76-80: Use default_factory to defer torch.cuda.device_count() evaluation to instance creation time.

The current default torch.cuda.device_count() is evaluated at module import time. If CUDA is unavailable when the module is imported (e.g., in CPU-only environments), the default becomes 0 permanently for all instances. Using default_factory=torch.cuda.device_count would defer the evaluation to instance creation, allowing each instance to capture the GPU count at the moment it's created, which is more robust and aligns with the pattern already used elsewhere in the codebase (e.g., openai_protocol.py). The existing test would still pass with this change.

📜 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 ccdfa43 and a7fe19d.

📒 Files selected for processing (5)
  • examples/auto_deploy/build_and_run_ad.py
  • tensorrt_llm/_torch/auto_deploy/llm_args.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_hybrid_patches.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_modeling_nemotron_h.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_build_small_single.py
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.py: The code developed for TensorRT-LLM should conform to Python 3.8+
Indent Python code with 4 spaces. Do not use tabs
Always maintain the namespace when importing Python modules, even if only one class or function from a module is used
Python filenames should use snake_case (e.g., some_file.py)
Python classes should use PascalCase (e.g., class SomeClass)
Python functions and methods should use snake_case (e.g., def my_awesome_function():)
Python local variables should use snake_case, with prefix k for variable names that start with a number (e.g., k_99th_percentile)
Python global variables should use upper snake_case with prefix G (e.g., G_MY_GLOBAL)
Python constants should use upper snake_case (e.g., MY_CONSTANT)
Avoid shadowing variables declared in an outer scope in Python
Initialize all externally visible members of a Python class in the constructor
For Python interfaces that may be used outside a file, prefer docstrings over comments
Use comments in Python for code within a function, or interfaces that are local to a file
Use Google-style docstrings for Python classes and functions, which can be parsed by Sphinx
Python attributes and variables can be documented inline with the format """<type>: Description"""
Avoid using reflection in Python when functionality can be easily achieved without reflection
When using try-except blocks in Python, limit the except clause to the smallest set of errors possible
When using try-except blocks in Python to handle multiple possible variable types (duck-typing), keep the body of the try as small as possible and use the else block for the main logic

Files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_modeling_nemotron_h.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_build_small_single.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_hybrid_patches.py
  • tensorrt_llm/_torch/auto_deploy/llm_args.py
  • examples/auto_deploy/build_and_run_ad.py
**/*.{cpp,cc,cxx,h,hpp,hxx,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

All TensorRT-LLM source files (.cpp, .h, .cu, .py, and other source files) should contain an NVIDIA copyright header with the year of latest meaningful modification

Files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_modeling_nemotron_h.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_build_small_single.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_hybrid_patches.py
  • tensorrt_llm/_torch/auto_deploy/llm_args.py
  • examples/auto_deploy/build_and_run_ad.py
🧠 Learnings (15)
📓 Common learnings
Learnt from: jiaganc
Repo: NVIDIA/TensorRT-LLM PR: 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.
Learnt from: venkywonka
Repo: NVIDIA/TensorRT-LLM PR: 6029
File: .github/pull_request_template.md:45-53
Timestamp: 2025-08-27T17:50:13.264Z
Learning: For PR templates in TensorRT-LLM, avoid suggesting changes that would increase developer overhead, such as converting plain bullets to mandatory checkboxes. The team prefers guidance-style bullets that don't require explicit interaction to reduce friction in the PR creation process.
📚 Learning: 2025-08-26T09:37:10.463Z
Learnt from: jiaganc
Repo: NVIDIA/TensorRT-LLM PR: 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:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_modeling_nemotron_h.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_build_small_single.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_hybrid_patches.py
  • tensorrt_llm/_torch/auto_deploy/llm_args.py
  • examples/auto_deploy/build_and_run_ad.py
📚 Learning: 2025-08-06T13:58:07.506Z
Learnt from: galagam
Repo: NVIDIA/TensorRT-LLM PR: 6487
File: tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py:1-12
Timestamp: 2025-08-06T13:58:07.506Z
Learning: In TensorRT-LLM, test files (files under tests/ directories) do not require NVIDIA copyright headers, unlike production source code files. Test files typically start directly with imports, docstrings, or code.

Applied to files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_modeling_nemotron_h.py
📚 Learning: 2025-07-28T17:06:08.621Z
Learnt from: moraxu
Repo: NVIDIA/TensorRT-LLM PR: 6303
File: tests/integration/test_lists/qa/examples_test_list.txt:494-494
Timestamp: 2025-07-28T17:06:08.621Z
Learning: In TensorRT-LLM testing, it's common to have both CLI flow tests (test_cli_flow.py) and PyTorch API tests (test_llm_api_pytorch.py) for the same model. These serve different purposes: CLI flow tests validate the traditional command-line workflow, while PyTorch API tests validate the newer LLM API backend. Both are legitimate and should coexist.

Applied to files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_modeling_nemotron_h.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_build_small_single.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_hybrid_patches.py
  • tensorrt_llm/_torch/auto_deploy/llm_args.py
📚 Learning: 2025-08-01T15:14:45.673Z
Learnt from: yibinl-nvidia
Repo: NVIDIA/TensorRT-LLM PR: 6506
File: examples/models/core/mixtral/requirements.txt:3-3
Timestamp: 2025-08-01T15:14:45.673Z
Learning: In TensorRT-LLM, examples directory can have different dependency versions than the root requirements.txt file. Version conflicts between root and examples dependencies are acceptable because examples are designed to be standalone and self-contained.

Applied to files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_modeling_nemotron_h.py
📚 Learning: 2025-08-26T09:37:10.463Z
Learnt from: jiaganc
Repo: NVIDIA/TensorRT-LLM PR: 7031
File: tensorrt_llm/bench/dataclasses/configuration.py:90-104
Timestamp: 2025-08-26T09:37:10.463Z
Learning: In TensorRT-LLM's bench configuration, the `get_pytorch_perf_config()` method returns `self.pytorch_config` which is a Dict[str, Any] that can contain default values including `cuda_graph_config`, making the fallback `llm_args["cuda_graph_config"]` safe to use.

Applied to files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_modeling_nemotron_h.py
  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_hybrid_patches.py
  • tensorrt_llm/_torch/auto_deploy/llm_args.py
  • examples/auto_deploy/build_and_run_ad.py
📚 Learning: 2025-08-19T12:45:11.997Z
Learnt from: amitz-nv
Repo: NVIDIA/TensorRT-LLM PR: 7033
File: tensorrt_llm/_torch/pyexecutor/model_engine.py:0-0
Timestamp: 2025-08-19T12:45:11.997Z
Learning: In tensorrt_llm/_torch/pyexecutor/model_engine.py, DoRA (Delta Orthogonal Rank Adaptation) functionality was removed from the PyTorch flow to eliminate issues with inverted DoRA detection logic. The original is_dora condition was checking if scaling_vec_pointer == 0, which was potentially incorrect.

Applied to files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_build_small_single.py
📚 Learning: 2025-08-26T09:49:04.956Z
Learnt from: pengbowang-nv
Repo: NVIDIA/TensorRT-LLM PR: 7192
File: tests/integration/test_lists/test-db/l0_dgx_b200.yml:56-72
Timestamp: 2025-08-26T09:49:04.956Z
Learning: In TensorRT-LLM test configuration files, the test scheduling system handles wildcard matching with special rules that prevent duplicate test execution even when the same tests appear in multiple yaml files with overlapping GPU wildcards (e.g., "*b200*" and "*gb200*").

Applied to files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_hybrid_patches.py
📚 Learning: 2025-08-09T02:04:49.623Z
Learnt from: Fridah-nv
Repo: NVIDIA/TensorRT-LLM PR: 6760
File: tensorrt_llm/_torch/auto_deploy/models/quant_config_reader.py:81-98
Timestamp: 2025-08-09T02:04:49.623Z
Learning: In TensorRT-LLM's auto_deploy module, torch.dtype values in configuration dictionaries must be stored as string representations (e.g., "float16" instead of torch.float16) because OmegaConf.merge does not support torch.dtype types. These string representations are converted to actual torch.dtype objects in downstream code.

Applied to files:

  • tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_hybrid_patches.py
  • tensorrt_llm/_torch/auto_deploy/llm_args.py
  • examples/auto_deploy/build_and_run_ad.py
📚 Learning: 2025-08-14T15:38:01.771Z
Learnt from: MatthiasKohl
Repo: NVIDIA/TensorRT-LLM PR: 6904
File: cpp/tensorrt_llm/pybind/thop/bindings.cpp:55-57
Timestamp: 2025-08-14T15:38:01.771Z
Learning: In TensorRT-LLM Python bindings, tensor parameter collections like mla_tensor_params and spec_decoding_tensor_params are kept as required parameters without defaults to maintain API consistency, even when it might affect backward compatibility.

Applied to files:

  • tensorrt_llm/_torch/auto_deploy/llm_args.py
📚 Learning: 2026-01-06T03:07:15.754Z
Learnt from: CR
Repo: NVIDIA/TensorRT-LLM PR: 0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2026-01-06T03:07:15.754Z
Learning: Applies to **/*.{md,rst} : When documenting CLI commands for TensorRT-LLM tools like `trtllm-serve`, `trtllm-bench`, or `trtllm-eval`, prefer using `--config` over `--extra_llm_api_options` for specifying configuration files

Applied to files:

  • tensorrt_llm/_torch/auto_deploy/llm_args.py
📚 Learning: 2026-01-06T03:07:15.754Z
Learnt from: CR
Repo: NVIDIA/TensorRT-LLM PR: 0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2026-01-06T03:07:15.754Z
Learning: Applies to **/*.py : The code developed for TensorRT-LLM should conform to Python 3.8+

Applied to files:

  • tensorrt_llm/_torch/auto_deploy/llm_args.py
📚 Learning: 2025-08-27T14:23:55.566Z
Learnt from: ixlmar
Repo: NVIDIA/TensorRT-LLM PR: 7294
File: tensorrt_llm/_torch/modules/rms_norm.py:17-17
Timestamp: 2025-08-27T14:23:55.566Z
Learning: The TensorRT-LLM project requires Python 3.10+ as evidenced by the use of TypeAlias from typing module, match/case statements, and union type | syntax throughout the codebase, despite some documentation still mentioning Python 3.8+.

Applied to files:

  • tensorrt_llm/_torch/auto_deploy/llm_args.py
📚 Learning: 2025-09-09T09:40:45.658Z
Learnt from: fredricz-20070104
Repo: NVIDIA/TensorRT-LLM PR: 7645
File: tests/integration/test_lists/qa/llm_function_core.txt:648-648
Timestamp: 2025-09-09T09:40:45.658Z
Learning: In TensorRT-LLM test lists, it's common and intentional for the same test to appear in multiple test list files when they serve different purposes (e.g., llm_function_core.txt for comprehensive core functionality testing and llm_function_core_sanity.txt for quick sanity checks). This duplication allows tests to be run in different testing contexts.

Applied to files:

  • tensorrt_llm/_torch/auto_deploy/llm_args.py
📚 Learning: 2025-09-04T07:33:10.618Z
Learnt from: MrGeva
Repo: NVIDIA/TensorRT-LLM PR: 7219
File: tensorrt_llm/_torch/auto_deploy/compile/backends/torch_cudagraph.py:162-168
Timestamp: 2025-09-04T07:33:10.618Z
Learning: When users explicitly provide cuda_graph_batch_sizes in TorchCudagraphCompiler, respect their choices and only sanitize the values (clamp, dedupe, sort) without forcing additional batch sizes like 1 or max_batch_size. Only add commonly-used batch sizes when falling back to the heuristic.

Applied to files:

  • tensorrt_llm/_torch/auto_deploy/llm_args.py
🧬 Code graph analysis (5)
tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_modeling_nemotron_h.py (1)
tensorrt_llm/_torch/auto_deploy/llm_args.py (1)
  • LlmArgs (58-379)
tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_build_small_single.py (3)
tensorrt_llm/_torch/auto_deploy/llm_args.py (2)
  • LlmArgs (58-379)
  • model_dump (261-276)
tensorrt_llm/llmapi/llm_args.py (1)
  • _ParallelConfig (525-590)
examples/auto_deploy/build_and_run_ad.py (1)
  • ExperimentConfig (126-238)
tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_hybrid_patches.py (1)
tensorrt_llm/_torch/auto_deploy/llm_args.py (1)
  • LlmArgs (58-379)
tensorrt_llm/_torch/auto_deploy/llm_args.py (7)
tensorrt_llm/llmapi/llm_args.py (6)
  • Field (68-95)
  • EagleDecodingConfig (843-966)
  • KvCacheConfig (1598-1742)
  • _ParallelConfig (525-590)
  • world_size (557-558)
  • world_size (567-571)
tensorrt_llm/builder.py (2)
  • BuildConfig (453-611)
  • default (45-50)
tests/integration/defs/perf/allowed_configs.py (1)
  • BuildConfig (26-35)
tensorrt_llm/_torch/auto_deploy/utils/_config.py (1)
  • DynamicYamlMixInForSettings (99-200)
tensorrt_llm/_torch/distributed/communicator.py (1)
  • tp_size (64-65)
tensorrt_llm/_torch/auto_deploy/custom_ops/attention_interface.py (1)
  • args (590-592)
tensorrt_llm/_torch/auto_deploy/shim/interface.py (1)
  • args (28-30)
examples/auto_deploy/build_and_run_ad.py (2)
tensorrt_llm/_torch/auto_deploy/llm.py (1)
  • LLM (103-152)
tensorrt_llm/_torch/auto_deploy/llm_args.py (2)
  • LlmArgs (58-379)
  • model_dump (261-276)
⏰ 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 (14)
tensorrt_llm/_torch/auto_deploy/llm_args.py (4)

58-69: LGTM on the new LlmArgs class with build_config field.

The class hierarchy and the internal-only build_config field with appropriate markers (exclude_from_json, frozen, repr=False) look correct for maintaining compatibility with BaseLlmArgs while preventing misuse.


82-102: LGTM on field validators preventing unsupported configurations.

The validators correctly enforce that build_config and parallel configuration fields remain at their default values, with clear error messages guiding users to use world_size instead.


117-137: LGTM on validate_parallel_config and validate_and_init_tokenizer.

The parallel config setup correctly maps world_size to tp_size for compatibility with other runtime components. The tokenizer validator appropriately defers initialization to the LLM class.


226-247: LGTM on TODO comments for field deprecation.

The TODO comments at lines 226 and 239 appropriately flag that free_mem_ratio and cuda_graph_batch_sizes should be folded into their respective config classes (KvCacheConfig and CudaGraphConfig).

examples/auto_deploy/build_and_run_ad.py (4)

17-18: LGTM on import updates.

The imports correctly reflect the new API surface, importing LLM and DemoLLM from the auto_deploy module and LlmArgs from the llm_args submodule.


143-146: LGTM on ExperimentConfig.args type update.

The type annotation correctly reflects the transition from AutoDeployConfig to LlmArgs, with appropriate description pointing to the new class location.


215-216: LGTM on type hint updates in validators.

The type annotations for args in sync_model_with_args, sync_prompt_batch_size_with_args_max_batch_size, and adjust_args_for_benchmark are correctly updated to LlmArgs.

Also applies to: 223-224, 233-234


248-249: LGTM on LLM construction using model_dump.

The change from to_llm_kwargs() to model_dump(exclude_unset=True) aligns with the new LlmArgs API. Using exclude_unset=True is appropriate to avoid passing default values that might conflict with the LLM class's own defaults.

tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_hybrid_patches.py (2)

7-7: LGTM on import update.

The import correctly reflects the new API, importing LlmArgs instead of AutoDeployConfig.


54-54: LGTM on constructor usage update.

The test correctly uses LlmArgs(**llm_args) to construct the configuration object, aligning with the new API.

tests/unittest/_torch/auto_deploy/unit/singlegpu/models/test_modeling_nemotron_h.py (2)

14-14: LGTM on import update.

The import correctly reflects the new API, importing LlmArgs instead of AutoDeployConfig.


167-167: LGTM on constructor usage update.

The test correctly uses LlmArgs(**llm_args) to construct the configuration object, aligning with the new API.

tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_build_small_single.py (2)

7-8: LGTM on import updates.

The imports correctly reflect the new API, importing LlmArgs and _ParallelConfig from the llm_args module. The removal of AutoDeployConfig aligns with the PR's goal.


11-21: LGTM on test assertion updates.

The test correctly:

  1. Uses isinstance(llm_args, LlmArgs) for type checking (line 16).
  2. Constructs expected_llm_args via LlmArgs(**expected_ad_config.model_dump()) (line 20).

This aligns with the new model_dump-based API for LlmArgs.

Comment thread tensorrt_llm/_torch/auto_deploy/llm_args.py
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #31825 [ run ] triggered by Bot. Commit: a7fe19d

@lucaslie lucaslie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm. just a few questions

Comment thread tensorrt_llm/_torch/auto_deploy/llm_args.py
Comment thread tensorrt_llm/_torch/auto_deploy/llm_args.py
Comment thread tensorrt_llm/_torch/auto_deploy/llm_args.py
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #31825 [ run ] completed with state SUCCESS. Commit: a7fe19d
/LLM/main/L0_MergeRequest_PR pipeline #24638 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@2ez4bz

2ez4bz commented Jan 14, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #31906 [ run ] triggered by Bot. Commit: 71406e8

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #31906 [ run ] completed with state SUCCESS. Commit: 71406e8
/LLM/main/L0_MergeRequest_PR pipeline #24708 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@2ez4bz

2ez4bz commented Jan 14, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

@2ez4bz

2ez4bz commented Jan 14, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #32020 [ run ] triggered by Bot. Commit: 2e4c2a6

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #32020 [ run ] completed with state SUCCESS. Commit: 2e4c2a6
/LLM/main/L0_MergeRequest_PR pipeline #24813 completed with status: 'SUCCESS'

Comment thread tensorrt_llm/_torch/auto_deploy/llm_args.py Outdated
Comment thread tensorrt_llm/_torch/auto_deploy/llm_args.py Outdated

@lucaslie lucaslie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lgtm. I am re-running the CI with multi-gpu tests. AutoDeploy test stages are separate. So as long all of single-gpu (including PyTorch) and all AD-related multi-gpu tests pass we can merge with /bot skip if non-AD multi-gpu tests fail

@lucaslie

Copy link
Copy Markdown
Contributor

/bot run --extra-stage "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #32470 [ run ] triggered by Bot. Commit: 2e4c2a6

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #32470 [ run ] completed with state FAILURE. Commit: 2e4c2a6
/LLM/main/L0_MergeRequest_PR pipeline #25153 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@lucaslie lucaslie linked an issue Jan 20, 2026 that may be closed by this pull request
1 task
@2ez4bz

2ez4bz commented Jan 20, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --extra-stage "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1"

@2ez4bz
2ez4bz enabled auto-merge (squash) January 20, 2026 21:09
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #32809 [ run ] triggered by Bot. Commit: 8b2a559

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #32809 [ run ] completed with state SUCCESS. Commit: 8b2a559
/LLM/main/L0_MergeRequest_PR pipeline #25387 completed with status: 'ABORTED'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@2ez4bz

2ez4bz commented Jan 21, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --extra-stage "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #32824 [ run ] triggered by Bot. Commit: 8b2a559

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #32824 [ run ] completed with state SUCCESS. Commit: 8b2a559
/LLM/main/L0_MergeRequest_PR pipeline #25397 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

* Why?

We would like to be able to use a TorchLlmArgs config in AutoDeploy's
own version with minimal changes.

* What?

This PR refactors the configs such, that:

- `AutoDeployConfig` is inlined into AD's `LlmArgs`.
- `LlmArgs` now inherits from the `TorchLlmArgs`. As a result,
  fields that could be removed (due to having exactly the same schema
  as in the base class).

Signed-off-by: William Zhang <133824995+2ez4bz@users.noreply.github.com>
@2ez4bz
2ez4bz disabled auto-merge January 21, 2026 07:00
@2ez4bz

2ez4bz commented Jan 21, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --extra-stage "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #32893 [ run ] triggered by Bot. Commit: a949e61

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #32893 [ run ] completed with state SUCCESS. Commit: a949e61
/LLM/main/L0_MergeRequest_PR pipeline #25442 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@2ez4bz

2ez4bz commented Jan 21, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --extra-stage "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #33017 [ run ] triggered by Bot. Commit: a949e61

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #33017 [ run ] completed with state SUCCESS. Commit: a949e61
/LLM/main/L0_MergeRequest_PR pipeline #25525 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@2ez4bz

2ez4bz commented Jan 22, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --extra-stage "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #33103 [ run ] triggered by Bot. Commit: a949e61

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #33103 [ run ] completed with state SUCCESS. Commit: a949e61
/LLM/main/L0_MergeRequest_PR pipeline #25587 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@lucaslie

Copy link
Copy Markdown
Contributor

/bot run --extra-stage "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #33197 [ run ] triggered by Bot. Commit: a949e61

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #33197 [ run ] completed with state SUCCESS. Commit: a949e61
/LLM/main/L0_MergeRequest_PR pipeline #25649 completed with status: 'SUCCESS'

@lucaslie
lucaslie merged commit 2146c23 into NVIDIA:main Jan 22, 2026
5 checks passed
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.

[Feature]: AutoDeploy: align AD LlmArgs more closely with PT LlmArgs

4 participants