Skip to content

Commit 5f5825d

Browse files
committed
make cloudpath save_best optional
Signed-off-by: Jack Luar <[email protected]>
1 parent c6d4e8a commit 5f5825d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tools/AutoTuner/src/autotuner/distributed.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -616,11 +616,12 @@ def save_best(results):
616616
print(f"[INFO TUN-0003] Local: Best parameters written to {new_best_path}")
617617

618618
# Save to cloud storage
619-
new_best_path = f"{args.cloud_dir}/{args.experiment}/"
620-
new_best_path += f"autotuner-best-{trial_id}.json"
621-
with CloudPath(new_best_path).open("w") as new_best_file:
622-
json.dump(best_config, new_best_file, indent=4)
623-
print(f"[INFO TUN-0011] Cloud: Best parameters written to {new_best_path}")
619+
if args.cloud_dir:
620+
new_best_path = f"{args.cloud_dir}/{args.experiment}/"
621+
new_best_path += f"autotuner-best-{trial_id}.json"
622+
with CloudPath(new_best_path).open("w") as new_best_file:
623+
json.dump(best_config, new_best_file, indent=4)
624+
print(f"[INFO TUN-0011] Cloud: Best parameters written to {new_best_path}")
624625

625626

626627
def sweep():

0 commit comments

Comments
 (0)