Skip to content

Commit

Permalink
Use Scheduler.run_n_trials rather than Scheduler.run_trials_and_yield…
Browse files Browse the repository at this point in the history
…_results (facebook#2952)

Summary:

This looks obviously cleaner, and `run_trials_and_yield_results` is not intended for use outside of Scheduler.

Differential Revision: D64899043
  • Loading branch information
esantorella authored and facebook-github-bot committed Oct 24, 2024
1 parent 121ca52 commit 93b88b8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ax/benchmark/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,7 @@ def benchmark_replication(
with with_rng_seed(seed=seed):
start = monotonic()
for _ in range(problem.num_trials):
next(
scheduler.run_trials_and_yield_results(
max_trials=1, timeout_hours=remaining_hours
)
)
scheduler.run_n_trials(max_trials=1, timeout_hours=remaining_hours)
if timeout_hours is not None:
elapsed_hours = (monotonic() - start) / 3600
remaining_hours = timeout_hours - elapsed_hours
Expand Down

0 comments on commit 93b88b8

Please sign in to comment.