forked from intel/mlir-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
224 lines (194 loc) · 7.31 KB
/
azure-pipelines.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# A pipeline with no CI trigger
trigger: none
# no PR triggers
pr: none
jobs:
- job: Windows
pool:
vmImage: windows-2019
steps:
- task: DownloadPipelineArtifact@2
displayName: "Get LLVM cache"
inputs:
source: 'specific'
project: 'mlir-llvm'
pipeline: 'IntelPython.mlir-llvm-recipe'
runVersion: 'latest'
artifact: 'mlir-llvm_latest_Windows_NT'
path: '$(System.DefaultWorkingDirectory)\llvm_cache'
- script: |
curl --output tbb.zip -L "https://github.com/oneapi-src/oneTBB/releases/download/v2021.1.1/oneapi-tbb-2021.1.1-win.zip"
mkdir tbb
tar -xf "tbb.zip" -C tbb --strip-components=1
displayName: 'Get TBB'
- script: |
call "C:\Miniconda\Scripts\activate"
call cd numba_dpcomp
call conda install python=3.7 numba=0.54 numpy=1.20 scikit-learn pytest-xdist ninja scipy pybind11 tbb=2021.1 pytest lit -c conda-forge
call cmake --version
call set LLVM_PATH=$(System.DefaultWorkingDirectory)\llvm_cache
call set TBB_PATH=$(System.DefaultWorkingDirectory)\tbb
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
python setup.py develop
displayName: 'Build'
- script: |
call "C:\Miniconda\Scripts\activate"
call cd numba_dpcomp
pytest -n1 -vv --capture=tee-sys -rXF
displayName: 'Tests'
- script: |
call "C:\Miniconda\Scripts\activate"
call cd cmake_build
call ctest -C Release --output-on-failure
displayName: 'CTests'
- script: |
call "C:\Miniconda\Scripts\activate"
call cd numba_dpcomp
set LLVM_PATH=$(System.DefaultWorkingDirectory)\llvm_cache
set TBB_PATH=$(System.DefaultWorkingDirectory)\tbb
mkdir wheels
cd wheels
pip wheel ..
displayName: 'Build wheels'
- publish: $(System.DefaultWorkingDirectory)/numba_dpcomp/wheels
artifact: 'numba-dpcomp-wheels-win'
displayName: 'Publish wheels'
- job: Linux
pool:
vmImage: ubuntu-20.04
steps:
- task: DownloadPipelineArtifact@2
displayName: "Get LLVM cache"
inputs:
source: 'specific'
project: 'mlir-llvm'
pipeline: 'IntelPython.mlir-llvm-recipe'
runVersion: 'latest'
artifact: 'mlir-llvm_latest_Linux'
path: '$(System.DefaultWorkingDirectory)/llvm_cache'
- script: |
wget -O tbb.tgz "https://github.com/oneapi-src/oneTBB/releases/download/v2021.1.1/oneapi-tbb-2021.1.1-lin.tgz"
mkdir tbb
tar -xf "tbb.tgz" -C tbb --strip-components=1
displayName: 'Get TBB'
- script: |
git clone https://github.com/oneapi-src/level-zero.git
cd level-zero
git checkout v1.6.2
mkdir level_zero_install
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../level_zero_install ..
make install
displayName: 'Get L0'
- script: |
source /usr/share/miniconda/bin/activate
cd numba_dpcomp
conda create -y -n build_env python=3.7 numba=0.54 numpy=1.20 scikit-learn pytest-xdist ninja scipy pybind11 pytest lit -c conda-forge -c intel
conda activate build_env
conda install -y tbb=2021 -c conda-forge -c intel --force
conda list
python -c "import numba; print('numba', numba.__version__)"
python -c "import numpy; print(numpy.get_include())"
cmake --version
chmod -R 777 $(System.DefaultWorkingDirectory)/llvm_cache
export LLVM_PATH=$(System.DefaultWorkingDirectory)/llvm_cache
export TBB_PATH=$(System.DefaultWorkingDirectory)/tbb
export LEVEL_ZERO_DIR=$(System.DefaultWorkingDirectory)/level-zero/level_zero_install
export LEVEL_ZERO_VERSION_CHECK_OFF=1
export OCL_ICD_FILENAMES_RESET=1
export OCL_ICD_FILENAMES=libintelocl.so
export SYCL_DEVICE_FILTER=opencl:cpu
python setup.py develop
displayName: 'Build'
- script: |
source /usr/share/miniconda/bin/activate
cd numba_dpcomp
conda activate build_env
source $(System.DefaultWorkingDirectory)/tbb/env/vars.sh
export OCL_ICD_FILENAMES_RESET=1
export OCL_ICD_FILENAMES=libintelocl.so
export SYCL_DEVICE_FILTER=opencl:cpu
export NUMBA_DISABLE_PERFORMANCE_WARNINGS=1
pytest -n1 -vv --capture=tee-sys -rXF
DPCOMP_ENABLE_PARFOR_TESTS=1 pytest "numba_dpcomp/mlir/tests/test_numba_parfor.py" -n1 -vv --capture=tee-sys -rFX
displayName: 'Tests'
- script: |
source /usr/share/miniconda/bin/activate
conda activate build_env
source $(System.DefaultWorkingDirectory)/tbb/env/vars.sh
cd cmake_build
ctest -C Release --output-on-failure
displayName: 'CTests'
- script: |
source /usr/share/miniconda/bin/activate
cd numba_dpcomp
conda activate build_env
export LLVM_PATH=$(System.DefaultWorkingDirectory)/llvm_cache
export TBB_PATH=$(System.DefaultWorkingDirectory)/tbb
export LEVEL_ZERO_DIR=$(System.DefaultWorkingDirectory)/level-zero/level_zero_install
mkdir wheels
cd wheels
pip wheel ..
displayName: 'Build wheels'
- publish: $(System.DefaultWorkingDirectory)/numba_dpcomp/wheels
artifact: 'numba-dpcomp-wheels-lin'
displayName: 'Publish wheels'
- job: MacOS
pool:
vmImage: macOS-10.15
steps:
- task: DownloadPipelineArtifact@2
displayName: "Get LLVM cache"
inputs:
source: 'specific'
project: 'mlir-llvm'
pipeline: 'IntelPython.mlir-llvm-recipe'
runVersion: 'latest'
artifact: 'mlir-llvm_latest_Darwin'
path: '$(System.DefaultWorkingDirectory)/llvm_cache'
- script: |
wget -O tbb.tgz "https://github.com/oneapi-src/oneTBB/releases/download/v2021.1.1/oneapi-tbb-2021.1.1-mac.tgz"
mkdir tbb
tar -xf "tbb.tgz" -C tbb --strip-components=1
displayName: 'Get TBB'
# On Hosted macOS, the agent user doesn't have ownership of Miniconda's installation directory/
# We need to take ownership if we want to update conda or install packages globally
- bash: sudo chown -R $USER $CONDA
displayName: Take ownership of conda installation
- script: |
source /usr/local/miniconda/bin/activate
cd numba_dpcomp
conda create -y -n test_env python=3.9 numba=0.54 scikit-learn pytest-xdist ninja scipy pybind11 tbb=2021.1 pytest lit -c conda-forge
conda activate test_env
cmake --version
chmod -R 777 $(System.DefaultWorkingDirectory)/llvm_cache
export LLVM_PATH=$(System.DefaultWorkingDirectory)/llvm_cache
export TBB_PATH=$(System.DefaultWorkingDirectory)/tbb
python setup.py develop
displayName: 'Build'
- script: |
source /usr/local/miniconda/bin/activate
cd numba_dpcomp
conda activate test_env
pytest -n1 -vv --capture=tee-sys -rXF
displayName: 'Tests'
- script: |
source /usr/local/miniconda/bin/activate
conda activate test_env
cd cmake_build
ctest -C Release --output-on-failure
displayName: 'CTests'
- script: |
source /usr/local/miniconda/bin/activate
cd numba_dpcomp
conda activate test_env
export LLVM_PATH=$(System.DefaultWorkingDirectory)/llvm_cache
export TBB_PATH=$(System.DefaultWorkingDirectory)/tbb
mkdir wheels
cd wheels
pip wheel ..
displayName: 'Build wheels'
- publish: $(System.DefaultWorkingDirectory)/numba_dpcomp/wheels
artifact: 'numba-dpcomp-wheels-mac'
displayName: 'Publish wheels'