Skip to content

Conversation

@KrishnanPrash
Copy link
Contributor

@KrishnanPrash KrishnanPrash commented Jul 31, 2025

Overview:

This PR upgrades the TensorRT-LLM examples from trtllm=1.0.0rc0 to trtllm=1.0.0rc4. The migration involves updating configuration files to align with API changes between these release candidates.

Details:

Mainly consists of config changes, such as:

  • Field Consolidation: Related settings are now grouped as sub-fields under a single parent field for better organization.
  • Implicit Fields: The use_cuda_graph field is now implicitly enabled by the presence of the cuda_graph_config field.
  • Parameter Renames: For example, the autotuner_enabledparameter has been renamed to enable_autotuner.

Summary by CodeRabbit

  • Configuration Updates

    • Consolidated CUDA graph settings into structured sections across multiple configuration files, allowing for more organized parameter management.
    • Moved key-value cache data type specifications into nested configuration blocks for clarity.
    • Updated some configuration parameters, including batch size limits and GPU memory allocation.
    • Standardized boolean formatting and key naming for consistency.
    • Added and restructured sections for cache transceiver and MoE backend configurations.
  • Dependency Update

    • Upgraded the default TensorRT-LLM version to 1.0.0rc4.

@copy-pr-bot
Copy link

copy-pr-bot bot commented Jul 31, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@KrishnanPrash KrishnanPrash changed the title Migrating trtllm examples from 1.0.0rc0 to 1.0.4rc4 fix: Migrating trtllm examples from 1.0.0rc0 to 1.0.4rc4 Jul 31, 2025
@github-actions github-actions bot added the fix label Jul 31, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 31, 2025

Walkthrough

This change restructures multiple YAML configuration files for TensorRT-LLM backends by consolidating CUDA graph and KV cache settings into nested dictionaries, standardizing dtype specification, and introducing or modifying sections such as cuda_graph_config, cache_transceiver_config, and moe_config. Minor code and build script updates accompany these configuration refactors.

Changes

Cohort / File(s) Change Summary
Top-level CUDA graph config restructuring
components/backends/trtllm/engine_configs/agg.yaml, components/backends/trtllm/engine_configs/prefill.yaml, components/backends/trtllm/engine_configs/decode.yaml
Replaced flat use_cuda_graph and max_batch_size keys with a nested cuda_graph_config containing max_batch_size. Added cache_transceiver_config in some files.
DeepSeek MTP config refactor
components/backends/trtllm/engine_configs/deepseek_r1/mtp/mtp_agg.yaml, .../mtp/mtp_decode.yaml, .../mtp/mtp_prefill.yaml
Moved kv_cache_dtype into kv_cache_config as dtype. Consolidated CUDA graph settings (use_cuda_graph, cuda_graph_padding_enabled, cuda_graph_batch_sizes) under a new nested cuda_graph_config block, preserving values but restructuring.
DeepSeek Simple config refactor
components/backends/trtllm/engine_configs/deepseek_r1/simple/agg.yaml, .../simple/decode.yaml, .../simple/prefill.yaml
Updated kv_cache_config to include dtype: fp8 instead of a separate kv_cache_dtype. Consolidated CUDA graph settings into a nested cuda_graph_config with enable_padding and batch_sizes.
DeepSeek WideEP config refactor
components/backends/trtllm/engine_configs/deepseek_r1/wide_ep/dep16_agg.yaml, .../wide_ep/wide_ep_agg.yaml, .../wide_ep/wide_ep_decode.yaml, .../wide_ep/wide_ep_prefill.yaml
Changed moe_backend/moe_load_balancer to nested moe_config. Standardized kv_cache_config with dtype, reduced free_gpu_memory_fraction in some files, and restructured CUDA graph settings into cuda_graph_config. Adjusted some parameter values and comments.
Llama4 Eagle config adjustments
components/backends/trtllm/engine_configs/llama4/eagle/eagle_agg.yaml, .../eagle/eagle_decode.yaml, .../eagle/eagle_prefill.yaml
Renamed some keys for clarity (autotuner_enabledenable_autotuner). Standardized boolean formatting. Moved CUDA graph settings to new cuda_graph_config with max_batch_size. Migrated kv_cache_dtype into kv_cache_config as dtype. Adjusted speculative config keys and values.
Python code update
components/backends/trtllm/src/dynamo/trtllm/main.py
Changed attribute-style access for event_buffer_max_size in kv_cache_config to explicit dictionary key checking and assignment.
Build script update
container/build.sh
Updated TensorRT-LLM pip wheel version from 1.0.0rc0 to 1.0.0rc4 and removed outdated comments.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ConfigFile
    participant BackendEngine

    User->>ConfigFile: Edits YAML (adds cuda_graph_config, dtype, etc.)
    ConfigFile->>BackendEngine: Loads nested config structure
    BackendEngine->>BackendEngine: Parses cuda_graph_config, kv_cache_config
    BackendEngine->>BackendEngine: Applies settings (max_batch_size, dtype, etc.)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

