Skip to content

Commit

Permalink
added FP32 dropout
Browse files Browse the repository at this point in the history
  • Loading branch information
alheinecke committed May 29, 2021
1 parent dbd6656 commit e0d29fc
Show file tree
Hide file tree
Showing 9 changed files with 313 additions and 1 deletion.
36 changes: 36 additions & 0 deletions samples/eltwise/kernel_test/unary_dropout_32b_eqld.slurm
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

TESTFILE1=$(mktemp -p .)

if [ -x "$(command -v python3)" ]; then
PYTHON=$(command -v python3)
else
PYTHON=$(command -v python)
fi

${PYTHON} << END
import random as rnd
import time as time
rnd.seed(time.time())
randnum = rnd.sample(range(1,101), 18)
f1 = open("${TESTFILE1}", "w+")
for m in randnum:
for n in randnum:
line = str(m) + '_' + str(n) + '_' \
+ str(m) + '_' + str(n) + '\n'
f1.write(line)
f1.close()
END

for i in `cat ${TESTFILE1}`
do
M=`echo ${i} | awk -F"_" '{print $1}'`
N=`echo ${i} | awk -F"_" '{print $2}'`
LDI=`echo ${i} | awk -F"_" '{print $3}'`
LDO=`echo ${i} | awk -F"_" '{print $4}'`
echo ${M} ${N} ${LDI} ${LDI}
./eltwise_unary_dropout F 0 4 4 ${M} ${N} ${LDI} ${LDI}
./eltwise_unary_dropout B 0 4 4 ${M} ${N} ${LDI} ${LDI}
done

rm ${TESTFILE1}
36 changes: 36 additions & 0 deletions samples/eltwise/kernel_test/unary_dropout_32b_gtld.slurm
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

TESTFILE1=$(mktemp -p .)

if [ -x "$(command -v python3)" ]; then
PYTHON=$(command -v python3)
else
PYTHON=$(command -v python)
fi

${PYTHON} << END
import random as rnd
import time as time
rnd.seed(time.time())
randnum = rnd.sample(range(1,101), 18)
f1 = open("${TESTFILE1}", "w+")
for m in randnum:
for n in randnum:
line = str(m) + '_' + str(n) + '_' \
+ str(m) + '_' + str(n) + '\n'
f1.write(line)
f1.close()
END

for i in `cat ${TESTFILE1}`
do
M=`echo ${i} | awk -F"_" '{print $1}'`
N=`echo ${i} | awk -F"_" '{print $2}'`
LDI=`echo ${i} | awk -F"_" '{print $3}'`
LDO=`echo ${i} | awk -F"_" '{print $4}'`
echo ${M} ${N} ${LDI} ${LDI}
./eltwise_unary_dropout F 0 4 4 ${M} ${N} 100 100
./eltwise_unary_dropout B 0 4 4 ${M} ${N} 100 100
done

rm ${TESTFILE1}
36 changes: 36 additions & 0 deletions samples/eltwise/kernel_test/unary_dropout_bitm_32b_eqld.slurm
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

TESTFILE1=$(mktemp -p .)

if [ -x "$(command -v python3)" ]; then
PYTHON=$(command -v python3)
else
PYTHON=$(command -v python)
fi

${PYTHON} << END
import random as rnd
import time as time
rnd.seed(time.time())
randnum = rnd.sample(range(16,97,16), 6)
f1 = open("${TESTFILE1}", "w+")
for m in randnum:
for n in randnum:
line = str(m) + '_' + str(n) + '_' \
+ str(m) + '_' + str(n) + '\n'
f1.write(line)
f1.close()
END

for i in `cat ${TESTFILE1}`
do
M=`echo ${i} | awk -F"_" '{print $1}'`
N=`echo ${i} | awk -F"_" '{print $2}'`
LDI=`echo ${i} | awk -F"_" '{print $3}'`
LDO=`echo ${i} | awk -F"_" '{print $4}'`
echo ${M} ${N} ${LDI} ${LDI}
./eltwise_unary_dropout F 1 4 4 ${M} ${N} ${LDI} ${LDI}
./eltwise_unary_dropout B 1 4 4 ${M} ${N} ${LDI} ${LDI}
done

rm ${TESTFILE1}
36 changes: 36 additions & 0 deletions samples/eltwise/kernel_test/unary_dropout_bitm_32b_gtld.slurm
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

TESTFILE1=$(mktemp -p .)

if [ -x "$(command -v python3)" ]; then
PYTHON=$(command -v python3)
else
PYTHON=$(command -v python)
fi

${PYTHON} << END
import random as rnd
import time as time
rnd.seed(time.time())
randnum = rnd.sample(range(16,97,16), 6)
f1 = open("${TESTFILE1}", "w+")
for m in randnum:
for n in randnum:
line = str(m) + '_' + str(n) + '_' \
+ str(m) + '_' + str(n) + '\n'
f1.write(line)
f1.close()
END

for i in `cat ${TESTFILE1}`
do
M=`echo ${i} | awk -F"_" '{print $1}'`
N=`echo ${i} | awk -F"_" '{print $2}'`
LDI=`echo ${i} | awk -F"_" '{print $3}'`
LDO=`echo ${i} | awk -F"_" '{print $4}'`
echo ${M} ${N} ${LDI} ${LDI}
./eltwise_unary_dropout F 1 4 4 ${M} ${N} 112 112
./eltwise_unary_dropout B 1 4 4 ${M} ${N} 112 112
done

rm ${TESTFILE1}
42 changes: 42 additions & 0 deletions samples/eltwise/kernel_test/unary_dropout_bitm_mixed_eqld.slurm
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

TESTFILE1=$(mktemp -p .)

