Skip to content

Commit 518fec8

Browse files
committed
fix docs and cli entrypoint
Signed-off-by: Jack Luar <[email protected]>
1 parent bfdddbc commit 518fec8

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

docs/user/CLIGuideAutotuner.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ openroad_autotuner --design gcd --platform sky130hd --experiment abcdef \
2222
--resources_per_trial 1.0 --seed 42
2323
```
2424

25-
With our new approach all you have to do is specify a YAML document `test.yaml`
25+
With our new approach all you have to do is specify a YAML document `cli.yaml`
2626

2727
```yaml
2828
---
@@ -52,7 +52,8 @@ tune:
5252
and run:
5353
5454
```bash
55-
openroad_autotuner --yaml test.yaml tune
55+
# Make sure you run this in `./tools/AutoTuner` directory.
56+
openroad_autotuner --yaml cli.yaml tune
5657
```
5758

5859
## How to generate new config files

tools/AutoTuner/src/autotuner/cli.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from typing import Union
12
from jsonargparse.typing import (
23
PositiveInt,
34
NonNegativeInt,
@@ -37,9 +38,14 @@ def _process_common_args(args: Namespace) -> None:
3738
else:
3839
args.experiment += f"-{args.mode}"
3940

41+
# If timeout is set, convert it to seconds.
4042
if args.timeout is not None:
4143
args.timeout = round(args.timeout * 3600)
4244

45+
# Temp: Ray ConcurrencyLimiter expects `int` type for args.jobs
46+
if args.jobs is not None:
47+
args.jobs = int(args.jobs)
48+
4349
def _validate_tune_args(args: Namespace) -> None:
4450
"""Validate and process arguments specific to tuning."""
4551
if args.tune.eval == "ppa-improv" and args.tune.reference is None:
@@ -73,7 +79,7 @@ def _validate_sweep_args(args: Namespace) -> None:
7379
return args
7480

7581

76-
def main():
82+
def parse_arguments():
7783
parser = ArgumentParser()
7884
tune_parser = ArgumentParser()
7985
sweep_parser = ArgumentParser()
@@ -245,4 +251,4 @@ def main():
245251

246252

247253
if __name__ == "__main__":
248-
print(main())
254+
print(parse_arguments())

0 commit comments

Comments
 (0)