A rabbit with YAML in paw,
Hops through configs, fixing each flaw.
CUDA graphs nested, dtypes aligned,
MoE and Eagle, all redefined.
With a twitch of the nose and a version anew,
This bunny brings order—so engines can chew!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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

🔭 Outside diff range comments (3)
components/backends/trtllm/engine_configs/agg.yaml (1)

19-20: Duplicate max_batch_size – pick one source of truth.
max_batch_size is declared both at the top level (Line 19) and inside cuda_graph_config (Line 34).
Leaving both leads to ambiguous or loader-specific precedence rules.

Suggested fix: drop the top-level key and keep the nested value.

-max_batch_size: 16

Also applies to: 33-34

components/backends/trtllm/engine_configs/llama4/eagle/eagle_decode.yaml (1)

38-50: Out-of-date CUDA-graph keys still present – migrate to cuda_graph_config.
use_cuda_graph, cuda_graph_padding_enabled, cuda_graph_batch_sizes, and print_iter_log were removed from the API.
Keeping them will cause loader failures on ≥ 1.0.4.

-use_cuda_graph: true
-cuda_graph_padding_enabled: true
-cuda_graph_batch_sizes:
-- 1
-- 2
-- 4
-- 8
-- 16
-- 32
-- 64
-- 128
-- 256
-print_iter_log: true
+cuda_graph_config:
+  max_batch_size: 256
components/backends/trtllm/engine_configs/llama4/eagle/eagle_prefill.yaml (1)

23-25: Out-of-date keys: migrate to 1.0.4 schema
kv_cache_dtype and autotuner_enabled are legacy names. The new schema expects:

kv_cache_config:
  free_gpu_memory_fraction: 0.5
  enable_block_reuse: false
  dtype: fp8          # <-- migrate here

enable_autotuner: false   # <-- renamed

Retaining the old keys will lead to “unknown field” errors.

-kv_cache_dtype: fp8
-disable_overlap_scheduler: true
-autotuner_enabled: false
+disable_overlap_scheduler: true
+enable_autotuner: false
+
+kv_cache_config:
+  free_gpu_memory_fraction: 0.5
+  enable_block_reuse: false
+  dtype: fp8
🧹 Nitpick comments (11)
components/backends/trtllm/engine_configs/deepseek_r1/simple/prefill.yaml (1)

36-36: Add trailing newline to satisfy YAML-lint.
File currently ends without a newline which triggers the new-line-at-end-of-file rule.

-print_iter_log: true
+print_iter_log: true
+
components/backends/trtllm/engine_configs/prefill.yaml (1)

24-30: Minor formatting – missing EOF newline.
Identical linter warning as elsewhere; add one blank line after backend: default.

   backend: default
+
components/backends/trtllm/engine_configs/agg.yaml (1)

33-34: Trailing newline missing.
Same YAML-lint error; append one newline.

   max_batch_size: 16