if [ -x "$(command -v python3)" ]; then
PYTHON=$(command -v python3)
else
PYTHON=$(command -v python)
fi

${PYTHON} << END
import random as rnd
import time as time
rnd.seed(time.time())
randnum = rnd.sample(range(16,97,16), 6)
f1 = open("${TESTFILE1}", "w+")
for m in randnum:
for n in randnum:
line = str(m) + '_' + str(n) + '_' \
+ str(m) + '_' + str(n) + '\n'
f1.write(line)
f1.close()
END

for i in `cat ${TESTFILE1}`
do
M=`echo ${i} | awk -F"_" '{print $1}'`
N=`echo ${i} | awk -F"_" '{print $2}'`
LDI=`echo ${i} | awk -F"_" '{print $3}'`
LDO=`echo ${i} | awk -F"_" '{print $4}'`
echo ${M} ${N} ${LDI} ${LDI}
for PREC_IN in 2 4
do
for PREC_OUT in 2 4
do
./eltwise_unary_dropout F 1 ${PREC_IN} ${PREC_OUT} ${M} ${N} ${LDI} ${LDI}
./eltwise_unary_dropout B 1 ${PREC_IN} ${PREC_OUT} ${M} ${N} ${LDI} ${LDI}
done
done
done

rm ${TESTFILE1}
42 changes: 42 additions & 0 deletions samples/eltwise/kernel_test/unary_dropout_bitm_mixed_gtld.slurm
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

TESTFILE1=$(mktemp -p .)

if [ -x "$(command -v python3)" ]; then
PYTHON=$(command -v python3)
else
PYTHON=$(command -v python)
fi

${PYTHON} << END
import random as rnd
import time as time
rnd.seed(time.time())
randnum = rnd.sample(range(16,97,16), 6)
f1 = open("${TESTFILE1}", "w+")
for m in randnum:
for n in randnum:
line = str(m) + '_' + str(n) + '_' \
+ str(m) + '_' + str(n) + '\n'
f1.write(line)
f1.close()
END

for i in `cat ${TESTFILE1}`
do
M=`echo ${i} | awk -F"_" '{print $1}'`
N=`echo ${i} | awk -F"_" '{print $2}'`
LDI=`echo ${i} | awk -F"_" '{print $3}'`
LDO=`echo ${i} | awk -F"_" '{print $4}'`
echo ${M} ${N} ${LDI} ${LDI}
for PREC_IN in 2 4
do
for PREC_OUT in 2 4
do
./eltwise_unary_dropout F 1 ${PREC_IN} ${PREC_OUT} ${M} ${N} 112 112
./eltwise_unary_dropout B 1 ${PREC_IN} ${PREC_OUT} ${M} ${N} 112 112
done
done
done

rm ${TESTFILE1}
42 changes: 42 additions & 0 deletions samples/eltwise/kernel_test/unary_dropout_mixed_eqld.slurm
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

TESTFILE1=$(mktemp -p .)

if [ -x "$(command -v python3)" ]; then
PYTHON=$(command -v python3)
else
PYTHON=$(command -v python)
fi

${PYTHON} << END
import random as rnd
import time as time
rnd.seed(time.time())
randnum = rnd.sample(range(1,101), 18)
f1 = open("${TESTFILE1}", "w+")
for m in randnum:
for n in randnum:
line = str(m) + '_' + str(n) + '_' \
+ str(m) + '_' + str(n) + '\n'
f1.write(line)
f1.close()
END

for i in `cat ${TESTFILE1}`
do
M=`echo ${i} | awk -F"_" '{print $1}'`
N=`echo ${i} | awk -F"_" '{print $2}'`
LDI=`echo ${i} | awk -F"_" '{print $3}'`
LDO=`echo ${i} | awk -F"_" '{print $4}'`
echo ${M} ${N} ${LDI} ${LDI}
for PREC_IN in 2 4
do
for PREC_OUT in 2 4
do
./eltwise_unary_dropout F 0 ${PREC_IN} ${PREC_OUT} ${M} ${N} ${LDI} ${LDI}
./eltwise_unary_dropout B 0 ${PREC_IN} ${PREC_OUT} ${M} ${N} ${LDI} ${LDI}
done
done
done

rm ${TESTFILE1}
42 changes: 42 additions & 0 deletions samples/eltwise/kernel_test/unary_dropout_mixed_gtld.slurm
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

TESTFILE1=$(mktemp -p .)

if [ -x "$(command -v python3)" ]; then
PYTHON=$(command -v python3)
else
PYTHON=$(command -v python)
fi

${PYTHON} << END
import random as rnd
import time as time
rnd.seed(time.time())
randnum = rnd.sample(range(1,101), 18)
f1 = open("${TESTFILE1}", "w+")
for m in randnum:
for n in randnum:
line = str(m) + '_' + str(n) + '_' \
+ str(m) + '_' + str(n) + '\n'
f1.write(line)
f1.close()
END

for i in `cat ${TESTFILE1}`
do
M=`echo ${i} | awk -F"_" '{print $1}'`
N=`echo ${i} | awk -F"_" '{print $2}'`
LDI=`echo ${i} | awk -F"_" '{print $3}'`
LDO=`echo ${i} | awk -F"_" '{print $4}'`
echo ${M} ${N} ${LDI} ${LDI}
for PREC_IN in 2 4
do
for PREC_OUT in 2 4
do
./eltwise_unary_dropout F 0 ${PREC_IN} ${PREC_OUT} ${M} ${N} 100 100
./eltwise_unary_dropout B 0 ${PREC_IN} ${PREC_OUT} ${M} ${N} 100 100
done
done
done

rm ${TESTFILE1}
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
master-1.16.1-1493
master-1.16.1-1494

0 comments on commit e0d29fc

Please sign in to comment.