forked from pytorch/xla
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add benchmarks/run_tests.sh (pytorch#6043)
Tested locally with: ``` $ test/benchmarks/run_tests.sh -L [...] + make -C /src/pytorch/xla/test/benchmarks all make: Entering directory '/src/pytorch/xla/test/benchmarks' AGGREGATE --accelerator=a6000 --test=inference --report=speedup DIFF a6000.inference.speedup.test RM a6000.inference.speedup.test.tmp AGGREGATE --accelerator=v100 --test=inference --report=histogram DIFF v100.inference.histogram.test RM v100.inference.histogram.test.tmp AGGREGATE --accelerator=v100 --test=inference --report=latest DIFF v100.inference.latest.test RM v100.inference.latest.test.tmp AGGREGATE --accelerator=v100 --test=inference --report=speedup DIFF v100.inference.speedup.test RM v100.inference.speedup.test.tmp make: Leaving directory '/src/pytorch/xla/test/benchmarks' $ test/benchmarks/run_tests.sh -L -V 1 [...] + make -C /src/pytorch/xla/test/benchmarks V=1 all make: Entering directory '/src/pytorch/xla/test/benchmarks' python3 ../../benchmarks/aggregate.py --accelerator=a6000 --test=inference --report=speedup \ --input-dirname=. --format=csv > a6000.inference.speedup.test.tmp git diff --no-index a6000.inference.speedup.test a6000.inference.speedup.test.tmp rm -f a6000.inference.speedup.test.tmp python3 ../../benchmarks/aggregate.py --accelerator=v100 --test=inference --report=histogram \ --input-dirname=. --format=csv > v100.inference.histogram.test.tmp git diff --no-index v100.inference.histogram.test v100.inference.histogram.test.tmp rm -f v100.inference.histogram.test.tmp python3 ../../benchmarks/aggregate.py --accelerator=v100 --test=inference --report=latest \ --input-dirname=. --format=csv > v100.inference.latest.test.tmp git diff --no-index v100.inference.latest.test v100.inference.latest.test.tmp rm -f v100.inference.latest.test.tmp python3 ../../benchmarks/aggregate.py --accelerator=v100 --test=inference --report=speedup \ --input-dirname=. --format=csv > v100.inference.speedup.test.tmp git diff --no-index v100.inference.speedup.test v100.inference.speedup.test.tmp rm -f v100.inference.speedup.test.tmp make: Leaving directory '/src/pytorch/xla/test/benchmarks' ```
- Loading branch information
Showing
4 changed files
with
70 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
set -ex | ||
CDIR="$(cd "$(dirname "$0")" ; pwd -P)" | ||
LOGFILE=/tmp/pytorch_benchmarks_test.log | ||
VERBOSITY=0 | ||
|
||
# Note [Keep Going] | ||
# | ||
# Set the `CONTINUE_ON_ERROR` flag to `true` to make the CircleCI tests continue on error. | ||
# This will allow you to see all the failures on your PR, not stopping with the first | ||
# test failure like the default behavior. | ||
CONTINUE_ON_ERROR="${CONTINUE_ON_ERROR:-0}" | ||
if [[ "$CONTINUE_ON_ERROR" == "1" ]]; then | ||
set +e | ||
fi | ||
|
||
while getopts 'LV:' OPTION | ||
do | ||
case $OPTION in | ||
L) | ||
LOGFILE= | ||
;; | ||
V) | ||
VERBOSITY=$OPTARG | ||
;; | ||
esac | ||
done | ||
shift $(($OPTIND - 1)) | ||
|
||
function run_make_tests { | ||
MAKE_V="" | ||
if [ "$VERBOSITY" != "0" ]; then | ||
MAKE_V="V=$VERBOSITY" | ||
fi | ||
make -C $CDIR $MAKE_V all | ||
} | ||
|
||
function run_tests { | ||
run_make_tests | ||
} | ||
|
||
if [ "$LOGFILE" != "" ]; then | ||
run_tests 2>&1 | tee $LOGFILE | ||
else | ||
run_tests | ||
fi |