+
components/backends/trtllm/engine_configs/deepseek_r1/wide_ep/dep16_agg.yaml (1)

14-17: Check FP8 availability comment

dtype: fp8 is valid only on Hopper/Blackwell or later GPUs and requires --fp8_kv_cache enablement at runtime.
Consider adding an inline comment (as done in other files) or a guard in the launcher script to avoid silent mis-config on older HW.

components/backends/trtllm/engine_configs/deepseek_r1/mtp/mtp_agg.yaml (1)

30-32: Consistency: add HW note for dtype: fp8

Mirror the explanatory comment you placed in other DeepSeek configs so future maintainers know why FP8 is chosen and on which GPUs it is safe.

components/backends/trtllm/engine_configs/deepseek_r1/simple/decode.yaml (1)

34-34: Minor: duplicate HW disclaimer

For parity with other files, add the standard comment explaining FP8 support requirements just above this line.

components/backends/trtllm/engine_configs/deepseek_r1/wide_ep/wide_ep_prefill.yaml (1)

41-41: No trailing newline — YAML-lint error

Static analysis flagged the missing newline at EOF. Add one to keep linters green.

-print_iter_log: true
+print_iter_log: true
+
components/backends/trtllm/engine_configs/deepseek_r1/simple/agg.yaml (1)

34-34: Add FP8 support comment

Replicate the FP8 hardware support note for clarity.

components/backends/trtllm/engine_configs/deepseek_r1/mtp/mtp_decode.yaml (1)

54-54: Missing trailing newline
YAML-lint flags the absence of a newline at EOF. Add one to keep linters quiet.

-print_iter_log: true
+print_iter_log: true
+
components/backends/trtllm/engine_configs/deepseek_r1/wide_ep/wide_ep_agg.yaml (1)

28-39: CUDA-graph block looks good but newline missing
Config is valid; however, the file again lacks a trailing newline – fix to satisfy linters.

   - 256
+
components/backends/trtllm/engine_configs/decode.yaml (1)

30-31: Add missing newline at end of file.

The file is missing a newline character at the end, which violates YAML formatting conventions.

 cache_transceiver_config:
-  backend: default
+  backend: default
+
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 97390ac and f53beab.

