Skip to content

Commit f62db78

Browse files
authored
Merge pull request #63 from pjh5/cuda92_fix
Turning off ATen tests for CUDA9.2
2 parents 5fa0ea5 + 3a8841d commit f62db78

File tree

2 files changed

+32
-14
lines changed

2 files changed

+32
-14
lines changed

manywheel/build.sh

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,35 @@ export USE_STATIC_NCCL=1
1818
export ATEN_STATIC_CUDA=1
1919
export USE_CUDA_STATIC_LINK=1
2020

21+
# Keep an array of cmake variables to add to
22+
if [[ -z "$CMAKE_ARGS" ]]; then
23+
# These are passed to tools/build_pytorch_libs.sh::build()
24+
CMAKE_ARGS=()
25+
fi
26+
if [[ -z "$EXTRA_CAFFE2_CMAKE_FLAGS" ]]; then
27+
# These are passed to tools/build_pytorch_libs.sh::build_caffe2()
28+
EXTRA_CAFFE2_CMAKE_FLAGS=()
29+
fi
30+
31+
# Determine CUDA version and architectures to build for
2132
CUDA_VERSION=$(nvcc --version|tail -n1|cut -f5 -d" "|cut -f1 -d",")
33+
echo "CUDA $CUDA_VERSION Detected"
2234

2335
export TORCH_CUDA_ARCH_LIST="3.5;5.0+PTX"
2436
if [[ $CUDA_VERSION == "8.0" ]]; then
25-
echo "CUDA 8.0 Detected"
2637
export TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST;6.0;6.1"
2738
elif [[ $CUDA_VERSION == "9.0" ]]; then
28-
echo "CUDA $CUDA_VERSION Detected"
2939
export TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST;6.0;7.0"
3040
elif [[ $CUDA_VERSION == "9.2" ]]; then
31-
echo "CUDA $CUDA_VERSION Detected"
3241
export TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST;6.0;6.1;7.0"
33-
fi
34-
echo $TORCH_CUDA_ARCH_LIST
35-
36-
if [[ $CUDA_VERSION == "8.0" ]]; then
37-
WHEELHOUSE_DIR="wheelhouse80"
38-
elif [[ $CUDA_VERSION == "9.0" ]]; then
39-
WHEELHOUSE_DIR="wheelhouse90"
40-
elif [[ $CUDA_VERSION == "9.2" ]]; then
41-
WHEELHOUSE_DIR="wheelhouse92"
42+
# ATen tests can't build with CUDA 9.2 and the old compiler used here
43+
EXTRA_CAFFE2_CMAKE_FLAGS+=("-DATEN_NO_TEST=ON")
4244
else
4345
echo "unknown cuda version $CUDA_VERSION"
4446
exit 1
4547
fi
48+
echo $TORCH_CUDA_ARCH_LIST
49+
WHEELHOUSE_DIR="wheelhouse${CUDA_VERSION:0:1}{CUDA_VERSION:2:1}"
4650

4751
# Build for given Python versions, or for all in /opt/python if none given
4852
if [[ -z "$DESIRED_PYTHON" ]]; then
@@ -90,7 +94,9 @@ for PYDIR in "${python_installations[@]}"; do
9094
else
9195
pip install numpy==1.11
9296
fi
93-
time python setup.py bdist_wheel -d $WHEELHOUSE_DIR
97+
time CMAKE_ARGS=${CMAKE_ARGS[@]} \
98+
EXTRA_CAFFE2_CMAKE_FLAGS=${EXTRA_CAFFE2_CMAKE_FLAGS[@]} \
99+
python setup.py bdist_wheel -d $WHEELHOUSE_DIR
94100
done
95101

96102
popd

manywheel/build_cpu.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ export NO_CUDA=1
1313
export CMAKE_LIBRARY_PATH="/opt/intel/lib:/lib:$CMAKE_LIBRARY_PATH"
1414
export CMAKE_INCLUDE_PATH="/opt/intel:$CMAKE_INCLUDE_PATH"
1515

16+
# Keep an array of cmake variables to add to
17+
if [[ -z "$CMAKE_ARGS" ]]; then
18+
# These are passed to tools/build_pytorch_libs.sh::build()
19+
CMAKE_ARGS=()
20+
fi
21+
if [[ -z "$EXTRA_CAFFE2_CMAKE_FLAGS" ]]; then
22+
# These are passed to tools/build_pytorch_libs.sh::build_caffe2()
23+
EXTRA_CAFFE2_CMAKE_FLAGS=()
24+
fi
25+
1626
WHEELHOUSE_DIR="wheelhousecpu"
1727

1828
rm -rf /usr/local/cuda*
@@ -62,7 +72,9 @@ for PYDIR in "${python_installations[@]}"; do
6272
else
6373
pip install numpy==1.11
6474
fi
65-
time python setup.py bdist_wheel -d $WHEELHOUSE_DIR
75+
time CMAKE_ARGS=${CMAKE_ARGS[@]} \
76+
EXTRA_CAFFE2_CMAKE_FLAGS=${EXTRA_CAFFE2_CMAKE_FLAGS[@]} \
77+
python setup.py bdist_wheel -d $WHEELHOUSE_DIR
6678
done
6779

6880
popd

0 commit comments

Comments
 (0)