Skip to content

Commit

Permalink
bisect script updates (#9593)
Browse files Browse the repository at this point in the history
#0: don't take on burden of running slow dispatch
  • Loading branch information
TT-billteng authored Jun 20, 2024
1 parent 5469aa0 commit 61a38c2
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions tests/scripts/tt_bisect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
This script is used to find the commit that broke a test.
Flags:
-f | --file : test file to run, also the test that broke
-s | --slow : indicate the test runs in slow dispatch
-g | --good : good commit to start bisect
-b | --bad : bad commit to start bisect
Example:
./tests/scripts/tt_bisect.sh -s -f ./build/test/tt_metal/test_add_two_ints -b HEAD -g 1eb7930
./tests/scripts/tt_bisect.sh -f ./build/test/tt_metal/test_add_two_ints -b HEAD -g 1eb7930
If the test involves multiple words you have to do "test_file":
./tests/scripts/tt_bisect.sh -s -f "pytest $TT_METAL_HOME/models/demos/resnet/tests/test_resnet18.py" -b HEAD -g 1eb7930
./tests/scripts/tt_bisect.sh -s -f "python tests/scripts/run_tt_metal.py --dispatch-mode fast" -b HEAD -g HEAD~10
./tests/scripts/tt_bisect.sh -f "pytest $TT_METAL_HOME/models/demos/resnet/tests/test_resnet18.py" -b HEAD -g 1eb7930
./tests/scripts/tt_bisect.sh -f "python tests/scripts/run_tt_metal.py --dispatch-mode fast" -b HEAD -g HEAD~10
END

cd $TT_METAL_HOME
Expand All @@ -25,9 +24,6 @@ while getopts "f:sg:b:t:" opt; do
f | file)
test=$OPTARG
;;
s | slow)
sd=true
;;
g | good)
good_commit=$OPTARG
;;
Expand All @@ -49,11 +45,6 @@ if ([ -z "$test" ] || [ -z "$good_commit" ] || [ -z "$bad_commit" ]); then
exit 1
fi

if [[ $sd ]]; then
echo "Running in slow dispatch mode"
export TT_METAL_SLOW_DISPATCH_MODE=1
fi

echo "Time to find who broke it :)"
echo "Good commit:" $good_commit
echo "Bad commit:" $bad_commit
Expand All @@ -65,14 +56,8 @@ git bisect start $bad_commit $good_commit --
while [[ "$found" = "false" ]]; do
build_code=0
echo "at commit `git rev-parse HEAD`"
echo "Make clean"
make clean; build_code+=$?

echo "Making build"
make build; build_code+=$?

echo "Making tests"
make tests; build_code+=$?
echo "building Metal"
. build_metal.sh; build_code+=$?

if [[ $build_code -ne 0 ]]; then
echo "Build failed"
Expand Down

0 comments on commit 61a38c2

Please sign in to comment.