Skip to content

[None][feat] AutoDeploy: Fix hardcoded configs - #14943

Merged
taylor-yb-lee merged 4 commits into
NVIDIA:mainfrom
nv-auto-deploy:taylor/fix_configs
Jun 7, 2026
Merged

[None][feat] AutoDeploy: Fix hardcoded configs#14943
taylor-yb-lee merged 4 commits into
NVIDIA:mainfrom
nv-auto-deploy:taylor/fix_configs

Conversation

@taylor-yb-lee

@taylor-yb-lee taylor-yb-lee commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Tests

    • Added regression tests for auto-deploy engine configuration handling, validating proper propagation of scheduling and batch settings when provided and fallback to defaults when omitted.
  • Chores

    • Enhanced configuration flexibility for the auto-deploy engine to conditionally apply settings from provided configuration or use standard defaults.

Description

  • Fixed some hardcoded configs to be set and propagated properly

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)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • 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

To see a list of available CI bot commands, please comment /bot help.

ADEngine's fake llm_args forced stream_interval=1 -> a response emitted every
decode step -> per-token detok/harmony/HTTP at high concurrency. Read it from
ad_config instead (PyExecutor gates emit on iter % stream_interval).

gpt-oss-120b TP=2 conc=256 trtllm-serve: 17928 -> 23274 tok/s (+29.8%), 0.72x ->
0.93x PT. HTTP chunks/req 807->41.7 (= PT 46), ITL 12.1->7.5 ms, OSL mismatch 307->46.

Signed-off-by: Taylor Yeonbok Lee <249374542+taylor-yb-lee@users.noreply.github.com>
…config

ADEngine's fake llm_args hardcoded scheduling/batching stubs that silently
dropped the user's yaml settings:
  - attention_dp_config = None  -> attention-DP load balancing never engaged
  - batch_wait_timeout_ms = 0
  - batch_wait_timeout_iters = 0
  - batch_wait_max_tokens_ratio = 0.0  -> request-batching accumulation disabled
Read them from ad_config (PyExecutor consumes all four, py_executor.py:366-374),
falling back to the old stub defaults only when ad_config is absent. Pairs with
the stream_interval fix already on this branch.

Signed-off-by: Taylor Yeonbok Lee <249374542+taylor-yb-lee@users.noreply.github.com>
…rom ad_config

Add regression tests in shim/test_engine.py (next to test_engine) covering the
config-plumbing fix:
- test_ad_engine_propagates_pyexecutor_scheduling_config: ad_config with
  stream_interval=20, attention_dp_config(enable_balance=...), batch_wait_*
  must surface on engine.llm_args (not the old hardcoded stubs).
- test_ad_engine_scheduling_config_defaults_without_ad_config: ad_config=None
  falls back to stream_interval=1 / attention_dp_config=None / batch_wait_*=0.
Skipped when CUDA is unavailable (ADEngine builds the model on CUDA).

Signed-off-by: Taylor Yeonbok Lee <249374542+taylor-yb-lee@users.noreply.github.com>
Signed-off-by: Taylor Yeonbok Lee <249374542+taylor-yb-lee@users.noreply.github.com>
@taylor-yb-lee
taylor-yb-lee marked this pull request as ready for review June 4, 2026 06:53
@taylor-yb-lee
taylor-yb-lee requested a review from a team as a code owner June 4, 2026 06:53
@taylor-yb-lee
taylor-yb-lee requested a review from galagam June 4, 2026 06:53
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

ADEngine.init now conditionally initializes scheduling and batch-wait settings from ad_config when provided, otherwise applies previous default values. Two regression tests validate both code paths: one with explicit ad_config settings, another with defaults when ad_config is omitted.

Changes

ADEngine scheduling configuration