📒 Files selected for processing (18)
  • components/backends/trtllm/engine_configs/agg.yaml (1 hunks)
  • components/backends/trtllm/engine_configs/decode.yaml (1 hunks)
  • components/backends/trtllm/engine_configs/deepseek_r1/mtp/mtp_agg.yaml (1 hunks)
  • components/backends/trtllm/engine_configs/deepseek_r1/mtp/mtp_decode.yaml (1 hunks)
  • components/backends/trtllm/engine_configs/deepseek_r1/mtp/mtp_prefill.yaml (1 hunks)
  • components/backends/trtllm/engine_configs/deepseek_r1/simple/agg.yaml (1 hunks)
  • components/backends/trtllm/engine_configs/deepseek_r1/simple/decode.yaml (1 hunks)
  • components/backends/trtllm/engine_configs/deepseek_r1/simple/prefill.yaml (1 hunks)
  • components/backends/trtllm/engine_configs/deepseek_r1/wide_ep/dep16_agg.yaml (1 hunks)
  • components/backends/trtllm/engine_configs/deepseek_r1/wide_ep/wide_ep_agg.yaml (1 hunks)
  • components/backends/trtllm/engine_configs/deepseek_r1/wide_ep/wide_ep_decode.yaml (2 hunks)
  • components/backends/trtllm/engine_configs/deepseek_r1/wide_ep/wide_ep_prefill.yaml (2 hunks)
  • components/backends/trtllm/engine_configs/llama4/eagle/eagle_agg.yaml (1 hunks)
  • components/backends/trtllm/engine_configs/llama4/eagle/eagle_decode.yaml (1 hunks)
  • components/backends/trtllm/engine_configs/llama4/eagle/eagle_prefill.yaml (1 hunks)
  • components/backends/trtllm/engine_configs/prefill.yaml (1 hunks)
  • components/backends/trtllm/src/dynamo/trtllm/main.py (1 hunks)
  • container/build.sh (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
container/build.sh (2)

Learnt from: ptarasiewiczNV
PR: #2027
File: container/deps/vllm/install_vllm.sh:0-0
Timestamp: 2025-07-22T10:22:28.972Z
Learning: The --torch-backend=auto flag works with vLLM installations via uv pip install, even though it's not a standard pip option. This flag is processed by vLLM's build system during installation to automatically match PyTorch distribution with container CUDA versions.

Learnt from: zaristei
PR: #2020
File: container/deps/vllm/install_vllm.sh:115-118
Timestamp: 2025-07-21T00:10:56.947Z
Learning: Graceful fallback for PyTorch wheel installation is broken on ARM architecture, so immediate exit on pinned version failure is preferred over fallback mechanisms in container/deps/vllm/install_vllm.sh for ARM64.

components/backends/trtllm/engine_configs/deepseek_r1/wide_ep/dep16_agg.yaml (1)

Learnt from: nnshah1
PR: #1444
File: tests/fault_tolerance/configs/agg_tp_1_dp_8.yaml:31-38
Timestamp: 2025-07-01T15:33:53.262Z
Learning: In fault tolerance test configurations, the resources section under ServiceArgs specifies resources per individual worker, not total resources for all workers. So workers: 8 with gpu: '1' means 8 workers × 1 GPU each = 8 GPUs total.

components/backends/trtllm/engine_configs/llama4/eagle/eagle_agg.yaml (1)

Learnt from: ptarasiewiczNV
PR: #2027
File: container/deps/vllm/install_vllm.sh:0-0
Timestamp: 2025-07-22T10:22:28.972Z
Learning: The --torch-backend=auto flag works with vLLM installations via uv pip install, even though it's not a standard pip option. This flag is processed by vLLM's build system during installation to automatically match PyTorch distribution with container CUDA versions.

🪛 YAMLlint (1.37.1)
components/backends/trtllm/engine_configs/deepseek_r1/simple/prefill.yaml

[error] 36-36: no new line character at the end of file

(new-line-at-end-of-file)

components/backends/trtllm/engine_configs/agg.yaml

[error] 34-34: no new line character at the end of file

(new-line-at-end-of-file)

components/backends/trtllm/engine_configs/prefill.yaml

[error] 30-30: no new line character at the end of file

(new-line-at-end-of-file)

components/backends/trtllm/engine_configs/deepseek_r1/wide_ep/wide_ep_prefill.yaml

[error] 41-41: no new line character at the end of file

(new-line-at-end-of-file)

components/backends/trtllm/engine_configs/deepseek_r1/mtp/mtp_decode.yaml

[error] 54-54: no new line character at the end of file

(new-line-at-end-of-file)

components/backends/trtllm/engine_configs/deepseek_r1/wide_ep/wide_ep_agg.yaml

[error] 39-39: no new line character at the end of file

(new-line-at-end-of-file)

components/backends/trtllm/engine_configs/decode.yaml

[error] 31-31: no new line character at the end of file

(new-line-at-end-of-file)

⏰ 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). (4)
  • GitHub Check: pre-merge-rust (lib/runtime/examples)
  • GitHub Check: pre-merge-rust (lib/bindings/python)
  • GitHub Check: pre-merge-rust (.)
  • GitHub Check: Build and Test - vllm
🔇 Additional comments (17)
components/backends/trtllm/engine_configs/deepseek_r1/mtp/mtp_prefill.yaml (1)

28-31: dtype nesting matches the 1.0.4rc4 schema – looks good.
No further issues spotted in this hunk.

components/backends/trtllm/engine_configs/deepseek_r1/simple/prefill.yaml (1)

27-30: Correct relocation of dtype into kv_cache_config.
Change is compliant with the new spec.

components/backends/trtllm/engine_configs/deepseek_r1/simple/decode.yaml (1)

