forked from ROCm/rocRAND
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
328 lines (309 loc) · 10.4 KB
/
.gitlab-ci.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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# MIT License
#
# Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
variables:
SUDO_CMD: "" # Must be "sudo" on images which dont use root user
DEPS_DIR: "$CI_PROJECT_DIR/__dependencies"
CMAKE_URL: "https://cmake.org/files/v3.5/cmake-3.5.1-Linux-x86_64.tar.gz"
# General build flags
CXXFLAGS: ""
CMAKE_OPTIONS: ""
# Local build options
LOCAL_CXXFLAGS: ""
LOCAL_CMAKE_OPTIONS: ""
# ROCm
.rocm:
variables:
SUDO_CMD: "sudo -E"
tags:
- rocm
image: rocm/rocm-terminal:latest
before_script:
- $SUDO_CMD apt-get update -qq
- $SUDO_CMD apt-get install -y -qq ca-certificates git wget tar xz-utils bzip2 build-essential pkg-config g++ gfortran
- hipconfig
# cmake
- mkdir -p $DEPS_DIR/cmake
- wget --no-check-certificate --quiet -O - $CMAKE_URL | tar --strip-components=1 -xz -C $DEPS_DIR/cmake
- export PATH=$DEPS_DIR/cmake/bin:$PATH
# Combine global build options with local options
- export CXXFLAGS=$CXXFLAGS" "$LOCAL_CXXFLAGS
- export CMAKE_OPTIONS=$CXXFLAGS" "$LOCAL_CMAKE_OPTIONS
build:rocm:
extends: .rocm
stage: build
script:
- mkdir build
- cd build
- CXX=hcc cmake -DBUILD_BENCHMARK=ON -DBUILD_FORTRAN_WRAPPER=ON -DBUILD_CRUSH_TEST=ON -DDEPENDENCIES_FORCE_DOWNLOAD=ON ../.
- make -j16
- make package
artifacts:
paths:
- build/library/
- build/test/crush_test_*
- build/test/test_*
- build/test/stat_test_*
- build/test/CTestTestfile.cmake
- build/benchmark/benchmark_*
- build/gtest/
- build/testu01/
- build/CMakeCache.txt
- build/CTestTestfile.cmake
- build/*.deb
- build/*.zip
expire_in: 2 weeks
test:rocm_vega20:
extends: .rocm
dependencies:
- build:rocm
tags:
- vega20
- rocm
script:
- cd build
- $SUDO_CMD ctest --output-on-failure
- $SUDO_CMD ./benchmark/benchmark_rocrand_generate --dis all --engine all --trials 5
- $SUDO_CMD ./benchmark/benchmark_rocrand_kernel --dis all --engine all --trials 5
- $SUDO_CMD ./test/crush_test_rocrand --help # Just check if works
test:rocm_s9300:
extends: .rocm
dependencies:
- build:rocm
tags:
- s9300
- rocm
script:
- cd build
- $SUDO_CMD ctest --output-on-failure
- $SUDO_CMD ./benchmark/benchmark_rocrand_generate --dis all --engine all --trials 5
- $SUDO_CMD ./benchmark/benchmark_rocrand_kernel --dis all --engine all --trials 5
- $SUDO_CMD ./test/crush_test_rocrand --help # Just check if works
test:rocm_mi25:
extends: .rocm
dependencies:
- build:rocm
tags:
- mi25
- rocm
script:
- cd build
- $SUDO_CMD ctest --output-on-failure
- $SUDO_CMD ./benchmark/benchmark_rocrand_generate --dis all --engine all --trials 5
- $SUDO_CMD ./benchmark/benchmark_rocrand_kernel --dis all --engine all --trials 5
- $SUDO_CMD ./test/crush_test_rocrand --help # Just check if works
test:rocm_python:
extends: .rocm
stage: test
dependencies:
- build:rocm
before_script:
- $SUDO_CMD apt-get update -qq
- $SUDO_CMD apt-get install -y -qq python python-pip python-numpy
- $SUDO_CMD apt-get install -y -qq python3 python3-pip python3-numpy
script:
- export ROCRAND_PATH=$CI_PROJECT_DIR/build/library/
# rocRAND Wrapper
- cd $CI_PROJECT_DIR/python/rocrand
- $SUDO_CMD python setup.py test
- $SUDO_CMD python3 setup.py test
- pip install .
- $SUDO_CMD python tests/rocrand_test.py
- pip uninstall --yes rocrand
- pip3 install .
- $SUDO_CMD python3 tests/rocrand_test.py
- pip3 uninstall --yes rocrand
# hipRAND Wrapper
- cd $CI_PROJECT_DIR/python/hiprand
- $SUDO_CMD python setup.py test
- $SUDO_CMD python3 setup.py test
- pip install .
- $SUDO_CMD python tests/hiprand_test.py
- pip uninstall --yes hiprand
- pip3 install .
- $SUDO_CMD python3 tests/hiprand_test.py
- pip3 uninstall --yes hiprand
test:rocm_package:
extends: .rocm
stage: test
dependencies:
- build:rocm
script:
- cd build
- $SUDO_CMD dpkg -i rocrand-*.deb
- mkdir ../build_package_test && cd ../build_package_test
- cmake ../test/package/.
- make VERBOSE=1
- $SUDO_CMD ctest --output-on-failure
- ldd ./test_hiprand
- $SUDO_CMD dpkg -r rocrand
# test:rocm_install:
# extends: .rocm
# stage: test
# script:
# - mkdir build_only_install
# - cd build_only_install
# - CXX=hcc cmake -DBUILD_TEST=OFF ../.
# - make -j16
# - $SUDO_CMD make install
# - mkdir ../install_test && cd ../install_test
# - cmake ../test/package/.
# - make VERBOSE=1
# - $SUDO_CMD ctest --output-on-failure
# - ldd ./test_hiprand
# NVCC
.nvcc:
tags:
- nvcc
image: nvidia/cuda:10.1-devel-ubuntu16.04
before_script:
- nvidia-smi
# HIP-nvcc
- $SUDO_CMD apt-get update -qq
- $SUDO_CMD apt-get install -y -qq ca-certificates git wget tar xz-utils bzip2 build-essential pkg-config g++ gfortran
- wget -qO - http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | $SUDO_CMD apt-key add -
- echo 'deb [arch=amd64] http://repo.radeon.com/rocm/apt/debian/ xenial main' | $SUDO_CMD tee /etc/apt/sources.list.d/rocm.list
- $SUDO_CMD apt-get update -qq
- $SUDO_CMD apt-get install -y hip_base
# Install hip_nvcc ignoring dependencies because it depends on cuda metapackage
# (with heavy libraries, tools etc. that also require GUI and other packages)
- apt-get download hip_nvcc
- $SUDO_CMD dpkg -i --ignore-depends=cuda hip*.deb
- export PATH=$PATH:/opt/rocm/bin
- hipconfig
# cmake
- mkdir -p $DEPS_DIR/cmake
- wget --no-check-certificate --quiet -O - $CMAKE_URL | tar --strip-components=1 -xz -C $DEPS_DIR/cmake
- export PATH=$DEPS_DIR/cmake/bin:$PATH
# Combine global build options with local options
- export CXXFLAGS=$CXXFLAGS" "$LOCAL_CXXFLAGS
- export CMAKE_OPTIONS=$CXXFLAGS" "$LOCAL_CMAKE_OPTIONS
build:nvcc:
extends: .nvcc
stage: build
script:
- mkdir build
- cd build
- cmake -DBUILD_BENCHMARK=ON -DBUILD_FORTRAN_WRAPPER=ON -DBUILD_CRUSH_TEST=ON -DDEPENDENCIES_FORCE_DOWNLOAD=ON ../.
- make -j16
- make package
artifacts:
paths:
- build/library/
- build/test/crush_test_*
- build/test/test_*
- build/test/stat_test_*
- build/test/CTestTestfile.cmake
- build/benchmark/benchmark_*
- build/gtest/
- build/testu01/
- build/CMakeCache.txt
- build/CTestTestfile.cmake
- build/*.deb
- build/*.zip
expire_in: 2 weeks
test:nvcc_titanv:
extends: .nvcc
stage: test
dependencies:
- build:nvcc
script:
- export CUDA_VISIBLE_DEVICES=0
- cd build
- $SUDO_CMD ctest --output-on-failure
- $SUDO_CMD ./benchmark/benchmark_rocrand_generate --dis all --engine all --trials 5
- $SUDO_CMD ./benchmark/benchmark_rocrand_kernel --dis all --engine all --trials 5
- $SUDO_CMD ./benchmark/benchmark_curand_generate --dis all --engine all --trials 5
- $SUDO_CMD ./benchmark/benchmark_curand_kernel --dis all --engine all --trials 5
- $SUDO_CMD ./test/crush_test_rocrand --help # Just check if works
test:nvcc_980:
extends: .nvcc
stage: test
dependencies:
- build:nvcc
script:
- export CUDA_VISIBLE_DEVICES=1
- cd build
- $SUDO_CMD ctest --output-on-failure
- $SUDO_CMD ./benchmark/benchmark_rocrand_generate --dis all --engine all --trials 5
- $SUDO_CMD ./benchmark/benchmark_rocrand_kernel --dis all --engine all --trials 5
- $SUDO_CMD ./benchmark/benchmark_curand_generate --dis all --engine all --trials 5
- $SUDO_CMD ./benchmark/benchmark_curand_kernel --dis all --engine all --trials 5
- $SUDO_CMD ./test/crush_test_rocrand --help # Just check if works
test:nvcc_python:
extends: .nvcc
stage: test
dependencies:
- build:nvcc
before_script:
- $SUDO_CMD apt-get update -qq
- $SUDO_CMD apt-get install -y -qq python python-pip python-numpy
- $SUDO_CMD apt-get install -y -qq python3 python3-pip python3-numpy
script:
- export ROCRAND_PATH=$CI_PROJECT_DIR/build/library/
# rocRAND Wrapper
- cd $CI_PROJECT_DIR/python/rocrand
- $SUDO_CMD python setup.py test
- $SUDO_CMD python3 setup.py test
- pip install .
- $SUDO_CMD python tests/rocrand_test.py
- pip uninstall --yes rocrand
- pip3 install .
- $SUDO_CMD python3 tests/rocrand_test.py
- pip3 uninstall --yes rocrand
# hipRAND Wrapper
- cd $CI_PROJECT_DIR/python/hiprand
- $SUDO_CMD python setup.py test
- $SUDO_CMD python3 setup.py test
- pip install .
- $SUDO_CMD python tests/hiprand_test.py
- pip uninstall --yes hiprand
- pip3 install .
- $SUDO_CMD python3 tests/hiprand_test.py
- pip3 uninstall --yes hiprand
test:nvcc_package:
extends: .nvcc
stage: test
dependencies:
- build:nvcc
script:
- cd build
- $SUDO_CMD dpkg -i rocrand-*.deb
- mkdir ../build_package_test && cd ../build_package_test
- cmake ../test/package/.
- make VERBOSE=1
- $SUDO_CMD ctest --output-on-failure
- ldd ./test_hiprand
- $SUDO_CMD dpkg -r rocrand
# test:nvcc_install:
# extends: .nvcc
# stage: test
# script:
# - mkdir build_only_install
# - cd build_only_install
# - cmake -DBUILD_TEST=OFF ../.
# - make -j16
# - $SUDO_CMD make install
# - mkdir ../install_test && cd ../install_test
# - cmake ../test/package/.
# - make VERBOSE=1
# - $SUDO_CMD ctest --output-on-failure
# - ldd ./test_hiprand