Skip to content

Conversation

@QiJune
Copy link
Collaborator

@QiJune QiJune commented Nov 18, 2025

Summary by CodeRabbit

  • New Features

    • Added support for multiple speculative decoding modes (Eagle, Medusa, Lookahead, NGram, and others) for improved token generation performance.
    • Introduced prompt adapter support with configurable token limits.
    • Enhanced LoRA configuration with improved consistency validation and default module suggestions.
  • Bug Fixes

    • Improved runtime validation for batch size and token consistency checks.
    • Added validation to prevent incompatible configuration combinations.
  • Refactor

    • Reorganized configuration initialization and validation logic for better runtime/build-time alignment.

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

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

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 a review from a team as a code owner November 18, 2025 06:18
@QiJune QiJune requested a review from hchings November 18, 2025 06:18
@QiJune
Copy link
Collaborator Author

QiJune commented Nov 18, 2025

/bot run

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 18, 2025

📝 Walkthrough

Walkthrough

The pull request refactors and extends llm_args.py by replacing a model-format validator with a runtime consistency checker, introducing new configuration validators for LoRA and PEFT caching, adding a new TrtLlmArgs class with extended build and runtime parameters, and integrating comprehensive speculative-config validation with decoding-mode mapping and build-config synchronization logic.

Changes

Cohort / File(s) Summary
Core Validation Refactoring
tensorrt_llm/llmapi/llm_args.py
Replaced validate_model_format_misc in BaseLlmArgs with validate_runtime_args to check max_batch_size vs max_num_tokens consistency. Added validate_lora_config_consistency to warn on empty lora_dir and enforce default LoRA targets. Added validate_peft_cache_config to reject lora_prefetch_dir with PEFT cache.
New Utility Method
tensorrt_llm/llmapi/llm_args.py
Added get_runtime_sizes method to BaseLlmArgs returning a tuple of (max_beam_width, max_num_tokens, max_seq_len, max_batch_size).
TrtLlmArgs Class Introduction
tensorrt_llm/llmapi/llm_args.py
Introduced new TrtLlmArgs class extending BaseLlmArgs with extended fields (enable_tqdm, workspace, enable_build_cache, calib_config, quant_config, embedding_parallel_mode, fast_build, build_config, enable_prompt_adapter, max_prompt_adapter_token, batching_type, normalize_log_probs, _convert_checkpoint_options) and enhanced init_build_config logic to auto-create BuildConfig from runtime parameters.
Model Format & Speculative Config Handling
tensorrt_llm/llmapi/llm_args.py
Enhanced validate_model_format_misc in TorchLlmArgs to store HF as default format. Added validate_speculative_config with comprehensive logic handling Eagle, Medusa, Lookahead, NGram, DraftTarget, MTP, UserProvided, Auto, and SaveHiddenStates types, including decoding-mode mapping, build_config synchronization, and speculative model directory/format derivation.

Sequence Diagram

sequenceDiagram
    participant Client
    participant BaseLlmArgs
    participant TrtLlmArgs
    participant Validators
    participant BuildConfig

    Client->>TrtLlmArgs: Create instance with args
    TrtLlmArgs->>Validators: validate_model_format_misc()
    Validators->>Validators: Set model_format=HF (default)
    Validators->>Validators: Check speculative_config type
    
    alt Speculative Config Present
        Validators->>Validators: Map config type to decoding_mode
        Validators->>BuildConfig: Sync decoding settings
        Validators->>BuildConfig: Adjust max_draft_len if needed
    end
    
    TrtLlmArgs->>Validators: validate_lora_config_consistency()
    Validators->>Validators: Check lora_dir && lora_config
    
    TrtLlmArgs->>Validators: validate_peft_cache_config()
    Validators->>Validators: Reject lora_prefetch_dir if PEFT enabled
    
    TrtLlmArgs->>Validators: validate_runtime_args()
    Validators->>Validators: Check max_batch_size vs max_num_tokens
    
    TrtLlmArgs->>TrtLlmArgs: init_build_config()
    TrtLlmArgs->>BuildConfig: Auto-create if missing
    TrtLlmArgs->>BuildConfig: Incorporate runtime knobs
    
    Client->>TrtLlmArgs: get_runtime_sizes()
    TrtLlmArgs-->>Client: Return (max_beam_width, max_num_tokens, max_seq_len, max_batch_size)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45–75 minutes

  • Speculative config validation logic: Covers 8+ config types with distinct handling paths, decoding-mode mappings, and build_config interactions requiring careful verification of each branch.
  • TrtLlmArgs class introduction: New class with 13+ new fields and initialization logic; requires understanding of interaction between build_config auto-creation and runtime parameter propagation.
  • Validator refactoring: Three new validators plus changes to existing validation flow; review must confirm correct invocation order and consistency checks.
  • Build_config synchronization: Complex cross-cutting concerns between speculative config types, model formats, and build_config state; potential for subtle integration bugs.
  • Runtime vs. build parameter alignment: New get_runtime_sizes and enhanced init_build_config require verification that runtime/build knob merging logic is correct and non-redundant.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ⚠️ Warning PR description is essentially empty with only template placeholders filled. The Description, Test Coverage sections lack content, leaving unclear what changes were made and why. Fill in the Description section explaining what was moved and why, and the Test Coverage section listing tests that validate the changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main refactoring change: moving build config from BaseLlmArgs to TrtLlmArgs.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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 (2)
