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

notebook test; spark warning message; reproducibility bug; sequential tuning stop condition #869

Merged
merged 10 commits into from Jan 8, 2023

Conversation

sonichi
Copy link
Collaborator

@sonichi sonichi commented Dec 30, 2022

Why are these changes needed?

  • Add tests for some notebooks.
  • Removed warning message about Spark which is unnecessary for non-Spark users.
  • Fixed a reproducibility bug of global search.
  • In sequential tuning, stop tuning if the returned result from the evaluation function is None. (in future we can allow users to specify max number of None results before stopping)

Related issue number

#851

Checks

@sonichi
Copy link
Collaborator Author

sonichi commented Dec 31, 2022

@thinkall have you run into this error in your notebook test? https://github.com/microsoft/FLAML/actions/runs/3809341315/jobs/6480639426#step:12:178
This passed locally but failed on github. I suppose your test would fail on github too. But your code catches all the exceptions, so it might have failed silently.

@thinkall
Copy link
Collaborator

@thinkall have you run into this error in your notebook test? https://github.com/microsoft/FLAML/actions/runs/3809341315/jobs/6480639426#step:12:178 This passed locally but failed on github. I suppose your test would fail on github too. But your code catches all the exceptions, so it might have failed silently.

Ah, let me check.

@thinkall
Copy link
Collaborator

Need to install ipykernel in test env to enable default kernel python3.

Please add one line in setup.py.

            "nbformat",
            "ipykernel",

@sonichi
Copy link
Collaborator Author

sonichi commented Dec 31, 2022

"ipykernel",

Thanks. Shall I also remove the catch for all exceptions in spark/test_notebook.py?

@sonichi
Copy link
Collaborator Author

sonichi commented Jan 2, 2023

@thinkall the spark notebook fails after I removed the except clause for all exceptions. https://github.com/microsoft/FLAML/actions/runs/3819302422/jobs/6496741544#step:12:178

@thinkall
Copy link
Collaborator

thinkall commented Jan 3, 2023

@thinkall the spark notebook fails after I removed the except clause for all exceptions. https://github.com/microsoft/FLAML/actions/runs/3819302422/jobs/6496741544#step:12:178

>           raise CellExecutionError.from_cell_and_msg(cell, exec_reply_content)
E           nbclient.exceptions.CellExecutionError: An error occurred while executing the following cell:
E           ------------------
E           ''' retrieve best config'''
E           print('Best hyperparmeter config:', automl.best_config)
E           print('Best r2 on validation data: {0:.4g}'.format(1-automl.best_loss))
E           print('Training duration of best run: {0:.4g} s'.format(automl.best_config_train_time))
E           ------------------
E           
E           ---------------------------------------------------------------------------
E           KeyError                                  Traceback (most recent call last)
E           Cell In[6], line 4
E                 2 print('Best hyperparmeter config:', automl.best_config)
E                 3 print('Best r2 on validation data: {0:.4g}'.format(1-automl.best_loss))
E           ----> 4 print('Training duration of best run: {0:.4g} s'.format(automl.best_config_train_time))
E           
E           File ~/work/FLAML/FLAML/flaml/automl/automl.py:896, in AutoML.best_config_train_time(self)
E               892 @property
E               893 def best_config_train_time(self):
E               894     """A float of the seconds taken by training the best config."""
E               895     return getattr(
E           --> 896         self._search_states[self._best_estimator], "best_config_train_time", None
E               897     )
E           
E           KeyError: None
E           KeyError: None

It seems that no model returned from the trial. I re-ran the job, it passed. And the same test in other envs all passed. So maybe we can ignore this error or pass a starting point to make sure it can return a model?

@sonichi sonichi requested a review from thinkall January 7, 2023 15:41
@sonichi sonichi changed the title notebook test notebook test; spark warning message; reproducibility bug; sequential tuning stop condition Jan 7, 2023
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.

None yet

3 participants