Skip to content

Rewrite instantiate to isolate overrides and resolve lazily#3302

Merged
omry merged 1 commit into
mainfrom
pr3302
Jul 21, 2026
Merged

Rewrite instantiate to isolate overrides and resolve lazily#3302
omry merged 1 commit into
mainfrom
pr3302

Conversation

@omry

@omry omry commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Keep call-site arguments separate from the input configuration instead of merging them into a full configuration copy.

Resolve configuration values as instantiation traverses them, preserving parent context until values are copied, resolved, and detached for target calls. This avoids copying and resolving unrelated configuration, supports runtime objects that OmegaConf cannot store, and permits state established by earlier targets to affect later arguments.

Preserve structured runtime conversion behavior, callable targets, recursive overrides, tuple and list conversion, partial instantiation, and serialization safety. Remove the Optuna-only deepcopy bypass.

Document the interpolation and Structured Config compatibility changes.

Closes #3216

Keep call-site arguments separate from the input configuration instead of merging them into a full configuration copy.

Resolve configuration values as instantiation traverses them, preserving parent context until values are copied, resolved, and detached for target calls. This avoids copying and resolving unrelated configuration, supports runtime objects that OmegaConf cannot store, and permits state established by earlier targets to affect later arguments.

Preserve structured runtime conversion behavior, callable targets, recursive overrides, tuple and list conversion, partial instantiation, and serialization safety. Remove the Optuna-only deepcopy bypass.

Document the interpolation and Structured Config compatibility changes.

Closes #3216
Copilot AI review requested due to automatic review settings July 21, 2026 06:24
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 21, 2026

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@omry
omry requested a review from Copilot July 21, 2026 06:51

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@omry
omry merged commit 1717824 into main Jul 21, 2026
28 of 29 checks passed
@omry
omry deleted the pr3302 branch July 21, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evaluate opt-out from eager resolution in instantiate

2 participants