Update gemm performance monitoring tool:

- permit to recompute a subset of changesets
 - update changeset list
 - add a few more cases
This commit is contained in:
Gael Guennebaud
2015-03-06 11:47:13 +01:00
parent 58740ce4c6
commit eedd5063fd
3 changed files with 78 additions and 40 deletions

View File

@@ -6,6 +6,7 @@
# Options:
# -up : enforce the recomputation of existing data, and keep best results as a merging strategy
# -s : recompute selected changesets only and keep bests
if echo "$*" | grep '\-up' > /dev/null; then
@@ -14,14 +15,30 @@ else
update=false
fi
if [ $update == true ]; then
if echo "$*" | grep '\-s' > /dev/null; then
selected=true
else
selected=false
fi
global_args="$*"
if [ $selected == true ]; then
echo "Recompute selected changesets only and keep bests"
elif [ $update == true ]; then
echo "(Re-)Compute all changesets and keep bests"
else
echo "Skip previously computed changesets"
fi
if [ ! -d "eigen_src" ]; then
hg clone https://bitbucket.org/eigen/eigen eigen_src
else
cd eigen_src
hg pull -u
cd ..
fi
if [ ! -z '$CXX' ]; then
@@ -61,17 +78,31 @@ function test_current
scalar=$2
name=$3
prev=`grep $rev "$name.backup" | cut -c 14-`
prev=""
if [ -e "$name.backup" ]; then
prev=`grep $rev "$name.backup" | cut -c 14-`
fi
res=$prev
count_rev=`echo $prev | wc -w`
count_ref=`cat "settings.txt" | wc -l`
if [ $update == true ] || [ $count_rev != $count_ref ]; then
if echo "$global_args" | grep "$rev" > /dev/null; then
rev_found=true
else
rev_found=false
fi
# echo $update et $selected et $rev_found because $rev et "$global_args"
# echo $count_rev et $count_ref
if [ $update == true ] || [ $count_rev != $count_ref ] || ([ $selected == true ] && [ $rev_found == true ]); then
if $CXX -O2 -DNDEBUG -march=native $CXX_FLAGS -I eigen_src gemm.cpp -DSCALAR=$scalar -o $name; then
curr=`./$name`
echo merge $prev
echo with $curr
if [ $count_rev == $count_ref ]; then
echo "merge previous $prev"
echo "with new $curr"
else
echo "got $curr"
fi
res=`merge "$curr" "$prev"`
echo $res
# echo $res
echo "$rev $res" >> $name.out
else
echo "Compilation failed, skip rev $rev"
@@ -86,12 +117,12 @@ make_backup $PREFIX"sgemm"
make_backup $PREFIX"dgemm"
make_backup $PREFIX"cgemm"
cut -f1 -d"#" < changesets.txt | while read rev
cut -f1 -d"#" < changesets.txt | grep -E '[[:alnum:]]' | while read rev
do
if [ ! -z '$rev' ]; then
echo "Testing rev $rev"
cd eigen_src
hg up -C $rev
hg up -C $rev > /dev/null
actual_rev=`hg identify | cut -f1 -d' '`
cd ..