1
+ #! /bin/bash
2
+ set -ex
3
+
1
4
if [ " $# " -ne 1 ]; then
2
5
echo " Illegal number of parameters. Pass cuda version"
3
- echo " CUDA version should be cu90 , cu100 or cpu"
6
+ echo " CUDA version should be cu92 , cu100 or cpu"
4
7
exit 1
5
8
fi
6
- export CUVER=" $1 " # cu90 cu100 cpu
9
+ export CUVER=" $1 " # cu92 cu100 cpu
10
+
11
+ if [[ " $CUVER " == " cu100" ]]; then
12
+ cu_suffix=" "
13
+ else
14
+ cu_suffix=" +$CUVER "
15
+ fi
7
16
8
- export TORCHVISION_BUILD_VERSION=" 0.3.0 "
17
+ export TORCHVISION_BUILD_VERSION=" 0.4.0.dev $( date " +%Y%m%d " ) ${cu_suffix} "
9
18
export TORCHVISION_BUILD_NUMBER=" 1"
19
+ export TORCHVISION_LOCAL_VERSION_LABEL=" $CUVER "
10
20
export OUT_DIR=" /remote/$CUVER "
11
- export TORCH_WHEEL=" torch -f https://download.pytorch.org/whl/$CUVER /stable.html --no-index"
12
21
13
22
pushd /opt/python
14
23
DESIRED_PYTHON=(* /)
@@ -18,12 +27,33 @@ for desired_py in "${DESIRED_PYTHON[@]}"; do
18
27
done
19
28
20
29
OLD_PATH=$PATH
21
- git clone https://github.com/pytorch/vision -b v${TORCHVISION_BUILD_VERSION}
22
- pushd vision
30
+ cd /tmp
31
+ rm -rf vision
32
+ git clone https://github.com/pytorch/vision
33
+
34
+ cd /tmp/vision
35
+
23
36
for PYDIR in " ${python_installations[@]} " ; do
24
37
export PATH=$PYDIR /bin:$OLD_PATH
38
+ pip install --upgrade pip
25
39
pip install numpy pyyaml future
26
- pip install $TORCH_WHEEL
40
+
41
+ pip uninstall -y torch || true
42
+ pip uninstall -y torch_nightly || true
43
+
44
+ export TORCHVISION_PYTORCH_DEPENDENCY_NAME=torch_nightly
45
+ pip install torch_nightly -f https://download.pytorch.org/whl/nightly/$CUVER /torch_nightly.html
46
+ # CPU/CUDA variants of PyTorch have ABI compatible PyTorch for
47
+ # the CPU only bits. Therefore, we
48
+ # strip off the local package qualifier, but ONLY if we're
49
+ # doing a CPU build.
50
+ if [[ " $CUVER " == " cpu" ]]; then
51
+ export TORCHVISION_PYTORCH_DEPENDENCY_VERSION=" $( pip show torch_nightly | grep ^Version: | sed ' s/Version: \+//' | sed ' s/+.\+//' ) "
52
+ else
53
+ export TORCHVISION_PYTORCH_DEPENDENCY_VERSION=" $( pip show torch_nightly | grep ^Version: | sed ' s/Version: \+//' ) "
54
+ fi
55
+ echo " Building against ${TORCHVISION_PYTORCH_DEPENDENCY_VERSION} "
56
+
27
57
pip install ninja
28
58
python setup.py clean
29
59
python setup.py bdist_wheel
0 commit comments