tensorrt_llm/llmapi/llm_args.py (2)

1994-2021: Clarify the LoRA config validation logic.

The validator handles multiple scenarios but the interaction between enable_lora and lora_config could be clearer:

  1. Lines 2003-2008: You warn when enable_lora is set alongside lora_config for PyTorch backends, suggesting enable_lora is ignored. However, this check only applies when both are truthy.
  2. Lines 2010-2020: Auto-populating lora_target_modules when both lora_dir and lora_target_modules are empty is helpful, but consider whether this default should apply in all cases or only when LoRA is explicitly enabled.

Consider adding a comment explaining the precedence rules:

+    # Precedence: lora_config > enable_lora
     if self.enable_lora and self.lora_config is not None and self.backend in [
             'pytorch', '_autodeploy'
     ]:

2115-2153: Document the overwriting behavior.

The validator silently overwrites max_batch_size and max_num_tokens if they exceed build_config values (lines 2125-2136), which could be surprising to users. While warnings are logged, consider whether these should fail fast instead.

Consider making this behavior more explicit in the field documentation or raising an error instead of silently capping:

         if self.max_batch_size is not None:
             if self.max_batch_size > self.build_config.max_batch_size:
+                # Option 1: Raise an error
+                raise ValueError(
+                    f"max_batch_size [{self.max_batch_size}] exceeds build_config.max_batch_size [{self.build_config.max_batch_size}]"
+                )
+                # Option 2: Keep current behavior but improve logging
                 self.max_batch_size = self.build_config.max_batch_size
                 logger.warning(
                     f"max_batch_size [{self.max_batch_size}] is overridden by build_config.max_batch_size [{self.build_config.max_batch_size}] in build_config"
                 )
📜 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 96cfdd8 and 40c40fe.

