File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
function train() {
4
4
unset OMP_NUM_THREADS MKL_NUM_THREADS
5
- export OMP_DYNAMIC=" FALSE"
6
- # TODO(TJ): auto 1.0 or 0,0 for HT on or off
7
- export KMP_AFFINITY=" granularity=fine,compact,0,0"
8
5
topology=$1
9
6
layer_num=$2
10
7
bs=$3
@@ -42,6 +39,17 @@ if [ ! -d "logs" ]; then
42
39
mkdir logs
43
40
fi
44
41
42
+ total_cores=` ls -l /sys/devices/system/cpu/ | grep " cpu[0-9]*$" | wc -l`
43
+ online_cores=` cat /sys/devices/system/cpu/cpu* /online | grep -o ' 1' | wc -l`
44
+ if [ $online_cores -eq $total_cores ]; then
45
+ echo " Hyper Threading is ON"
46
+ export KMP_AFFINITY=" granularity=fine,compact,1,0"
47
+ else
48
+ echo " Hyper Threading is OFF"
49
+ export OMP_DYNAMIC=" FALSE"
50
+ export KMP_AFFINITY=" granularity=fine,compact,0,0"
51
+ fi
52
+
45
53
for use_mkldnn in True False; do
46
54
for batchsize in 64 128 256; do
47
55
# vgg-19 and vgg-16
You can’t perform that action at this time.
0 commit comments