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

[air/output] Use Tune reporter if Tuner/tune.run was used #36154

Merged
merged 4 commits into from
Jun 12, 2023

Conversation

krfricke
Copy link
Contributor

@krfricke krfricke commented Jun 7, 2023

Why are these changes needed?

Currently we use the number of samples to detect if we should use the Train output reporter or the tune output reporter.

However, this is confusing when developing on a small scale, e.g. a tuning run with only 1 trial, before going to multiple trials. Instead, we should use the entrypoint to decide which reporter we use. The Trainer will use the Train reporter, and Tuner, tune.run, and tune.run_experiments will use the tune reporter.

Related issue number

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 :(

@scottsun94
Copy link
Contributor

This change makes sense!

One question:
how about Rllib? As long as it doesn't use tuner, tune.run, and tune.run_experiments, it should just use trainer?

@justinvyu
Copy link
Contributor

This change makes sense!

One question: how about Rllib? As long as it doesn't use tuner, tune.run, and tune.run_experiments, it should just use trainer?

@scottsun94 RLlib can only run through the Tune entrypoints. Trainer is from Ray Train.
Training an RLlib Algorithm outside of Tune doesn't come with reporting capabilities.

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.

Makes sense! Are the failing tests unrelated?

python/ray/tune/experimental/output.py Outdated Show resolved Hide resolved
@krfricke
Copy link
Contributor Author

krfricke commented Jun 8, 2023

Makes sense! Are the failing tests unrelated?

Yes, they're due to a breakage that was fixed in #36157. I'll merge master to reflect this in the CI.

@scottsun94
Copy link
Contributor

scottsun94 commented Jun 8, 2023

This change makes sense!

One question: how about Rllib? As long as it doesn't use tuner, tune.run, and tune.run_experiments, it should just use trainer?

@scottsun94 RLlib can only run through the Tune entrypoints. Trainer is from Ray Train.

Training an RLlib Algorithm outside of Tune doesn't come with reporting capabilities.

This makes sense. But what's the story of output for rllib (training an RLlib Algorithm outside of Tune)? Rllib needs to build its own output reporter?

@krfricke
Copy link
Contributor Author

krfricke commented Jun 9, 2023

This change makes sense!

One question: how about Rllib? As long as it doesn't use tuner, tune.run, and tune.run_experiments, it should just use trainer?

@scottsun94 RLlib can only run through the Tune entrypoints. Trainer is from Ray Train.
Training an RLlib Algorithm outside of Tune doesn't come with reporting capabilities.

This makes sense. But what's the story of output for rllib (training an RLlib Algorithm outside of Tune)? Rllib needs to build its own output reporter?

Yes, if rllib is not using tune/air for execution, they have to implement their own reporting logic. They can potentially still use the same output reporter, but they have to call the hooks themselves.

The logic from this PR would then still use the train (single run) reporter, so it should be unaffected by the changes in this PR.

@scottsun94
Copy link
Contributor

This change makes sense!

One question: how about Rllib? As long as it doesn't use tuner, tune.run, and tune.run_experiments, it should just use trainer?

@scottsun94 RLlib can only run through the Tune entrypoints. Trainer is from Ray Train.
Training an RLlib Algorithm outside of Tune doesn't come with reporting capabilities.

This makes sense. But what's the story of output for rllib (training an RLlib Algorithm outside of Tune)? Rllib needs to build its own output reporter?

Yes, if rllib is not using tune/air for execution, they have to implement their own reporting logic. They can potentially still use the same output reporter, but they have to call the hooks themselves.

The logic from this PR would then still use the train (single run) reporter, so it should be unaffected by the changes in this PR.

It makes sense. Thanks!

@krfricke krfricke merged commit c9965d3 into ray-project:master Jun 12, 2023
@krfricke krfricke deleted the air/tune-reporter-entrypoint branch June 12, 2023 09:04
krfricke added a commit to krfricke/ray that referenced this pull request Jun 20, 2023
…t#36154)

Currently we use the number of samples to detect if we should use the Train output reporter or the tune output reporter.

However, this is confusing when developing on a small scale, e.g. a tuning run with only 1 trial, before going to multiple trials. Instead, we should use the entrypoint to decide which reporter we use. The Trainer will use the Train reporter, and Tuner, tune.run, and tune.run_experiments will use the tune reporter.

Signed-off-by: Kai Fricke <[email protected]>
arvind-chandra pushed a commit to lmco/ray that referenced this pull request Aug 31, 2023
…t#36154)

Currently we use the number of samples to detect if we should use the Train output reporter or the tune output reporter.

However, this is confusing when developing on a small scale, e.g. a tuning run with only 1 trial, before going to multiple trials. Instead, we should use the entrypoint to decide which reporter we use. The Trainer will use the Train reporter, and Tuner, tune.run, and tune.run_experiments will use the tune reporter.

Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: e428265 <[email protected]>
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.

3 participants