Layer / File(s) Summary
ADEngine conditional configuration
tensorrt_llm/_torch/auto_deploy/shim/ad_executor.py
ADEngine.__init__ moves timing/DP field initialization (stream_interval, attention_dp_config, batch_wait_* settings) into conditional branches: populated from ad_config when available, otherwise stub defaults are applied.
Regression tests and test helper
tests/unittest/auto_deploy/singlegpu/shim/test_engine.py
Module imports LlmArgs and AttentionDpConfig. _make_cache_seq_interface helper centralizes CachedSequenceInterface construction. Two CUDA-gated tests: one validates ADEngine propagates ad_config scheduling settings into llm_args; another validates stub defaults when ad_config is omitted.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides a basic explanation of the fix but lacks detail on the specific issue, the solution approach, and test coverage. The Test Coverage section is empty, and the description does not clearly explain what problem the hardcoded configs caused or how the fix addresses it. Expand the Description section to explain the root cause of the hardcoded configs issue and how the conditional logic fixes it. Provide explicit details in the Test Coverage section listing the specific tests added (test_ad_engine_propagates_pyexecutor_scheduling_config and test_ad_engine_scheduling_config_defaults_without_ad_config).
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title 'AutoDeploy: Fix hardcoded configs' directly matches the main objective of the PR, which is to fix hardcoded configuration values in ADEngine so they are properly set from ad_config instead of being forced to stub defaults.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

🧹 Nitpick comments (2)
tests/unittest/auto_deploy/singlegpu/shim/test_engine.py (2)

112-123: ⚡ Quick win

Add return type annotations to newly added helper/tests.

Please add explicit return types for _make_cache_seq_interface, test_ad_engine_propagates_pyexecutor_scheduling_config, and test_ad_engine_scheduling_config_defaults_without_ad_config.

Suggested patch
-def _make_cache_seq_interface(device, max_seq_len=64, max_batch_size=8):
+def _make_cache_seq_interface(
+    device: torch.device, max_seq_len: int = 64, max_batch_size: int = 8
+) -> CachedSequenceInterface:
@@
-def test_ad_engine_propagates_pyexecutor_scheduling_config():
+def test_ad_engine_propagates_pyexecutor_scheduling_config() -> None:
@@
-def test_ad_engine_scheduling_config_defaults_without_ad_config():
+def test_ad_engine_scheduling_config_defaults_without_ad_config() -> None:

As per coding guidelines, "Static type checking with mypy is opt-in by submodule; always annotate functions with return types (use None if function does not return)".