📒 Files selected for processing (1)
  • tensorrt_llm/llmapi/llm_args.py (4 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
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.
Learnt from: amitz-nv
Repo: NVIDIA/TensorRT-LLM PR: 8063
File: tensorrt_llm/lora_manager.py:1080-1112
Timestamp: 2025-09-29T15:14:28.503Z
Learning: In tensorrt_llm/lora_manager.py, when calculating part_sizes for attn_qkv fused LoRA modules, the sizes are correctly multiplied by tp_size because model_config.num_heads and model_config.num_kv_heads are already divided by tp_size (per-TP-rank values), so multiplication is needed to get the original full concatenated dimension size. The interleave_fused_lora_weights_for_tp function provides proper validation with asserts for total size and TP divisibility.
Learnt from: amitz-nv
Repo: NVIDIA/TensorRT-LLM PR: 8063
File: tensorrt_llm/lora_manager.py:1080-1112
Timestamp: 2025-09-29T15:14:28.503Z
Learning: In tensorrt_llm/lora_manager.py, when calculating part_sizes for attn_qkv fused LoRA modules, the sizes are correctly multiplied by tp_size because model_config.num_heads and model_config.num_kv_heads are already divided by tp_size (per-TP-rank values), so multiplication is needed to get the original full concatenated dimension size. The interleave_fused_lora_weights_for_tp function provides proper validation.
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: amitz-nv
Repo: NVIDIA/TensorRT-LLM PR: 8063
File: tensorrt_llm/lora_manager.py:1080-1112
Timestamp: 2025-09-29T15:14:28.503Z
Learning: In tensorrt_llm/lora_manager.py, when calculating part_sizes for attn_qkv fused LoRA modules, the sizes are correctly multiplied by tp_size because model_config.num_heads and model_config.num_kv_heads are already divided by tp_size (per-TP-rank values), so multiplication is needed to get the original full concatenated dimension size. The interleave_fused_lora_weights_for_tp function provides proper validation.
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.
Learnt from: shaharmor98
Repo: NVIDIA/TensorRT-LLM PR: 7231
File: tensorrt_llm/_torch/pyexecutor/_util.py:504-509
Timestamp: 2025-08-26T06:07:02.166Z
Learning: In tensorrt_llm/_torch/pyexecutor/_util.py, when calling model_engine.set_lora_model_config(), pass model_binding_config.mlp_hidden_size directly without multiplying by mapping.tp_size, as the mlp_hidden_size from get_bindings_model_config() is already the per-TP rank value needed for LoRA weight packaging.
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.
📚 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:

  • tensorrt_llm/llmapi/llm_args.py
📚 Learning: 2025-09-29T15:14:28.503Z
Learnt from: amitz-nv
Repo: NVIDIA/TensorRT-LLM PR: 8063
File: tensorrt_llm/lora_manager.py:1080-1112
Timestamp: 2025-09-29T15:14:28.503Z
Learning: In tensorrt_llm/lora_manager.py, when calculating part_sizes for attn_qkv fused LoRA modules, the sizes are correctly multiplied by tp_size because model_config.num_heads and model_config.num_kv_heads are already divided by tp_size (per-TP-rank values), so multiplication is needed to get the original full concatenated dimension size. The interleave_fused_lora_weights_for_tp function provides proper validation with asserts for total size and TP divisibility.

Applied to files:

  • tensorrt_llm/llmapi/llm_args.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, 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/llmapi/llm_args.py
📚 Learning: 2025-09-29T15:14:28.503Z
Learnt from: amitz-nv
Repo: NVIDIA/TensorRT-LLM PR: 8063
File: tensorrt_llm/lora_manager.py:1080-1112
Timestamp: 2025-09-29T15:14:28.503Z
Learning: In tensorrt_llm/lora_manager.py, when calculating part_sizes for attn_qkv fused LoRA modules, the sizes are correctly multiplied by tp_size because model_config.num_heads and model_config.num_kv_heads are already divided by tp_size (per-TP-rank values), so multiplication is needed to get the original full concatenated dimension size. The interleave_fused_lora_weights_for_tp function provides proper validation.

Applied to files:

  • tensorrt_llm/llmapi/llm_args.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/llmapi/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/llmapi/llm_args.py
📚 Learning: 2025-08-26T06:07:02.166Z
Learnt from: shaharmor98
Repo: NVIDIA/TensorRT-LLM PR: 7231
File: tensorrt_llm/_torch/pyexecutor/_util.py:504-509
Timestamp: 2025-08-26T06:07:02.166Z
Learning: In tensorrt_llm/_torch/pyexecutor/_util.py, when calling model_engine.set_lora_model_config(), pass model_binding_config.mlp_hidden_size directly without multiplying by mapping.tp_size, as the mlp_hidden_size from get_bindings_model_config() is already the per-TP rank value needed for LoRA weight packaging.

Applied to files:

  • tensorrt_llm/llmapi/llm_args.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:

  • tensorrt_llm/llmapi/llm_args.py
📚 Learning: 2025-08-21T00:16:56.457Z
Learnt from: farshadghodsian
Repo: NVIDIA/TensorRT-LLM PR: 7101
File: docs/source/blogs/tech_blog/blog9_Deploying_GPT_OSS_on_TRTLLM.md:36-36
Timestamp: 2025-08-21T00:16:56.457Z
Learning: TensorRT-LLM container release tags in documentation should only reference published NGC container images. The README badge version may be ahead of the actual published container versions.

Applied to files:

  • tensorrt_llm/llmapi/llm_args.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:

  • tensorrt_llm/llmapi/llm_args.py
🧬 Code graph analysis (1)
tensorrt_llm/llmapi/llm_args.py (5)
tensorrt_llm/logger.py (1)
  • warning (132-133)
tensorrt_llm/lora_helper.py (1)
  • get_default_trtllm_modules_to_hf_modules (42-58)
tensorrt_llm/builder.py (2)
  • default (45-50)
  • BuildConfig (453-611)
tensorrt_llm/llmapi/llm_utils.py (1)
  • model_format (286-287)
tensorrt_llm/llmapi/utils.py (1)
  • get_type_repr (662-667)
🪛 Ruff (0.14.5)
tensorrt_llm/llmapi/llm_args.py

2026-2028: Avoid specifying long messages outside the exception class

(TRY003)


2698-2700: Avoid specifying long messages outside the exception class

(TRY003)


2729-2731: Avoid specifying long messages outside the exception class

(TRY003)

⏰ 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 (8)
tensorrt_llm/llmapi/llm_args.py (8)

1986-1992: LGTM - Runtime consistency check looks good.

The validator appropriately warns when max_batch_size exceeds max_num_tokens, which helps catch potential configuration issues without blocking execution.


2023-2029: LGTM - Appropriate validation for unsupported feature.

The validator correctly prevents the use of lora_prefetch_dir when PEFT cache is configured, as this combination is not currently supported.


2040-2093: LGTM - Well-structured new TrtLlmArgs class.

The new TrtLlmArgs class properly extends BaseLlmArgs with TensorRT-specific configuration options. Field definitions are well-documented and have sensible defaults.


2094-2113: LGTM - Sensible default BuildConfig creation.

The validator appropriately creates a default BuildConfig when none is provided, using runtime parameters as defaults. This ensures build_config is always initialized.


2219-2227: LGTM - Eagle config instantiation looks correct.

The Eagle configuration is properly constructed with all required parameters from speculative_config.


2306-2343: LGTM - Proper model format detection and configuration loading.

The validator correctly:

  1. Detects model format (TLLM_ENGINE, TLLM_CKPT, or HF)
  2. Loads appropriate configurations from engine or checkpoint directories
  3. Warns when build_config is provided but ignored for TLLM_ENGINE format
  4. Fills KV cache config from runtime defaults when available

2688-2692: LGTM - Appropriate model format for PyTorch backend.

Setting _model_format to HF is correct for the PyTorch backend, which works with HuggingFace models.


2694-2744: LGTM - Comprehensive speculative config validation.

The validator properly handles all speculative decoding config types with appropriate assertions and configuration adjustments:

  1. Eagle, NGram, DraftTarget: Validates required fields
  2. MTP: Sets max_draft_len from num_nextn_predict_layers
  3. SaveHiddenStates: Appropriately constrains batch size and disables incompatible features
  4. Extracts and validates speculative model directory and format

The logic is thorough and handles all supported speculation types correctly.

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24855 [ run ] triggered by Bot. Commit: 40c40fe

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

QiJune commented Nov 18, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24860 [ run ] triggered by Bot. Commit: cff1605

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24855 [ run ] completed with state ABORTED. Commit: 40c40fe
LLM/main/L0_MergeRequest_PR #18762 (Blue Ocean) completed with status: ABORTED

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

QiJune commented Nov 18, 2025

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24883 [ run ] triggered by Bot. Commit: 2056f58

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24860 [ run ] completed with state ABORTED. Commit: cff1605
LLM/main/L0_MergeRequest_PR #18766 (Blue Ocean) completed with status: ABORTED

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

QiJune commented Nov 18, 2025

/bot run --stage-list "H100_PCIe-PyTorch-1,H100_PCIe-PyTorch-2,H100_PCIe-PyTorch-3,H100_PCIe-PyTorch-4"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24906 [ run ] triggered by Bot. Commit: c932948

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24883 [ run ] completed with state ABORTED. Commit: 2056f58
LLM/main/L0_MergeRequest_PR #18786 (Blue Ocean) completed with status: ABORTED

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24906 [ run ] completed with state SUCCESS. Commit: c932948
/LLM/main/L0_MergeRequest_PR pipeline #18807 (Partly Tested) completed with status: 'SUCCESS'

@QiJune
Copy link
Collaborator Author

QiJune commented Nov 19, 2025

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #24956 [ run ] triggered by Bot. Commit: c932948

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants