[tune] Reduce default number of maximum pending trials to max(16, cluster_cpus) #15628
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
The default number of 1000 pending trials for random search leads to unnecessary logs being produced and scheduling overhead, as well as clogging and growing the gcs_server.out logfile to gigabytes when running long running trials.
1000 trials were chosen to ensure that autoscaling can be aggressively triggered. This PR instead sets a minimum of 16 pending trials to enforce a lower bound of autoscaling behavior. If the number of available cluster CPUs is higher than this number, the number of available CPUs is used instead. If this is a high number, a warning is raised.
To trigger more aggressive autoscaling behavior, users will have to set the
TUNE_MAX_PENDING_TRIALS_PG
environment variable.cc @ericl @max0x7ba
Related issue number
Addresses #15504
Addresses #15595
Addresses https://discuss.ray.io/t/ray-tune-log-grows-extremely-large/1992/3
Checks
scripts/format.sh
to lint the changes in this PR.