Skip to content

Commit d1c0be6

Browse files
authored
Merge pull request #3019 from luarss/topic/bump-ray
[Autotuner] Bump versions 2
2 parents f91d3af + 7389877 commit d1c0be6

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

tools/AutoTuner/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ray[default,tune]==2.9.3
1+
ray[default,tune]==2.43.0
22
ax-platform>=0.3.3,<=0.3.7
33
hyperopt==0.2.7
44
optuna==3.6.0

tools/AutoTuner/src/autotuner/distributed.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,9 @@ def setup(self, config):
120120
Setup current experiment step.
121121
"""
122122
# We create the following directory structure:
123-
# 1/ 2/ 3/ 4/ 5/ 6/
124-
# <repo>/<logs>/<platform>/<design>/<experiment>/<id>/<cwd>
125-
# Run by Ray in directory specified by `local_dir`
126-
repo_dir = os.getcwd() + "/../" * 6
127-
self.repo_dir = os.path.abspath(repo_dir)
123+
# 1/ 2/ 3/ 4/ 5/
124+
# <repo>/<logs>/<platform>/<design>/<experiment/<cwd>
125+
self.repo_dir = os.path.abspath(LOCAL_DIR + "/../" * 4)
128126
self.parameters = parse_config(
129127
config=config,
130128
base_dir=self.repo_dir,
@@ -666,7 +664,7 @@ def main():
666664
mode="min",
667665
num_samples=args.samples,
668666
fail_fast=False,
669-
local_dir=LOCAL_DIR,
667+
storage_path=LOCAL_DIR,
670668
resume=args.resume,
671669
stop={"training_iteration": args.iterations},
672670
resources_per_trial={"cpu": os.cpu_count() / args.jobs},

tools/AutoTuner/src/autotuner/utils.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -292,21 +292,23 @@ def openroad(
292292
base_dir,
293293
parameters,
294294
flow_variant,
295-
path="",
296295
install_path=None,
297296
):
298297
"""
299298
Run OpenROAD-flow-scripts with a given set of parameters.
300299
"""
301300
# Make sure path ends in a slash, i.e., is a folder
302301
flow_variant = f"{args.experiment}/{flow_variant}"
303-
if path != "":
304-
log_path = f"{path}/{flow_variant}/"
305-
report_path = log_path.replace("logs", "reports")
306-
run_command(args, f"mkdir -p {log_path}")
307-
run_command(args, f"mkdir -p {report_path}")
308-
else:
309-
log_path = report_path = os.getcwd() + "/"
302+
log_path = os.path.abspath(
303+
os.path.join(base_dir, f"flow/logs/{args.platform}/{args.design}", flow_variant)
304+
)
305+
report_path = os.path.abspath(
306+
os.path.join(
307+
base_dir, f"flow/reports/{args.platform}/{args.design}", flow_variant
308+
)
309+
)
310+
os.makedirs(log_path, exist_ok=True)
311+
os.makedirs(report_path, exist_ok=True)
310312

311313
if install_path is None:
312314
install_path = os.path.join(base_dir, "tools/install")
@@ -326,8 +328,8 @@ def openroad(
326328
args,
327329
make_command,
328330
timeout=args.timeout,
329-
stderr_file=f"{log_path}error-make-finish.log",
330-
stdout_file=f"{log_path}make-finish-stdout.log",
331+
stderr_file=os.path.join(log_path, "error-make-finish.log"),
332+
stdout_file=os.path.join(log_path, "make-finish-stdout.log"),
331333
)
332334

333335
metrics_file = os.path.abspath(os.path.join(report_path, "metrics.json"))
@@ -340,8 +342,8 @@ def openroad(
340342
run_command(
341343
args,
342344
metrics_command,
343-
stderr_file=f"{log_path}error-metrics.log",
344-
stdout_file=f"{log_path}metrics-stdout.log",
345+
stderr_file=os.path.join(log_path, "error-metrics.log"),
346+
stdout_file=os.path.join(log_path, "metrics-stdout.log"),
345347
)
346348

347349
return metrics_file
@@ -662,7 +664,6 @@ def openroad_distributed(
662664
args,
663665
repo_dir,
664666
config,
665-
path,
666667
sdc_original,
667668
fr_original,
668669
install_path,
@@ -686,7 +687,6 @@ def openroad_distributed(
686687
base_dir=repo_dir,
687688
parameters=config,
688689
flow_variant=f"{uuid()}-{variant}",
689-
path=path,
690690
install_path=install_path,
691691
)
692692
duration = time() - t

tools/AutoTuner/src/autotuner/utils/plot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ def load_dir(dir: str) -> pd.DataFrame:
7676
params = []
7777
failed = []
7878
for params_fname in glob.glob(f"{dir}/*/params.json"):
79-
metrics_fname = params_fname.replace("params.json", "metrics.json")
79+
metrics_fname = params_fname.replace("params.json", "metrics.json").replace(
80+
"ray", "or-0"
81+
)
8082
try:
8183
with open(params_fname, "r") as f:
8284
_dict = json.load(f)

0 commit comments

Comments
 (0)