forked from ROCm/rocPRIM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
368 lines (349 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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
# MIT License
#
# Copyright (c) 2017-2021 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.
image: rocm/rocm-terminal:latest
stages:
- build:cmake_latest # Tests if builds succeed (CMake)
- build:cmake_minimum # Tests if builds succeed (CMake)
- test # Tests if unit tests are passing (CTest)
- benchmark
variables:
# Tested CMake versions
CMAKE_MINIMUM_VERSION: 3.10.2
CMAKE_LATEST_VERSION: 3.17.0
# Cluster config
# Image-specific helper
SUDO_CMD: "sudo -E" # Must be "sudo" on images which don't use root user
# Helper variables
DEPS_DIR: $CI_PROJECT_DIR/deps
BUILD_DIR: $CI_PROJECT_DIR/build
CMAKE_MINIMUM_URL: "https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz"
CMAKE_MINIMUM_PATH: "$CI_PROJECT_DIR/deps/cmake-3.10.2"
CMAKE_LATEST_URL: "https://cmake.org/files/v3.17/cmake-3.17.0-Linux-x86_64.tar.gz"
CMAKE_LATEST_PATH: "$CI_PROJECT_DIR/deps/cmake-3.17.0"
BUILD_MINIMUM_DIR: $CI_PROJECT_DIR/build/cmake-3.10.2
BUILD_LATEST_DIR: $CI_PROJECT_DIR/build/cmake-3.17.0
PACKAGE_DIR: $CI_PROJECT_DIR/build/package
.deps:cmake-minimum:
stage: build:cmake_minimum
before_script:
- $SUDO_CMD apt update -qq
# | Used in the script | Build tools | Fetch from https:// | rocminfo calls lsmod
- $SUDO_CMD apt install -y -qq libidn11 wget tar xz-utils bzip2 libnuma-dev libunwind-dev git build-essential pkg-config ninja-build ca-certificates kmod
# Fetch CMake only if the cache has not been restored
- if [ ! -d $CMAKE_MINIMUM_PATH ]; then mkdir -p $CMAKE_MINIMUM_PATH; wget --no-check-certificate --quiet -O - $CMAKE_MINIMUM_URL | tar --strip-components=1 -xz -C $CMAKE_MINIMUM_PATH
- fi
- export PATH=$CMAKE_MINIMUM_PATH/bin:$PATH
# Debug printing of environment for context when errors occur
- hipconfig
cache:
key: $CMAKE_MINIMUM_VERSION
paths:
- $CMAKE_MINIMUM_PATH
.deps:cmake-latest:
stage: build:cmake_latest
before_script:
- $SUDO_CMD apt update -qq
# | Used in the script | Build tools | Fetch from https:// | rocminfo calls lsmod
- $SUDO_CMD apt install -y -qq wget tar xz-utils bzip2 libnuma-dev libunwind-dev git build-essential pkg-config ninja-build ca-certificates kmod
# Fetch CMake only if the cache has not been restored
- if [ ! -d $CMAKE_LATEST_PATH ]; then mkdir -p $CMAKE_LATEST_PATH; wget --no-check-certificate --quiet -O - $CMAKE_LATEST_URL | tar --strip-components=1 -xz -C $CMAKE_LATEST_PATH;
- fi;
- export PATH=$CMAKE_LATEST_PATH/bin:$PATH
# Debug printing of environment for context when errors occur
- hipconfig
cache:
key: $CMAKE_LATEST_VERSION
paths:
- $CMAKE_LATEST_PATH
.deps-cpu:cmake-latest:
stage: build:cmake_latest
before_script:
- $SUDO_CMD apt update -qq
- $SUDO_CMD apt install -y -qq apt-transport-https software-properties-common
- $SUDO_CMD add-apt-repository ppa:ubuntu-toolchain-r/test
# | Used in the script | Build tools | Fetch from https:// | rocminfo calls lsmod
- $SUDO_CMD apt install -y -qq wget tar xz-utils bzip2 libnuma-dev libunwind-dev git build-essential pkg-config ninja-build ca-certificates kmod g++-9
# Fetch CMake only if the cache has not been restored
- if [ ! -d $CMAKE_LATEST_PATH ]; then mkdir -p $CMAKE_LATEST_PATH; wget --no-check-certificate --quiet -O - $CMAKE_LATEST_URL | tar --strip-components=1 -xz -C $CMAKE_LATEST_PATH;
- fi;
- export PATH=$CMAKE_LATEST_PATH/bin:$PATH
# Debug printing of environment for context when errors occur
- hipconfig
cache:
key: $CMAKE_LATEST_VERSION
paths:
- $CMAKE_LATEST_PATH
.deps:doc:
stage: test:doc
before_script:
- $SUDO_CMD apt update -qq
- $SUDO_CMD apt install -y -qq doxygen
build:cmake-latest:
extends:
- .deps:cmake-latest
tags:
- rocm
script:
- mkdir -p $BUILD_LATEST_DIR
- cd $BUILD_LATEST_DIR
- cmake
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_CXX_FLAGS="-Wall -Wextra -Werror"
-D CMAKE_BUILD_TYPE=Release
-D BUILD_TEST=ON
-D BUILD_EXAMPLE=ON
-D BUILD_BENCHMARK=OFF
-S $CI_PROJECT_DIR
-B $BUILD_LATEST_DIR
- cmake
--build $BUILD_LATEST_DIR
artifacts:
paths:
- $BUILD_LATEST_DIR/test/test_*
- $BUILD_LATEST_DIR/test/rocprim/test_*
- $BUILD_LATEST_DIR/test/CTestTestfile.cmake
- $BUILD_LATEST_DIR/test/rocprim/CTestTestfile.cmake
- $BUILD_LATEST_DIR/gtest/
- $BUILD_LATEST_DIR/CMakeCache.txt
- $BUILD_LATEST_DIR/CTestTestfile.cmake
expire_in: 2 weeks
# TODO: Enable the hip-cpu CI step
#build-cpu:cmake-latest:
# extends:
# - .deps-cpu:cmake-latest
# tags:
# - s9300
# - rocm
# script:
# - mkdir -p $BUILD_LATEST_DIR
# - cd $BUILD_LATEST_DIR
# - cmake
# -G Ninja
# -D CMAKE_CXX_COMPILER=g++-9
# -D CMAKE_CXX_FLAGS="-Wall -Wextra"
# -D CMAKE_BUILD_TYPE=Release
# -D BUILD_TEST=ON
# -D BUILD_EXAMPLE=OFF
# -D BUILD_BENCHMARK=OFF
# -D USE_HIP_CPU=ON
# -S $CI_PROJECT_DIR
# -B $BUILD_LATEST_DIR
# - cmake
# --build $BUILD_LATEST_DIR
# --parallel 3
build:cmake-minimum:
extends:
- .deps:cmake-minimum
tags:
- rocm
needs:
- job: build:cmake-latest
artifacts: false
script:
- mkdir -p $BUILD_MINIMUM_DIR
- cd $BUILD_MINIMUM_DIR
- cmake
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_CXX_FLAGS="-Wall -Wextra -Werror"
-D CMAKE_BUILD_TYPE=Release
-D BUILD_TEST=ON
-D BUILD_EXAMPLE=ON
-D BUILD_BENCHMARK=ON
-D DISABLE_WERROR=OFF
-D AMDGPU_TEST_TARGETS="gfx803;gfx900:xnack-;gfx906:xnack-"
-B $BUILD_MINIMUM_DIR
../../.
- cmake
--build ./
artifacts:
paths:
- $BUILD_MINIMUM_DIR/test/test_*
- $BUILD_MINIMUM_DIR/test/rocprim/test_*
- $BUILD_MINIMUM_DIR/test/CTestTestfile.cmake
- $BUILD_MINIMUM_DIR/test/rocprim/CTestTestfile.cmake
- $BUILD_MINIMUM_DIR/gtest/
- $BUILD_MINIMUM_DIR/CMakeCache.txt
- $BUILD_MINIMUM_DIR/CTestTestfile.cmake
expire_in: 2 weeks
build:package:
extends:
- .deps:cmake-minimum
tags:
- rocm
script:
- mkdir -p $PACKAGE_DIR
- cd $PACKAGE_DIR
- cmake
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_BUILD_TYPE=Release
-B $PACKAGE_DIR
$CI_PROJECT_DIR
- $SUDO_CMD cmake
--build $PACKAGE_DIR
--target install
- $SUDO_CMD cpack
-G "DEB;ZIP"
- mkdir -p ../package_test && cd ../package_test
- cmake
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_BUILD_TYPE=Release
$CI_PROJECT_DIR/test/extra
- cmake
--build .
- $SUDO_CMD ./test_rocprim_package
- $SUDO_CMD ctest --output-on-failure --repeat-until-fail 2
artifacts:
paths:
- $PACKAGE_DIR/rocprim*.deb
- $PACKAGE_DIR/rocprim*.zip
expire_in: 2 weeks
build:benchmark:
extends:
- .deps:cmake-latest
tags:
- mi25
- rocm
only:
- ci-benchmark-extend
- internal_benchmark
- develop_stream
- develop
- master
script:
- mkdir build
- cd build
# Build hipCUB benchmark
- cmake
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_BUILD_TYPE=Release
-D BUILD_TEST=OFF
-D BUILD_EXAMPLE=OFF
-D BUILD_BENCHMARK=ON
-D DISABLE_WERROR=OFF
-D AMDGPU_TARGETS="gfx803;gfx900:xnack-;gfx906:xnack-"
..
- cmake
--build .
artifacts:
paths:
- build/benchmark/*
- build/googlebenchmark/
expire_in: 2 weeks
include: '.gitlab-ci-gputest.yml'
benchmark_view:rocm_mi25:
extends:
- .deps:cmake-latest
stage: benchmark
when: manual
only:
- ci-benchmark-extend
- internal_benchmark
- develop_stream
- develop
- master
needs:
- build:benchmark
tags:
- mi25
- rocm
script:
- $SUDO_CMD cmake
-D BENCHMARK_BINARY_DIR=build/benchmark
-D BENCHMARK_OUTPUT_DIR=.
-P ${CI_PROJECT_DIR}/.gitlab/RunBenchmarks.cmake
benchmark_view:rocm_s9300:
extends:
- .deps:cmake-latest
stage: benchmark
when: manual
only:
- ci-benchmark-extend
- internal_benchmark
- develop_stream
- develop
- master
needs:
- build:benchmark
tags:
- s9300
- rocm
script:
- $SUDO_CMD cmake
-D BENCHMARK_BINARY_DIR=build/benchmark
-D BENCHMARK_OUTPUT_DIR=.
-P ${CI_PROJECT_DIR}/.gitlab/RunBenchmarks.cmake
benchmark_view:rocm_vega20:
extends:
- .deps:cmake-latest
stage: benchmark
when: manual
only:
- ci-benchmark-extend
- internal_benchmark
- develop_stream
- develop
- master
needs:
- build:benchmark
tags:
- vega20
- rocm
script:
- $SUDO_CMD cmake
-D BENCHMARK_BINARY_DIR=build/benchmark
-D BENCHMARK_OUTPUT_DIR=.
-P ${CI_PROJECT_DIR}/.gitlab/RunBenchmarks.cmake
test:deb:
stage: test
needs:
- build:package
tags:
- rocm
extends:
- .deps:cmake-minimum
script:
- $SUDO_CMD dpkg -i $PACKAGE_DIR/rocprim*.deb
- mkdir -p package_test && cd package_test
- cmake
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_BUILD_TYPE=Release
$CI_PROJECT_DIR/test/extra
- cmake
--build .
- $SUDO_CMD ctest --output-on-failure --repeat-until-fail 2
- $SUDO_CMD dpkg -r rocprim
test:doc:
stage: test
needs: []
before_script:
- $SUDO_CMD rm /etc/apt/sources.list.d/rocm.list
- $SUDO_CMD apt-get update -qq
- $SUDO_CMD apt-get install -y -qq doxygen
script:
- cd doc
- $SUDO_CMD doxygen Doxyfile