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

[Tune] Remove trial table when running Ray Train in a Jupyter notebook #44858

Merged
merged 7 commits into from
Apr 22, 2024

Conversation

hongpeng-guo
Copy link
Contributor

Why are these changes needed?

This PR removes the trial table mistakenly displayed during Ray Train in a Jupyter notebook, which should only appear in Ray Tune sessions.

image

Related issue number

Closes #44776

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@hongpeng-guo hongpeng-guo changed the title [Tune] Remove trial table when running Ray Train in a Jupyter notebook (#44776) [Tune] Remove trial table when running Ray Train in a Jupyter notebook Apr 19, 2024
Copy link
Contributor

@justinvyu justinvyu left a comment

Choose a reason for hiding this comment

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

Just one small comment:

@@ -1520,7 +1520,8 @@ def _detect_reporter(**kwargs) -> TuneReporterBase:

Keyword arguments are passed on to the reporter class.
"""
if IS_NOTEBOOK:
_trainer_api = kwargs.pop("_trainer_api", False)
Copy link
Contributor

Choose a reason for hiding this comment

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

We can add _trainer_api as a keyword argument separate from kwargs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just added a keyword arg _trainer_api for the function _detect_reporter().

Comment on lines +804 to +806
trainer_reporter = _detect_reporter(_trainer_api=True)
self.assertFalse(isinstance(trainer_reporter, JupyterNotebookReporter))
self.assertTrue(isinstance(trainer_reporter, CLIReporter))
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice test!

Copy link
Contributor

@justinvyu justinvyu left a comment

Choose a reason for hiding this comment

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

Thanks!

@justinvyu justinvyu merged commit fbbc38f into ray-project:master Apr 22, 2024
5 checks passed
@hongpeng-guo hongpeng-guo deleted the dev branch April 23, 2024 03:57
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.

[train] Remove trial table when running Ray Train in a Jupyter notebook
4 participants