Skip to content

Commit ec8a1b0

Browse files
luarssvvbandeira
andauthored
[Autotuner] Remote functionality check (#2334)
* Add remote test Signed-off-by: Song Luar <[email protected]> Co-authored-by: Vitor Bandeira <[email protected]>
1 parent 3052c08 commit ec8a1b0

File tree

6 files changed

+68
-3
lines changed

6 files changed

+68
-3
lines changed

etc/DependencyInstaller.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ _installUbuntuPackages() {
195195
docker-ce \
196196
docker-ce-cli \
197197
containerd.io \
198-
docker-buildx-plugin
198+
docker-buildx-plugin \
199+
docker-compose-plugin
199200
fi
200201
}
201202

flow/designs/sky130hd/gcd/autotuner.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"_SDC_CLK_PERIOD": {
55
"type": "float",
66
"minmax": [
7-
3.0,
8-
4.0
7+
7.0,
8+
12.0
99
],
1010
"step": 0
1111
},

flow/test/test_helper.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,22 @@ if [ $RUN_AUTOTUNER -eq 1 ]; then
121121

122122
echo "Running Autotuner smoke algorithm & evaluation test"
123123
python3 -m unittest tools.AutoTuner.test.smoke_test_algo_eval.${PLATFORM}AlgoEvalSmokeTest.test_algo_eval
124+
125+
# run this test last (because it modifies current path)
126+
echo "Running Autotuner remote test"
127+
if [ "$PLATFORM" == "asap7" ] && [ "$DESIGN" == "gcd" ]; then
128+
# Get the directory of the current script
129+
script_dir="$(dirname "${BASH_SOURCE[0]}")"
130+
cd "$script_dir"/../../
131+
latest_image=$(./etc/DockerTag.sh -dev)
132+
echo "ORFS_VERSION=$latest_image" > ./tools/AutoTuner/.env
133+
cd ./tools/AutoTuner
134+
docker compose up --wait
135+
docker compose exec ray-worker bash -c "cd /OpenROAD-flow-scripts/tools/AutoTuner/src/autotuner && \
136+
python3 distributed.py --design gcd --platform asap7 --server 127.0.0.1 --port 10001 \
137+
--config ../../../../flow/designs/asap7/gcd/autotuner.json tune --samples 1"
138+
docker compose down -v --remove-orphans
139+
fi
124140
fi
125141

126142
exit $ret

tools/AutoTuner/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ __pycache__/
99

1010
# Autotuner env
1111
autotuner_env
12+
.env

tools/AutoTuner/docker-compose.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
services:
2+
# Ray Head Node (Server)
3+
ray-head:
4+
image: openroad/orfs:${ORFS_VERSION}
5+
container_name: ray-head
6+
command: >
7+
cd /OpenROAD-flow-scripts
8+
pip install -r ./tools/AutoTuner/requirements.txt
9+
ray start --head --dashboard-port=8265 --port=6379 --dashboard-host=0.0.0.0 --block
10+
volumes:
11+
- ../../flow:/OpenROAD-flow-scripts/flow
12+
- ../../tools/AutoTuner:/OpenROAD-flow-scripts/tools/AutoTuner
13+
- ~/.local/shared-data/autotuner:/shared-data/autotuner
14+
ports:
15+
- "6379:6379" # redis
16+
- "8265:8265" # dashboard
17+
- "10001-10010:10001-10010" # ray ports
18+
healthcheck:
19+
test: ["CMD-SHELL", "pgrep -f 'ray::' || exit 1"]
20+
interval: 30s
21+
timeout: 10s
22+
retries: 5
23+
start_period: 10s
24+
25+
# Ray Worker Node
26+
ray-worker:
27+
image: openroad/orfs:${ORFS_VERSION}
28+
container_name: ray-worker
29+
command: >
30+
cd /OpenROAD-flow-scripts
31+
pip install -r ./tools/AutoTuner/requirements.txt
32+
ray start --address=ray-head:10001 --block
33+
volumes:
34+
- ../../flow:/OpenROAD-flow-scripts/flow
35+
- ../../tools/AutoTuner:/OpenROAD-flow-scripts/tools/AutoTuner
36+
- ~/.local/shared-data/autotuner:/shared-data/autotuner
37+
healthcheck:
38+
test: ["CMD-SHELL", "pgrep -f 'ray::' || exit 1"]
39+
interval: 30s
40+
timeout: 10s
41+
retries: 5
42+
start_period: 10s

tools/AutoTuner/setup.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ fi
1414
# Source the activation script to activate the virtual environment
1515
source "$venv_path"
1616
echo "Virtual environment activated successfully."
17+
18+
# Make autotuner shared folder
19+
AUTOTUNER_SHARED_DIR=$HOME/.local/shared-data/autotuner
20+
mkdir -p $AUTOTUNER_SHARED_DIR
21+
chmod 777 $AUTOTUNER_SHARED_DIR

0 commit comments

Comments
 (0)