Also applies to: 167-168

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unittest/auto_deploy/singlegpu/shim/test_engine.py` around lines 112 -
123, Add explicit return type annotations to the newly added helper and test
functions: annotate _make_cache_seq_interface to return CachedSequenceInterface,
and annotate the tests test_ad_engine_propagates_pyexecutor_scheduling_config
and test_ad_engine_scheduling_config_defaults_without_ad_config to return None;
update any other nearby functions on lines referenced (e.g., the functions
around 167-168) to include explicit return types as well so the module is fully
annotated for mypy opt-in checks.

122-185: Test coverage for this regression scope is sufficient.

tests/unittest/auto_deploy/singlegpu/shim/test_engine.py now covers both required paths: propagation from ad_config and fallback defaults when ad_config is omitted.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unittest/auto_deploy/singlegpu/shim/test_engine.py` around lines 122 -
185, Tests added (test_ad_engine_propagates_pyexecutor_scheduling_config and
test_ad_engine_scheduling_config_defaults_without_ad_config) verify ADEngine
propagates scheduling/streaming knobs from an LlmArgs ad_config and falls back
to previous stub defaults when omitted; if these tests fail, update
ADEngine.__init__ (the ADEngine constructor) to copy stream_interval,
attention_dp_config, batch_wait_timeout_ms, batch_wait_timeout_iters, and
batch_wait_max_tokens_ratio from the provided ad_config LlmArgs into
engine.llm_args (or preserve existing defaults when ad_config is None), ensuring
AttentionDpConfig fields (enable_balance, batching_wait_iters, timeout_iters)
are preserved; rerun the unit tests with get_inference_model and the
cache_seq_interface fixtures to confirm passing.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/unittest/auto_deploy/singlegpu/shim/test_engine.py`:
- Around line 112-123: Add explicit return type annotations to the newly added
helper and test functions: annotate _make_cache_seq_interface to return
CachedSequenceInterface, and annotate the tests
test_ad_engine_propagates_pyexecutor_scheduling_config and
test_ad_engine_scheduling_config_defaults_without_ad_config to return None;
update any other nearby functions on lines referenced (e.g., the functions
around 167-168) to include explicit return types as well so the module is fully
annotated for mypy opt-in checks.
- Around line 122-185: Tests added
(test_ad_engine_propagates_pyexecutor_scheduling_config and
test_ad_engine_scheduling_config_defaults_without_ad_config) verify ADEngine
propagates scheduling/streaming knobs from an LlmArgs ad_config and falls back
to previous stub defaults when omitted; if these tests fail, update
ADEngine.__init__ (the ADEngine constructor) to copy stream_interval,
attention_dp_config, batch_wait_timeout_ms, batch_wait_timeout_iters, and
batch_wait_max_tokens_ratio from the provided ad_config LlmArgs into
engine.llm_args (or preserve existing defaults when ad_config is None), ensuring
AttentionDpConfig fields (enable_balance, batching_wait_iters, timeout_iters)
are preserved; rerun the unit tests with get_inference_model and the
cache_seq_interface fixtures to confirm passing.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4ea3647f-f265-4c83-bb5a-ea570f151fb4

📥 Commits

Reviewing files that changed from the base of the PR and between 4437cb9 and 4bbea1b.

📒 Files selected for processing (2)
  • tensorrt_llm/_torch/auto_deploy/shim/ad_executor.py
  • tests/unittest/auto_deploy/singlegpu/shim/test_engine.py

@taylor-yb-lee taylor-yb-lee changed the title [None][feat]: AutoDeploy: Fix hardcoded configs [None][feat]: AutoDeploy: Fix hardcoded configs Jun 4, 2026

@galagam galagam left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Thanks!

Approved in CodeRabbit Change Stack

@galagam galagam changed the title [None][feat]: AutoDeploy: Fix hardcoded configs [None][feat] AutoDeploy: Fix hardcoded configs Jun 4, 2026
@galagam

galagam commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52029 [ run ] triggered by Bot. Commit: 4bbea1b Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52029 [ run ] completed with state SUCCESS. Commit: 4bbea1b
/LLM/main/L0_MergeRequest_PR pipeline #41367 completed with status: 'FAILURE'

CI Report

⚠️ 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

Link to invocation

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52155 [ run ] triggered by Bot. Commit: 4bbea1b Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52155 [ run ] completed with state SUCCESS. Commit: 4bbea1b
/LLM/main/L0_MergeRequest_PR pipeline #41477 completed with status: 'FAILURE'

CI Report

⚠️ 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

CI Agent Failure Analysis

Link to invocation

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52422 [ run ] triggered by Bot. Commit: 4bbea1b Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52422 [ run ] completed with state FAILURE. Commit: 4bbea1b
/LLM/main/L0_MergeRequest_PR pipeline #41714 completed with status: 'FAILURE'

CI Report

⚠️ 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

CI Agent Failure Analysis

Link to invocation

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52526 [ run ] triggered by Bot. Commit: 4bbea1b Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52526 [ run ] completed with state SUCCESS. Commit: 4bbea1b
/LLM/main/L0_MergeRequest_PR pipeline #41813 completed with status: 'SUCCESS'

CI Report

Link to invocation

@taylor-yb-lee
taylor-yb-lee merged commit bedad85 into NVIDIA:main Jun 7, 2026
17 of 24 checks passed
2ez4bz pushed a commit to 2ez4bz/TensorRT-LLM that referenced this pull request Jun 8, 2026
Signed-off-by: Taylor Yeonbok Lee <249374542+taylor-yb-lee@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants