21
21
strategy :
22
22
matrix :
23
23
' PyTorch | old ' :
24
- docker-image : ' pytorch/pytorch:1.9.0-cuda11.1-cudnn8-runtime'
24
+ # Torch does not have build wheels with old Torch versions for newer CUDA
25
+ docker-image : ' nvidia/cuda:11.1.1-cudnn8-devel-ubuntu20.04'
25
26
agent-pool : ' lit-rtx-3090'
26
- torch-ver : ' 1.9.0 '
27
+ torch-ver : ' 1.8.1 '
27
28
' PyTorch | 1.X ' :
28
29
docker-image : ' pytorch/pytorch:1.13.1-cuda11.6-cudnn8-runtime'
29
30
agent-pool : ' lit-rtx-3090'
@@ -60,10 +61,33 @@ jobs:
60
61
61
62
steps :
62
63
64
+ - script : |
65
+ container_id=$(head -1 /proc/self/cgroup|cut -d/ -f3)
66
+ echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
67
+ /tmp/docker exec -t -u 0 $container_id \
68
+ sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
69
+ echo "##vso[task.setvariable variable=CONTAINER_ID]$container_id"
70
+ displayName: 'Install Sudo in container (thanks Microsoft!)'
71
+
72
+ - script : |
73
+ sudo apt-get update -q --fix-missing
74
+ sudo apt-get install -q -y --no-install-recommends \
75
+ build-essential wget python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-distutils
76
+ sudo update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1
77
+ wget https://bootstrap.pypa.io/get-pip.py --progress=bar:force:noscroll --no-check-certificate
78
+ python get-pip.py
79
+ env:
80
+ PYTHON_VERSION: "3.8"
81
+ condition: startsWith(variables['docker-image'], 'nvidia/cuda:')
82
+ displayName: 'install python & pip'
83
+
63
84
- bash : |
64
- echo "##vso[task.setvariable variable=CONTAINER_ID]$(head -1 /proc/self/cgroup|cut -d/ -f3)"
65
85
echo "##vso[task.setvariable variable=CUDA_VISIBLE_DEVICES]$(DEVICES)"
66
- displayName: 'Set environment variables'
86
+ CUDA_version=$(nvcc --version | sed -n 's/^.*release \([0-9]\+\.[0-9]\+\).*$/\1/p')
87
+ CUDA_version_mm="${CUDA_version//'.'/''}"
88
+ echo "##vso[task.setvariable variable=CUDA_VERSION_MM]$CUDA_version_mm"
89
+ echo "##vso[task.setvariable variable=TORCH_URL]https://download.pytorch.org/whl/cu${CUDA_version_mm}/torch_stable.html"
90
+ displayName: 'set Env. vars'
67
91
68
92
- bash : |
69
93
whoami && id
@@ -72,23 +96,18 @@ jobs:
72
96
nvidia-smi
73
97
echo $CUDA_VISIBLE_DEVICES
74
98
echo $CONTAINER_ID
99
+ echo $TORCH_URL
75
100
python --version
76
101
pip --version
77
102
pip cache dir
78
103
pip list
79
- python -c "import torch ; print(torch.cuda.get_arch_list())"
80
104
displayName: 'Image info & NVIDIA'
81
105
82
- - script : |
83
- /tmp/docker exec -t -u 0 $CONTAINER_ID \
84
- sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
85
- displayName: 'Install Sudo in container (thanks Microsoft!)'
86
-
87
106
- bash : |
88
107
pip install -q packaging
89
- python ./requirements/adjust-versions.py requirements.txt
108
+ python ./requirements/adjust-versions.py requirements.txt $(torch-ver)
90
109
for fpath in `ls requirements/*.txt`; do
91
- python ./requirements/adjust-versions.py $fpath
110
+ python ./requirements/adjust-versions.py $fpath $(torch-ver)
92
111
done
93
112
displayName: 'Adjust versions'
94
113
@@ -97,15 +116,15 @@ jobs:
97
116
sudo apt-get update -qq --fix-missing
98
117
sudo apt-get install -y build-essential gcc g++ cmake ffmpeg git libsndfile1 unzip --no-install-recommends
99
118
# pip install pip -U
100
- pip install -e . -r ./requirements/devel.txt
119
+ pip install -e . -U - r ./requirements/devel.txt --find-links ${TORCH_URL}
101
120
pip install mkl-service==2.4.0 # needed for the gpu multiprocessing
102
121
pip list
103
122
displayName: 'Install environment'
104
123
105
124
- bash : |
106
125
set -e
107
126
python -c "from torch import __version__ as ver ; assert str(ver).split('+')[0] == '$(torch-ver)', f'PyTorch: {ver}'"
108
- python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu >= 2, f'GPU : {mgpu}'"
127
+ python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu >= 2, f'found GPUs : {mgpu}'"
109
128
displayName: 'Sanity check'
110
129
111
130
- bash : |
@@ -117,7 +136,7 @@ jobs:
117
136
ls -lh $(TRANSFORMERS_CACHE)
118
137
displayName: 'Show caches'
119
138
120
- - bash : python -m pytest torchmetrics --timeout=180 --durations=50
139
+ - bash : python -m pytest torchmetrics --timeout=240 --durations=50
121
140
env :
122
141
SKIP_SLOW_DOCTEST : 1
123
142
workingDirectory : src
@@ -131,7 +150,7 @@ jobs:
131
150
workingDirectory: tests
132
151
displayName: 'Pull testing data from S3'
133
152
134
- - bash : python -m pytest unittests -v --cov=torchmetrics --timeout=180 --durations=500
153
+ - bash : python -m pytest unittests -v --cov=torchmetrics --timeout=240 --durations=500
135
154
env :
136
155
CUDA_LAUNCH_BLOCKING : 1
137
156
workingDirectory : tests
@@ -162,11 +181,11 @@ jobs:
162
181
python .github/assistant.py set-oldest-versions --req_files='["requirements/integrate.txt"]'
163
182
cat requirements/integrate.txt
164
183
displayName: 'Set oldest versions'
165
- condition: eq(variables['torch-ver'], '1.9.0 ')
184
+ condition: eq(variables['torch-ver'], '1.8.1 ')
166
185
167
186
- bash : |
168
187
pip install -q -r requirements/integrate.txt
169
- pip install -e . # force reinstall TM as it could be overwritten by integration's depenencies
188
+ pip install -e . # force reinstall TM as it could be overwritten by integration's dependencies
170
189
pip list
171
190
displayName: 'Install integrations'
172
191
0 commit comments