Skip to content

Commit b790f46

Browse files
committed
add generated test script
1 parent 8fcbac1 commit b790f46

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

.github/workflows/ci_build_test_cpp_linux.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: "Setting up Python"
3232
uses: actions/setup-python@75f3110429a8c05be0e1bf360334e4cced2b63fa # v2.3.3
3333
with:
34-
python-version: "3.11"
34+
python-version: "3.10"
3535

3636
- name: Sync source deps
3737
run: |
@@ -59,3 +59,7 @@ jobs:
5959
# Some things put stuff in cache with weird, root read-only
6060
# permissions. Take them back.
6161
sudo chown -R "$(whoami)" "${cache_dir}"
62+
63+
- name: Run generated tests
64+
run: |
65+
bash build_tools/ci/run_paritybench_test.sh
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
git clone https://github.com/jansel/pytorch-jit-paritybench.git
4+
5+
cd pytorch-jit-paritybench
6+
7+
git checkout 7e55a422588c1d1e00f35a3d3a3ff896cce59e18
8+
pip install -r requirements.txt
9+
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
10+
pip install expecttest
11+
12+
cd ..
13+
14+
pip install ./compiler
15+
pip install ./runtime
16+
pip install . --no-deps
17+
source build/iree/.env
18+
19+
python python/test/generated/main.py --tests-dir ./pytorch-jit-paritybench --limit 100 -j 4 --no-log
20+
21+

python/test/generated/main.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import logging
1111

1212
log = logging.getLogger("turbine-test")
13-
logging.basicConfig(level=logging.INFO)
1413

1514
ENV_FILE = "JITPARITYBENCH_PATH.txt"
1615

@@ -41,6 +40,11 @@ def get_args(raw_args=None):
4140
help="jit-paritybench location (i.e. /path/to/pytorch-jit-paritybench)",
4241
)
4342
# parser.add_argument("--device", default="cuda", type=str, help="evaluate modules using cuda or cpu") # excluded for now as we only have turbine-cpu, can use this later
43+
parser.add_argument(
44+
"--no-log",
45+
action='store_true',
46+
help="disable logging during execution",
47+
)
4448

4549
args = parser.parse_args(raw_args)
4650
return args
@@ -60,6 +64,11 @@ def read_path() -> str:
6064
if __name__ == "__main__":
6165
args = get_args()
6266

67+
if args.no_log:
68+
logging.basicConfig(level=logging.ERROR)
69+
else:
70+
logging.basicConfig(level=logging.INFO)
71+
6372
if args.tests_dir is not None:
6473
pb = args.tests_dir
6574
write_path(pb) # store this path for next time

0 commit comments

Comments
 (0)