ray.tune.search.ConcurrencyLimiter#

class ray.tune.search.ConcurrencyLimiter(searcher: Searcher, max_concurrent: int, batch: bool = False)[source]#

Bases: Searcher

A wrapper algorithm for limiting the number of concurrent trials.

Certain Searchers have their own internal logic for limiting the number of concurrent trials. If such a Searcher is passed to a ConcurrencyLimiter, the max_concurrent of the ConcurrencyLimiter will override the max_concurrent value of the Searcher. The ConcurrencyLimiter will then let the Searcher’s internal logic take over.

Parameters:
  • searcher – Searcher object that the ConcurrencyLimiter will manage.

  • max_concurrent – Maximum concurrent samples from the underlying searcher.

  • batch – Whether to wait for all concurrent samples to finish before updating the underlying searcher.

Example:

from ray.tune.search import ConcurrencyLimiter
search_alg = HyperOptSearch(metric="accuracy")
search_alg = ConcurrencyLimiter(search_alg, max_concurrent=2)
tuner = tune.Tuner(
    trainable,
    tune_config=tune.TuneConfig(
        search_alg=search_alg
    ),
)
tuner.fit()

Methods

add_evaluated_trials

Pass results from trials that have been evaluated separately.

restore_from_dir

Restores the state of a searcher from a given checkpoint_dir.

save_to_dir

Automatically saves the given searcher to the checkpoint_dir.

Attributes

CKPT_FILE_TMPL

FINISHED

metric

The training result objective value attribute.

mode

Specifies if minimizing or maximizing the metric.