Skip to content
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

fix: grid hp samping ignored empty nests #9966

Merged
merged 1 commit into from
Sep 23, 2024
Merged

Conversation

rb-determined-ai
Copy link
Contributor

Previously, when a hyperparameter contained an emtpy "nested" hyperparameter:

hyperparameters:
    empty: {}

It was lost during grid sampling, and was never passed to the trial. This is because the nested hyperparameter isn't considered its own axis for the grid search, and is only implicitly populated by being on the path of some inner hyperparameter axis. However, when there is no inner hyperparameter axis, we need to detect that and emit a one-point axis that preserves the empty nested hyperparameter.

Another possible solution would be to convert the empty nested hyperparameter as a const hyperparameter with an empty map for a value when unmarshaling the hyperparameters yaml object. I think no user code would be affected by which solution is used, since user code will see the same hyperparameter sample either way.

Test Plan

  • includes regression test

@rb-determined-ai rb-determined-ai requested a review from a team as a code owner September 23, 2024 12:25
@cla-bot cla-bot bot added the cla-signed label Sep 23, 2024
Copy link

netlify bot commented Sep 23, 2024

Deploy Preview for determined-ui canceled.

Name Link
🔨 Latest commit 1b99512
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/66f15f2c1f920600089173a5

Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.50%. Comparing base (baf451f) to head (1b99512).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9966   +/-   ##
=======================================
  Coverage   54.50%   54.50%           
=======================================
  Files        1255     1255           
  Lines      156733   156736    +3     
  Branches     3600     3600           
=======================================
+ Hits        85420    85423    +3     
  Misses      71180    71180           
  Partials      133      133           
Flag Coverage Δ
backend 45.16% <100.00%> (+<0.01%) ⬆️
harness 72.74% <ø> (ø)
web 54.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
master/pkg/searcher/grid.go 94.90% <100.00%> (+0.09%) ⬆️

... and 7 files with indirect coverage changes

Previously, when a hyperparameter contained an emtpy "nested"
hyperparameter:

    hyperparameters:
        empty: {}

It was lost during grid sampling, and was never passed to the trial.
This is because the nested hyperparameter isn't considered its own axis
for the grid search, and is only implicitly populated by being on the
path of some inner hyperparameter axis.  However, when there is no inner
hyperparameter axis, we need to detect that and emit a one-point axis
that preserves the empty nested hyperparameter.

Another possible solution would be to convert the empty nested
hyperparameter as a const hyperparameter with an empty map for a value
when unmarshaling the hyperparameters yaml object.  I think no user code
would be affected by which solution is used, since user code will see
the same hyperparameter sample either way.
@determined-ci determined-ci requested a review from a team September 23, 2024 12:29
@determined-ci determined-ci added the documentation Improvements or additions to documentation label Sep 23, 2024
@@ -74,6 +74,20 @@ func TestHyperparameterGridMethod(t *testing.T) {
len(getGridAxes([]string{"x"}, expconf.Hyperparameter{RawConstHyperparameter: &constParam})[0]),
1,
)
// Regression test: make sure empty nested hyperparameters don't disappear during sampling.
Copy link
Contributor

Choose a reason for hiding this comment

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

🤘

@rb-determined-ai rb-determined-ai merged commit 66f7a70 into main Sep 23, 2024
86 of 98 checks passed
@rb-determined-ai rb-determined-ai deleted the rb/fix-grid branch September 23, 2024 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants