-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for TunableGroups merging logic #327
Merged
bpkroth
merged 26 commits into
microsoft:main
from
bpkroth:tunable-groups-instance-references
May 3, 2023
Merged
Fixes for TunableGroups merging logic #327
bpkroth
merged 26 commits into
microsoft:main
from
bpkroth:tunable-groups-instance-references
May 3, 2023
Conversation
This file contains 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
…cessing for tunables
…es of tunables - also includes work from microsoft#326 for convenience
bpkroth
commented
May 2, 2023
bpkroth
commented
May 2, 2023
bpkroth
commented
May 2, 2023
bpkroth
commented
May 2, 2023
bpkroth
commented
May 2, 2023
bpkroth
commented
May 2, 2023
bpkroth
commented
May 2, 2023
motus
reviewed
May 2, 2023
More work being split out from microsoft#313 - Handle `null` (in json, `None` in python) values for categoricals. - Disallow duplicate values in categoricals. - Provide type aware setters (compromise to a much much larger type aware rework for `Tunables` that isn't super beneficial). - Slight method renaming for clarity. - For convenience, allow accessing the `TunableGroups` by `Tunable`, not just it's name. - Add `__contains__` method to `TunableGroups` so we can do `if tunable in tunable_group` checks - Add a few more tests for `Tunable`, `TunableGroups`, and `CovariantTunableGroup` definitions. Coverage should be about 90% overall now, and 99+% on those files.
motus
approved these changes
May 3, 2023
4 tasks
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.
Splitting more work off of #313.
In that PR we'd like to be able to make each Environment independently loadable.
To do this we need to be able to allow them to reference their Tunables.
However, other related Environments (e.g. local vs. remote), may also need to reference those same Tunables.
Moreover, we want both to obtain the same value.
To do this we would like the parent TunableGroups for the CompositeEnvironment for an Experiment to handout references rather than copies of Tunables to the child Environments.
This work adds that logic and some basic tests for it.
In essence, we make passing TunableGroups to an Environment expected, even if the first copy may be an empty collection. We consider this one the "root" or "parent" copy.
After that, any additional Tunables loaded by subsequent Environments get
merge
d (notupdate
d, so no overwriting) into the "parent" and the child gets a "view" of asubgroup
of those.In this way, when the Optimizer assigns new values to a Tunable, it is reflected at all levels.
Caveats:
merge
logic throws an error if any overlapping CovariantTunableGroups are non-equal in any way (e.g. extra param in one vs. another).Leaving these for future work: