-
Notifications
You must be signed in to change notification settings - Fork 10
/
setup_silicon_v0_build_env.sh
50 lines (42 loc) · 1.54 KB
/
setup_silicon_v0_build_env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# setup brg sdh pytorch building env
echo " Setting up PyTorch building environment ... "
echo " Make sure you enabled devtoolset-8!"
echo " Make sure correct Python environemnt is set!"
echo ""
# setup pytorch building options
export REL_WITH_DEB_INFO=1
export BUILD_TEST=0
export BLAS=OpenBLAS
export USE_MKL=0
export USE_MKLDNN=0
export USE_CUDA=0
export USE_CUDNN=0
export USE_FBGEMM=0
export USE_NNPACK=0
export USE_QNNPACK=0
export USE_DISTRIBUTED=0
# Use gold if it's available for faster linking.
if which gold >/dev/null 2>&1 ; then
export CFLAGS='-fuse-ld=gold'
fi
# get current directory
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
echo " hb-pytorch lives in $DIR"
export USE_HB_SILICON_V0=1
# setup cudalite runtime and pytorch kernel binary paths
export BSG_MANYCORE_INCLUDE=/usr/include
export BSG_MANYCORE_LDPATH=/usr/lib64
export HB_KERNEL_DIR=$DIR/hammerblade/torch
echo " \$BRG_BSG_BLADERUNNER_DIR is set to $BRG_BSG_BLADERUNNER_DIR"
echo " \$BSG_MANYCORE_INCLUDE is set to $BSG_MANYCORE_INCLUDE"
echo " \$BSG_MANYCORE_LDPATH is set to $BSG_MANYCORE_LDPATH"
echo " \$HB_KERNEL_DIR is set to $HB_KERNEL_DIR"
echo ""
echo " Done!"
echo ""