rayray-tune

Can you use different stopping conditions for schedulers versus general tune trials


In Ray Tune, is there any guidance on whether using different stopping conditions for a scheduler versus a trial is fine to do? Below, I have an async hyperband scheduler stopping based on neg_mean_loss, and tune itself stopping based on mean_f1.

Should I be using the same for both or does it not matter?

 scheduler = schedulers.AsyncHyperBandScheduler(
     time_attr='training_iteration',
     reward_attr='neg_mean_loss', # <------
     max_t=100,
     grace_period=10,
     reduction_factor=3,
     brackets=3
 )

 all_trials = tune.run(
     tune_trainable,
     name="tuner",
     scheduler=scheduler,
     stop={"mean_f1": 0.99}, # <------
     resources_per_trial={"cpu": 2, "gpu": 1},
     config={"lr": tune.grid_search([0.0002, 0.003, 0.007, 0.01])
 )

Solution

  • It doesn't matter; you can specify multiple criteria for termination, and Tune will terminate a trial as soon as the criteria is hit.