42-56: Verify field name correctness

This file uses enable_padding, whereas simple/agg.yaml uses enable_graph_padding.
Please confirm which spelling the trtllm loader accepts in 1.0.4rc4 and normalise across all configs to avoid hard-to-debug mismatches.

components/backends/trtllm/engine_configs/deepseek_r1/wide_ep/wide_ep_prefill.yaml (1)

32-35: Changed free_gpu_memory_fraction from 0.75 → 0.3

This is a large swing; make sure the reduction is intentional and tested, otherwise you may hit OOM on high-concurrency prefill.

components/backends/trtllm/engine_configs/deepseek_r1/mtp/mtp_decode.yaml (2)

34-34: dtype moved under kv_cache_config – good migration
Placing dtype: fp8 inside kv_cache_config brings this file in line with the 1.0.4 schema. No issues spotted.


41-53: Double-check CUDA-graph batch list vs. max_batch_size
max_batch_size (Line 25) is 256, yet the largest graph batch registered is also 256. Any future increase of max_batch_size without expanding this list will silently fall back to eager mode and negate CUDA-graph benefits. Consider adding a comment or helper script guarding this invariant.

components/backends/trtllm/engine_configs/deepseek_r1/wide_ep/wide_ep_agg.yaml (2)

6-15: Verify backend: WIDEEP spelling
Upstream docs use WidEEP/WideEP. Confirm that the all-caps WIDEEP is what 1.0.4 expects—otherwise MoE routing will fail at load time.


25-26: Dramatic drop of free_gpu_memory_fraction to 0.3
Going from 0.7 ➜ 0.3 frees memory for DP attention but can throttle throughput due to smaller KV pages. Make sure this is intentional and tested.

components/backends/trtllm/engine_configs/deepseek_r1/wide_ep/wide_ep_decode.yaml (3)

18-21: Backend naming & path sanity
Same WIDEEP spelling question as in agg file. Also ensure the absolute path in load_balancer exists inside the container image.


39-39: Nice: KV-cache dtype now scoped
dtype: fp8 under kv_cache_config is the correct 1.0.4 placement.


47-60: CUDA-graph section OK
Padding enabled and batch sizes cover the advertised range. No action required.

container/build.sh (1)

97-97: Update to tensorrt-llm==1.0.0rc4 acknowledged
Version bump matches the configs. Ensure any cached wheel directories or pinned commit hashes still correspond to RC4 to avoid ABI mismatches.

components/backends/trtllm/engine_configs/llama4/eagle/eagle_prefill.yaml (1)

32-32: Lower-case boolean fixed – thanks
YAML boolean now valid.

components/backends/trtllm/src/dynamo/trtllm/main.py (1)

104-107: LGTM! Proper dictionary key access implementation.

The change correctly updates from attribute-style access to dictionary key checking, which aligns with the configuration restructuring in this TensorRT-LLM migration. The logic properly sets the default buffer size only when the key is absent.

components/backends/trtllm/engine_configs/decode.yaml (1)

24-25: LGTM! Proper CUDA graph configuration consolidation.

The restructuring of CUDA graph settings into a nested cuda_graph_config dictionary aligns with the API changes in TensorRT-LLM 1.0.4rc4 and improves configuration organization.

components/backends/trtllm/engine_configs/llama4/eagle/eagle_agg.yaml (2)

24-24: LGTM! Parameter rename aligns with API update.

The rename from autotuner_enabled to enable_autotuner follows the TensorRT-LLM 1.0.4rc4 API conventions mentioned in the PR objectives.


39-40: LGTM! CUDA graph configuration consolidation.

The restructuring into nested cuda_graph_config is consistent with the migration to TensorRT-LLM 1.0.4rc4 and matches the pattern used across other configuration files.

@KrishnanPrash
Copy link
Contributor Author

For trtllm/deepseek/wide_ep example, the current config changes are partial.
@tanmayv25 is actively looking into this and will address any gaps in a follow-up PR [#2198].

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants