[AutoDeploy] yaml config loader for dynamic settings (closes #4366) - #73
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a mix-in and settings source class to enable dynamic, deep-merged YAML configs in Pydantic-based settings, plus a comprehensive test suite covering merge behavior and precedence.
- Introduces
DynamicYamlWithDeepMergeSettingsSourceandDynamicYamlMixInForSettingsfor loading and merging multiple YAML files. - Adds extensive unit tests in
test_config.pyto validate loading, merge order, nested settings, env overrides, and error handling.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| tests/unittest/_torch/auto_deploy/unit/singlegpu/utils/test_config.py | Added a broad suite of tests for dynamic YAML config loading, merging, and precedence |
| tensorrt_llm/_torch/auto_deploy/utils/_config.py | Implemented dynamic YAML settings source with deep merge and the corresponding mix-in |
Comments suppressed due to low confidence (1)
tests/unittest/_torch/auto_deploy/unit/singlegpu/utils/test_config.py:321
- The docstring doesn't match the test's intention (inner init should take precedence). Update it to describe that inner init arguments override outer YAML configs.
"""Test precedence: outer yaml configs override inner yaml configs."""
|
I'll be useful to see how ergonomic it is to use yaml to configure the inference optimizer -- a comment for the follow-up PR |
lucaslie
commented
Jul 7, 2025
lucaslie
left a comment
Author
There was a problem hiding this comment.
TODO: add commit with changes currently on the ll/base_transformation branch
Fridah-nv
reviewed
Jul 7, 2025
Fridah-nv
reviewed
Jul 7, 2025
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
lucaslie
force-pushed
the
ll/yaml_config_mixin
branch
from
July 9, 2025 20:17
897858d to
e00809d
Compare
lucaslie
added a commit
that referenced
this pull request
Jul 18, 2025
) (#73) * yaml config loader for dynamic settings Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com> * updates for yaml mixin Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com> * addressing reviewer feedback Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com> --------- Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
lucaslie
added a commit
that referenced
this pull request
Jul 21, 2025
) (#73) * yaml config loader for dynamic settings Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com> * updates for yaml mixin Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com> * addressing reviewer feedback Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com> --------- Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a utility (as a mix-in class) to dynamically merge yaml config files into pydantic base settings (our config system in TRT-LLM).
For now, it's only used in the accompanying unit test but I anticipate this to the main mechanism to configure our modular
InferenceOptimizer(i.e. a custom InferenceOptimizer = default class + custom yaml config).Other argument sources (like CLI arguments), default values, and init values are still valid as well of course