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] simpler get_next_trial #23396

Merged
merged 3 commits into from
Mar 22, 2022

Conversation

suquark
Copy link
Member

@suquark suquark commented Mar 22, 2022

Why are these changes needed?

A much simpler _update_trial_queue_and_get_next_trial with the same functionality. The original code complicated the problem and is very hard to understand.

Related issue number

Checks

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

@suquark suquark changed the title [tune] simpler next_trial [tune] simpler get_next_trial Mar 22, 2022
Copy link
Contributor

@xwjiang2010 xwjiang2010 left a comment

Choose a reason for hiding this comment

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

Thanks. The new code looks much cleaner. The rllib test failure doesn't seem related.

break
wait_for_trial = no_trials_unfinished and not self._search_alg.is_finished()
# Only fetch a new trial if we have no pending trial
if wait_for_trial or no_trials_pending:
Copy link
Contributor

Choose a reason for hiding this comment

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

if all trials are finished and search algo is finished, in the old logic, we would enter this branch. But I think it's unnecessary, as _update_trial_queue will just return False with no trial added to the queue and thus no trial selected by the scheduler_alg.

@suquark suquark merged commit aea93e4 into ray-project:master Mar 22, 2022
@suquark suquark deleted the simple_tune_next_trial branch March 22, 2022 19:28
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.

2 participants