Skip to content

Commit ec45357

Browse files
luarssvvbandeira
andauthored
[Autotuner] CI Smoke Test - Tune & Sweep (#2042)
* Add CI integration for AT Smoke tests * ci: bump version --------- Signed-off-by: Jack Luar <[email protected]> Signed-off-by: luarss <[email protected]> Signed-off-by: Vitor Bandeira <[email protected]> Signed-off-by: luarss <[email protected]> Signed-off-by: Vitor Bandeira <[email protected]> Co-authored-by: Vitor Bandeira <[email protected]> Co-authored-by: Vitor Bandeira <[email protected]>
1 parent 629c464 commit ec45357

File tree

18 files changed

+487
-270
lines changed

18 files changed

+487
-270
lines changed

docker/Dockerfile.builder

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ COPY --link flow/platforms flow/platforms
3333
COPY --link flow/util flow/util
3434
COPY --link flow/scripts flow/scripts
3535
COPY --link flow/designs flow/designs
36+
COPY --link tools/AutoTuner tools/AutoTuner
3637

3738
COPY --link --from=orfs-builder-base /OpenROAD-flow-scripts/tools/install tools/install
3839
COPY --link \

docs/user/InstructionsForAutoTuner.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,16 @@ User-defined coefficient values (`coeff_perform`, `coeff_power`, `coeff_area`) o
2323

2424
## Setting up AutoTuner
2525

26-
To setup AutoTuner, make sure you have a virtual environment set up with
27-
Python 3.9.X. There are plenty of ways to do this, we recommend using
28-
[Miniconda](https://docs.conda.io/en/latest/miniconda.html),
29-
which is a free minimal installer for the package manager `conda`.
26+
We have provided two convenience scripts, `./install.sh` and `./setup.sh`
27+
that works in Python3.8 for installation and configuration of AutoTuner,
28+
as shown below:
3029

3130
```shell
32-
# set up conda environment
33-
conda create -n autotuner_env python=3.9
34-
conda activate autotuner_env
31+
# Install prerequisites
32+
./tools/AutoTuner/install.sh
3533

36-
# install requirements
37-
pip install -r ./tools/AutoTuner/requirements.txt
34+
# Start virtual environment
35+
./tools/AutoTuner/setup.sh
3836
```
3937

4038
## Input JSON structure
@@ -198,6 +196,15 @@ We show three different views possible at the end, namely: `Table View`, `Scatte
198196
![Parallel Coordinate View](../images/Autotuner_best_parameter_view.webp)
199197
<p style="text-align: center;">Parallel Coordinate View (best run is in green)</p>
200198

199+
## Testing framework
200+
201+
Assuming the virtual environment is setup at `./tools/AutoTuner/autotuner_env`:
202+
203+
```
204+
./tools/AutoTuner/setup.sh
205+
python3 ./tools/AutoTuner/test/smoke_test_sweep.py
206+
python3 ./tools/AutoTuner/test/smoke_test_tune.py
207+
```
201208

202209
## Citation
203210

flow/designs/asap7/gcd/autotuner.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"_SDC_CLK_PERIOD": {
44
"type": "float",
55
"minmax": [
6-
50,
6+
300,
77
1000
88
],
99
"step": 0

flow/designs/ihp-sg13g2/gcd/autotuner.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"_SDC_CLK_PERIOD": {
44
"type": "float",
55
"minmax": [
6-
1.0,
7-
4.3647
6+
7.0,
7+
12.0
88
],
99
"step": 0
1010
},
@@ -52,23 +52,23 @@
5252
"type": "float",
5353
"minmax": [
5454
0.1,
55-
0.7
55+
0.3
5656
],
5757
"step": 0
5858
},
5959
"PLACE_DENSITY_LB_ADDON": {
6060
"type": "float",
6161
"minmax": [
6262
0.0,
63-
0.99
63+
0.1
6464
],
6565
"step": 0
6666
},
6767
"_PINS_DISTANCE": {
6868
"type": "int",
6969
"minmax": [
7070
1,
71-
4
71+
1
7272
],
7373
"step": 1
7474
},

flow/designs/sky130hd/gcd/autotuner.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,4 @@
9999
"step": 0
100100
}
101101
}
102+

flow/test/test_helper.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,39 @@ if [ $ret -eq 0 ] && grep -q 'power:' <(echo $TARGETS); then
7777
ret=$(( ret + $? ))
7878
fi
7979

80+
# Run Autotuner CI specifically for gcd on selected platforms.
81+
RUN_AUTOTUNER=0
82+
case $DESIGN_NAME in
83+
"gcd")
84+
RUN_AUTOTUNER=1
85+
;;
86+
esac
87+
case $PLATFORM in
88+
"asap7" | "sky130hd" | "ihp-sg13g2" )
89+
# Keep RUN_AUTOTUNER enabled only for these platforms
90+
;;
91+
*)
92+
RUN_AUTOTUNER=0
93+
;;
94+
esac
95+
96+
if [ $RUN_AUTOTUNER -eq 1 ]; then
97+
# change directory to the root of the repo
98+
echo "Install and starting venv"
99+
cd ../
100+
./tools/AutoTuner/installer.sh
101+
. ./tools/AutoTuner/setup.sh
102+
103+
# remove dashes
104+
PLATFORM=${PLATFORM//-/}
105+
# convert to uppercase
106+
PLATFORM=${PLATFORM^^}
107+
108+
echo "Running Autotuner smoke tune test"
109+
python3 -m unittest tools.AutoTuner.test.smoke_test_tune.${PLATFORM}TuneSmokeTest.test_tune
110+
111+
echo "Running Autotuner smoke sweep test"
112+
python3 -m unittest tools.AutoTuner.test.smoke_test_sweep.${PLATFORM}SweepSmokeTest.test_sweep
113+
fi
114+
80115
exit $ret

flow/util/genReport.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ def write_summary():
246246

247247
for log_dir, dirs, files in sorted(os.walk(LOGS_FOLDER, topdown=False)):
248248
dir_list = log_dir.split(os.sep)
249-
if len(dir_list) != 4:
249+
# Handles autotuner folders, which do not have `report.log` natively.
250+
# TODO: Can we log something for autotuner?
251+
if len(dir_list) != 4 or "test-" in dir_list[-1]:
250252
continue
251253
report_dir = log_dir.replace(LOGS_FOLDER, REPORTS_FOLDER)
252254

jenkins/public_nightly.Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@Library('[email protected].0') _
1+
@Library('[email protected].1') _
22

33
node {
44

jenkins/public_tests_all.Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@Library('[email protected].0') _
1+
@Library('[email protected].1') _
22

33
node {
44

tools/AutoTuner/.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1-
# Autotuner specific
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.egg-info/
6+
7+
# Jupyter Notebook
8+
.ipynb_checkpoints
9+
10+
# Autotuner env
211
autotuner_env

0 commit comments

Comments
 (0)