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

Populate hyperopt defaults using schema #2968

Merged
merged 9 commits into from
Jan 21, 2023
Merged

Conversation

arnavgarg1
Copy link
Contributor

@arnavgarg1 arnavgarg1 commented Jan 19, 2023

This PR adds a new step to ensure that all of the defaults for search algorithm, split, executor etc. are correctly populated using the schema object before accessing them to prevent key errors. All of these parameters are required by hyperopt and expected to be present downstream for config validation, executor creation, and trial execution.

The reason we've not noticed this before in our tests is because all of our tests specify search_alg in the hyperopt config.

Co-authored-by: Kabir Brar kabir@predibase.com
Co-authored-by: Travis Addair tgaddair@gmail.com

@arnavgarg1 arnavgarg1 marked this pull request as ready for review January 19, 2023 23:47
ludwig/hyperopt/run.py Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Jan 20, 2023

Unit Test Results

         6 files  ±0           6 suites  ±0   5h 3m 8s ⏱️ + 13m 53s
  3 903 tests +3    3 829 ✔️ +1    74 💤 +2  0 ±0 
11 706 runs  +9  11 484 ✔️ +3  222 💤 +6  0 ±0 

Results for commit 899edd5. ± Comparison against base commit cb498c8.

♻️ This comment has been updated with latest results.

@@ -207,7 +208,9 @@ def run_hyperopt_executor(
def test_hyperopt_executor(scenario, csv_filename, tmpdir, ray_cluster_4cpu):
search_alg = scenario["search_alg"]
executor = scenario["executor"]
run_hyperopt_executor(search_alg, executor, csv_filename, tmpdir)
# When using the hb_bohb scheduler, num_epochs must equal max_t (which is 81 by default)
Copy link
Contributor

Choose a reason for hiding this comment

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

How did you come to discover this? Is this worth adding as an auxiliary validation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't know about this either, but found out that we've added this logic here in our ModelConfig object creation logic: https://github.com/ludwig-ai/ludwig/blob/master/ludwig/schema/model_config.py#L532

ludwig/schema/model_config.py Outdated Show resolved Hide resolved
ludwig/hyperopt/run.py Outdated Show resolved Hide resolved
@arnavgarg1 arnavgarg1 merged commit a319623 into master Jan 21, 2023
@arnavgarg1 arnavgarg1 deleted the fix_hyperopt_schema branch January 21, 2023 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants