Skip to content

Commit

Permalink
chore(benchmark): don't wait if the cp is canceled (#221)
Browse files Browse the repository at this point in the history
Signed-off-by: ThibaultFy <[email protected]>
  • Loading branch information
ThibaultFy authored Jun 24, 2024
1 parent 8d9ea87 commit 15fa313
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions benchmark/camelyon/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,18 @@ def accuracy(data_from_opener, predictions):
experiment_folder=Path(__file__).resolve().parent / "benchmark_cl_experiment_folder",
name=cp_name,
)

if cancel_cp and clients[0].backend_mode == substra.BackendType.REMOTE:
clients[0].cancel_compute_plan(key=compute_plan.key)
print(f"Compute plan {compute_plan.key} successfully canceled.")

return

clients[0].wait_compute_plan(key=compute_plan.key, raise_on_failure=True)
else:
clients[0].wait_compute_plan(key=compute_plan.key, raise_on_failure=True)

performances = clients[1].get_performances(key=compute_plan.key)
performances = clients[1].get_performances(key=compute_plan.key)

return benchmark_metrics.get_metrics_from_substra_performances(raw_performances=performances)
return benchmark_metrics.get_metrics_from_substra_performances(raw_performances=performances)


def torch_fed_avg(
Expand Down

0 comments on commit 15fa313

Please sign in to comment.