|
47 | 47 | from ray.tune.search.basic_variant import BasicVariantGenerator |
48 | 48 | from ray.tune.search.hyperopt import HyperOptSearch |
49 | 49 | from ray.tune.search.optuna import OptunaSearch |
50 | | -from ray.tune.utils.file_transfer import sync_dir_between_nodes |
51 | 50 | from ray.util.queue import Queue |
52 | 51 |
|
53 | 52 | from ax.service.ax_client import AxClient |
|
73 | 72 | ) |
74 | 73 | # URL to ORFS GitHub repository |
75 | 74 | ORFS_URL = "https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts" |
76 | | -MAX_SIZE_BYTES = 5_368_709_120 # 5 GiB, or 5*1024*1024*1024 B |
77 | 75 |
|
78 | 76 |
|
79 | 77 | class AutoTunerBase(tune.Trainable): |
@@ -624,31 +622,6 @@ def sweep(): |
624 | 622 | print("[INFO TUN-0010] Sweep complete.") |
625 | 623 |
|
626 | 624 |
|
627 | | -def transfer_to_head(file_path): |
628 | | - """ |
629 | | - Transfer files from worker to the head node. |
630 | | - """ |
631 | | - workers = ray.nodes() |
632 | | - # TODO: Can this for loop be done async? |
633 | | - for worker_id, worker in enumerate(workers): |
634 | | - # Path: <repo>/<experiment>/<worker_id> |
635 | | - target_path = f"{LOCAL_DIR}/{args.experiment}/{worker_id}" |
636 | | - os.makedirs(target_path, exist_ok=True) |
637 | | - worker_ip = worker["NodeManagerAddress"] |
638 | | - try: |
639 | | - sync_dir_between_nodes( |
640 | | - source_ip=worker_ip, |
641 | | - source_path=file_path, |
642 | | - target_ip=args.server, |
643 | | - target_path=target_path, |
644 | | - max_size_bytes=MAX_SIZE_BYTES, |
645 | | - ) |
646 | | - except Exception as e: |
647 | | - # TODO: maybe a retry mechanism if fails? |
648 | | - print(f"[INFO TUN-0012] Error syncing worker {worker_id}: {e}") |
649 | | - continue |
650 | | - |
651 | | - |
652 | 625 | def main(): |
653 | 626 | global args, SDC_ORIGINAL, FR_ORIGINAL, LOCAL_DIR, INSTALL_PATH, ORFS_FLOW_DIR, config_dict, reference, best_params |
654 | 627 | args = parse_arguments() |
@@ -704,11 +677,6 @@ def main(): |
704 | 677 |
|
705 | 678 | task_id = save_best.remote(analysis) |
706 | 679 | _ = ray.get(task_id) |
707 | | - |
708 | | - # if not args.server: |
709 | | - # print("[INFO TUN-0011] No Ray server specified. Skipping transfer.") |
710 | | - # sys.exit(0) |
711 | | - # transfer_to_head(LOCAL_DIR) |
712 | 680 | print(f"[INFO TUN-0002] Best parameters found: {analysis.best_config}") |
713 | 681 |
|
714 | 682 | # if all runs have failed |
|
0 commit comments