Skip to content

Commit

Permalink
Fix ETA
Browse files Browse the repository at this point in the history
  • Loading branch information
MsRandom committed Nov 28, 2024
1 parent e45a1e7 commit 7c7c2ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions base/testing/benchmarker.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,8 @@ def benchmark_submissions(self, contest: Contest, submissions: dict[Key, Reposit

average_benchmarking_time = self.get_average_benchmarking_time()
if average_benchmarking_time:
submissions_left = len(submissions) - len(self.benchmarks)
eta = submissions_left * average_benchmarking_time
logger.info(f"{submissions_left}/{len(submissions)} benchmarked. Average benchmark time: {average_benchmarking_time:.2f}s, ETA: {timedelta(seconds=eta)}")
eta = (len(submissions) - len(self.benchmarks)) * average_benchmarking_time
logger.info(f"{len(self.benchmarks)}/{len(submissions)} benchmarked. Average benchmark time: {average_benchmarking_time:.2f}s, ETA: {timedelta(seconds=eta)}")

if self._is_done(submissions):
logger.info("Benchmarking complete")
Expand Down
5 changes: 2 additions & 3 deletions validator/weight_setting/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,8 @@ def update_benchmarks(self, benchmarking_results: list[BenchmarkingResults]):
self.contest_state.invalid_submissions.update(result.invalid_submissions)

if average_benchmarking_time and average_benchmarking_time != self.contest_state.average_benchmarking_time:
submissions_left = len(self.contest_state.submissions) - len(self.contest_state.benchmarks)
eta = submissions_left * average_benchmarking_time
logger.info(f"{submissions_left}/{len(self.contest_state.submissions)} benchmarked. Average benchmark time: {average_benchmarking_time:.2f}s, ETA: {timedelta(seconds=eta)}")
eta = (len(self.contest_state.submissions) - len(self.contest_state.benchmarks)) * average_benchmarking_time
logger.info(f"{len(self.contest_state.benchmarks)}/{len(self.contest_state.submissions)} benchmarked. Average benchmark time: {average_benchmarking_time:.2f}s, ETA: {timedelta(seconds=eta)}")

self.contest_state.average_benchmarking_time = average_benchmarking_time

Expand Down

0 comments on commit 7c7c2ad

Please sign in to comment.