feat(config): opt in to typed nested dataclass construction - #3903
Open
hasuoshenyun wants to merge 2 commits into
Open
hasuoshenyun wants to merge 2 commits into
hasuoshenyun wants to merge 2 commits into
Conversation
4 tasks
Signed-off-by: hasuoshenyun <1225541074@qq.com>
Signed-off-by: hasuoshenyun <1225541074@qq.com>
hasuoshenyun
force-pushed
the
hasuoshenyun/feat/typed-config-fields
branch
from
September 21, 2026 09:20
14255cc to
10f9d6c
Compare
hasuoshenyun
marked this pull request as ready for review
September 21, 2026 09:20
Author
|
Hi @akoumpa, this PR is now ready for review and independent of #3902, rebased onto main. The diff contains only the config loader and its tests. The recursive opt-in/fallback contract is documented, and all 97 config tests pass locally on head 10f9d6c. Could you please review and authorize CI for this SHA when convenient? Thank you! |
This branch has not been deployed
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.
What does this PR do ?
Allow dataclass fields to explicitly opt into typed nested YAML construction at the existing ConfigNode boundary.
Changelog
field(metadata={"instantiate": True})for unambiguous typed nested dataclasses and homogeneous sequences.NameErrororTypeErrordisables annotation-based field conversion for that class, so even marked fields can retain plain dictionaries. Existing explicit nested_target_behavior is unchanged.This is a configuration-construction convenience, not a training or quantization algorithm change. Explicit nested
_target_configurations remain supported; this opt-in lets annotations supply the nested dataclass types instead of repeating class paths in YAML.Before your PR is "Ready for review"
Additional Information
This PR is now independent of #3902 and rebased onto upstream
mainat44cf34834. Its diff contains onlynemo_automodel/components/config/loader.pyandtests/unit_tests/config/test_loader.py; no expert LoRA or QAT implementation changes are included. The two config commits are718ab3a00and10f9d6c6d. Rebase range-diff confirms both patches are unchanged from their previously published versions.The implementation deliberately does not enable type coercion globally: differential checks against the original loader confirm unchanged list/dict construction for ordinary dataclasses.
Validation rerun on the independent head
10f9d6c6de23444bd08f70c48e30e3dc0ccde5b2: 97 passed acrosstests/unit_tests/config/, including the three-level subtree regression and existing unresolved-hint fallback tests. Loader Ruff lint/format andgit diff --checkpass. Upstream CI for this SHA still requires maintainer authorization; local results are not a substitute for upstream CI.