Repository navigation
413 lines (380 loc) · 20 KB
/
Copy pathci.cpu.yml
File metadata and controls
413 lines (380 loc) · 20 KB
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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
name: CI (CPU)
on:
push:
branches:
- main
- "pull-request/[0-9]+"
concurrency:
group: ${{ github.workflow }}-on-${{ github.event_name }}-from-${{ github.ref_name }}
cancel-in-progress: true
jobs:
build-cpu:
runs-on: ubuntu-latest
name: ${{ matrix.name }}
continue-on-error: ${{ matrix.allow_failure || false }}
strategy:
fail-fast: false
matrix:
include:
- { name: "CPU (clang 16, Debug)", build: "Debug", tag: llvm16-cuda12.9, cxxstd: "20", cxxflags: "-stdlib=libc++" }
- { name: "CPU (clang 16, Debug, c++23)", build: "Debug", tag: llvm16-cuda12.9, cxxstd: "23", cxxflags: "-stdlib=libc++" }
- { name: "CPU (clang 16, Debug, TSAN)", build: "Debug", tag: llvm16-cuda12.9, cxxstd: "20", cxxflags: "-fsanitize=thread" }
- { name: "CPU (clang 16, Release)", build: "Release", tag: llvm16-cuda12.9, cxxstd: "20", cxxflags: "-stdlib=libc++" }
- { name: "CPU (clang 16, Release, ASAN)", build: "Release", tag: llvm16-cuda12.9, cxxstd: "20", cxxflags: "-stdlib=libc++ -fsanitize=address -fsanitize-ignorelist=/home/coder/stdexec/sanitizer-ignorelist.txt" }
- { name: "CPU (clang 22, Debug)", build: "Debug", tag: llvm22-cuda13.2, cxxstd: "23", cxxflags: "-stdlib=libc++" }
# Clang built from source at a pinned llvm-project commit, for the
# modular build only. Pinned to the merge of llvm/llvm-project#224528,
# which fixes the nondeterministic Clang 23.1.0 ICE
# (llvm/llvm-project#191361) seen in the modular build. The toolchain
# is cached by commit, so only bumping llvm_sha (or the image tag)
# triggers a rebuild. This is the only modules row: move it to a
# released Clang's image once one contains the fix.
- { name: "CPU (clang trunk, Debug, modules)", build: "Debug", tag: llvm22-cuda13.2, cxxstd: "23", cxxflags: "-stdlib=libc++", llvm_sha: f970f59a9d4e6b8738547d01bc33e8a12df5244b }
- { name: "CPU (clang 22, Release)", build: "Release", tag: llvm22-cuda13.2, cxxstd: "23", cxxflags: "-stdlib=libc++" }
- { name: "CPU (clang 22, Release, noexcept)", build: "Release", tag: llvm22-cuda13.2, cxxstd: "23", cxxflags: "-stdlib=libc++ -fno-exceptions" }
- { name: "CPU (gcc 12, Debug)", build: "Debug", tag: gcc12-cuda12.9, cxxstd: "20", cxxflags: "", }
- { name: "CPU (gcc 12, Release)", build: "Release", tag: gcc12-cuda12.9, cxxstd: "20", cxxflags: "", }
# With the following config, 2 tests mysteriously time out, but only in CI and not locally.
# - { name: "CPU (gcc 12, Release, ASAN)", build: "Release", tag: gcc12-cuda12.9, cxxstd: "20", cxxflags: "-fsanitize=address" }
- { name: "CPU (gcc 12, Release, TSAN)", build: "Release", tag: gcc12-cuda12.9, cxxstd: "20", cxxflags: "-fsanitize=thread" }
- { name: "CPU (gcc 13, Debug)", build: "Debug", tag: gcc13-cuda12.9, cxxstd: "20", cxxflags: "", }
- { name: "CPU (gcc 14, Debug)", build: "Debug", tag: gcc14-cuda12.9, cxxstd: "20", cxxflags: "", }
- { name: "CPU (gcc 14, Debug, 32-bit)", build: "Debug", tag: gcc14-cuda12.9, cxxstd: "20", cxxflags: "-m32 -D_GLIBCXX_USE_TBB_PAR_BACKEND=0", arch: 32 }
- { name: "CPU (gcc 14, Debug, ASAN)", build: "Debug", tag: gcc14-cuda12.9, cxxstd: "20", cxxflags: "-fsanitize=address" }
- { name: "CPU (gcc 14, Debug, TSAN)", build: "Debug", tag: gcc14-cuda12.9, cxxstd: "20", cxxflags: "-fsanitize=thread" }
- { name: "CPU (gcc 14, Release, ASAN)", build: "Release", tag: gcc14-cuda12.9, cxxstd: "20", cxxflags: "-fsanitize=address" }
- { name: "CPU (gcc 14, Release, LEAK)", build: "Release", tag: gcc14-cuda12.9, cxxstd: "20", cxxflags: "-fsanitize=leak", }
- { name: "CPU (gcc 14, Release, c++23)", build: "Release", tag: gcc14-cuda12.9, cxxstd: "23", cxxflags: "", }
- { name: "CPU (gcc 15, Release, c++23)", build: "Release", tag: gcc15-cuda12.9, cxxstd: "23", cxxflags: "", }
- { name: "CPU (gcc 15, Release, c++23,noexcept)", build: "Release", tag: gcc15-cuda12.9, cxxstd: "23", cxxflags: "-fno-exceptions", }
container:
options: -u root
image: rapidsai/devcontainers:26.08-cpp-${{ matrix.tag }}
permissions:
id-token: write # This is required for configure-aws-credentials
contents: read # This is required for actions/checkout
defaults:
run:
shell: su coder {0}
working-directory: /home/coder
steps:
- name: Checkout stdexec
uses: actions/checkout@v4
with:
path: stdexec
persist-credentials: false
- name: Setup environment
run: |
echo "ARTIFACT_PREFIX=${{runner.os}}-${{matrix.tag}}-amd64" >> "${GITHUB_ENV}"
echo "ARTIFACT_SUFFIX=${{github.run_id}}-${{github.run_attempt}}-$RANDOM" >> "${GITHUB_ENV}"
- if: ${{ matrix.llvm_sha }}
name: Restore cached Clang (llvm-project@${{ matrix.llvm_sha }})
id: llvm-cache
uses: actions/cache/restore@v4
with:
path: /home/coder/llvm-${{ matrix.llvm_sha }}
# The toolchain is built with the image's compiler and against its
# glibc, so the image tag is part of the key. Bump the trailing
# version to force a rebuild after changing the build recipe below.
key: llvm-${{ matrix.llvm_sha }}-${{ matrix.tag }}-v1
- if: ${{ matrix.llvm_sha && steps.llvm-cache.outputs.cache-hit != 'true' }}
name: Build Clang from source (llvm-project@${{ matrix.llvm_sha }})
run: |
set -e;
source /etc/profile
set -x;
# Keep this build independent of the job's sccache setup.
unset CMAKE_C_COMPILER_LAUNCHER CMAKE_CXX_COMPILER_LAUNCHER;
# The image sets PYTHONSAFEPATH=1, which stops Python from putting a
# script's own directory on sys.path. libc++'s build scripts (e.g.
# utils/generate_iwyu_mapping.py) import their sibling `libcxx`
# package that way.
unset PYTHONSAFEPATH;
# LLVM's CMake needs Python 3.
command -v python3 >/dev/null || {
sudo apt-get update;
sudo apt-get install -y --no-install-recommends python3;
};
# Fetch only the pinned commit, and only the subtrees this build uses.
src=/tmp/llvm-project;
git init -q "${src}";
git -C "${src}" sparse-checkout set \
llvm clang cmake third-party runtimes libcxx libcxxabi libunwind libc;
git -C "${src}" fetch -q --depth 1 --filter=blob:none \
https://github.com/llvm/llvm-project.git ${{ matrix.llvm_sha }};
git -C "${src}" checkout -q FETCH_HEAD;
# Linking Clang with ld.bfd on a 4-core/16GB runner is slow and
# memory-hungry; use lld when the host compiler can find it.
link_flags="-DLLVM_PARALLEL_LINK_JOBS=1";
if echo 'int main(){}' | clang++ -x c++ -fuse-ld=lld - -o /dev/null 2>/dev/null; then
link_flags="-DLLVM_USE_LINKER=lld -DLLVM_PARALLEL_LINK_JOBS=2";
# LLVM_USE_LINKER is forwarded to the runtimes, which are built
# with the new Clang. That Clang looks for ld.lld in its own bin/
# and on PATH, but the image's ld.lld is only next to the image's
# clang (/usr/lib/llvm-22/bin), so put that one on PATH too.
mkdir -p /tmp/lld-bin;
ln -sf "$(clang++ -print-prog-name=ld.lld)" /tmp/lld-bin/ld.lld;
export PATH="/tmp/lld-bin:${PATH}";
fi
# Release, no assertions: the compiler users would actually get.
# The install is limited to what the modular build needs: the driver,
# its resource headers, clang-scan-deps (for CMake's module
# dependency scanning), and libc++/libc++abi/libunwind, including
# libc++'s std module sources and libc++.modules.json.
cmake -S "${src}/llvm" -B /tmp/llvm-build -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_INSTALL_PREFIX=/home/coder/llvm-${{ matrix.llvm_sha }} \
-DLLVM_ENABLE_PROJECTS=clang \
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DLLVM_INCLUDE_DOCS=OFF \
-DCLANG_INCLUDE_TESTS=OFF \
-DCLANG_INCLUDE_DOCS=OFF \
-DLLVM_DISTRIBUTION_COMPONENTS="clang;clang-resource-headers;clang-scan-deps;runtimes" \
${link_flags} \
;
cmake --build /tmp/llvm-build --target install-distribution-stripped;
# Free the disk space for the stdexec build.
rm -rf /tmp/llvm-build /tmp/lld-bin "${src}";
- if: ${{ matrix.llvm_sha && steps.llvm-cache.outputs.cache-hit != 'true' }}
name: Save cached Clang (llvm-project@${{ matrix.llvm_sha }})
# Saved explicitly, rather than via actions/cache's post-job hook, so
# the toolchain is cached even when the stdexec build or tests fail.
uses: actions/cache/save@v4
with:
path: /home/coder/llvm-${{ matrix.llvm_sha }}
key: ${{ steps.llvm-cache.outputs.cache-primary-key }}
- if: ${{ matrix.llvm_sha }}
name: Use Clang from llvm-project@${{ matrix.llvm_sha }}
run: |
set -ex;
prefix=/home/coder/llvm-${{ matrix.llvm_sha }};
# The runtimes may be installed in a per-target subdirectory of lib/
# (e.g. lib/x86_64-unknown-linux-gnu), so locate them rather than
# hardcoding the layout.
modules_json="$(find "${prefix}/lib" -name libc++.modules.json -print -quit)";
libcxx_so="$(find "${prefix}/lib" -name 'libc++.so.1' -print -quit)";
test -f "${modules_json}";
test -f "${libcxx_so}";
libdir="$(dirname "${libcxx_so}")";
"${prefix}/bin/clang++" --version;
"${prefix}/bin/clang-scan-deps" --version;
{
echo "LLVM_FROM_SOURCE_PREFIX=${prefix}";
echo "LLVM_FROM_SOURCE_LIBDIR=${libdir}";
echo "LLVM_FROM_SOURCE_MODULES_JSON=${modules_json}";
} >> "${GITHUB_ENV}";
- if: github.repository_owner == 'NVIDIA'
name: Get AWS credentials for sccache bucket
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-2
role-duration-seconds: 28800 # 8 hours
role-to-assume: arn:aws:iam::279114543810:role/gha-oidc-NVIDIA
# gcc-multilib provides /usr/include/asm for -m32; g++-14-multilib only
# recommends it.
- if: ${{ matrix.arch == 32 }}
name: Install the 32-bit toolchain
shell: bash
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends g++-14-multilib gcc-multilib
- name: Build and test CPU schedulers
env:
ASAN_OPTIONS: alloc_dealloc_mismatch=0
NVCC_APPEND_FLAGS: "-t=100"
SCCACHE_BUCKET: "rapids-sccache-devs"
SCCACHE_DIST_REQUEST_TIMEOUT: "7140"
SCCACHE_DIST_URL: "https://amd64.linux.sccache.rapids.nvidia.com"
SCCACHE_IDLE_TIMEOUT: "0"
SCCACHE_NO_DIST_COMPILE: ${{ contains(matrix.name, 'modules') && '1' || '' }}
SCCACHE_REGION: "us-east-2"
SCCACHE_S3_KEY_PREFIX: "nvidia-stdexec-dev"
SCCACHE_S3_PREPROCESSOR_CACHE_KEY_PREFIX: "nvidia-stdexec-dev/preprocessor"
SCCACHE_S3_USE_PREPROCESSOR_CACHE_MODE: "true"
SCCACHE_SERVER_LOG: "sccache=debug"
SCCACHE_SERVER_PORT: "4225"
run: |
set -e;
source /etc/profile
set -x;
devcontainer-utils-install-sccache --version rapids;
devcontainer-utils-init-sccache-dist \
--enable-sccache-dist - <<< " \
--auth-type 'token' \
--auth-token '$( \
curl -fsSL -H "Authorization: Bearer $( \
curl -fsSL -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
"${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=token.rapids.nvidia.com" \
| jq -r '.value' \
)" https://token.rapids.nvidia.com/gh/token/exchange \
| jq -r '.token')' \
";
# Copy source folder into ~/stdexec
cp -r "${GITHUB_WORKSPACE}"/stdexec ~/;
chown -R coder:coder ~/stdexec;
cd ~/stdexec;
# Configure
cmake -S . -B build -GNinja \
-DCMAKE_BUILD_TYPE=${{ matrix.build }} \
-DCMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" \
-DSTDEXEC_ENABLE_TBB:BOOL=${{ !contains(matrix.cxxflags, '-fsanitize') && !contains(matrix.name, 'modules') && matrix.arch != 32 }} \
-DSTDEXEC_ENABLE_TASKFLOW:BOOL=${{ matrix.name == 'CPU (clang 22, Debug)' }} \
-DSTDEXEC_ENABLE_ASIO:BOOL=TRUE \
-DSTDEXEC_ASIO_IMPLEMENTATION:STRING=boost \
-DCMAKE_CXX_STANDARD:STRING=${{ matrix.cxxstd }} \
-DCMAKE_CXX_EXTENSIONS:BOOL=OFF \
-DSTDEXEC_BUILD_TESTS:BOOL=ON \
-DSTDEXEC_BUILD_EXAMPLES:BOOL=${{ !contains(matrix.name, 'modules') }} \
-DSTDEXEC_BUILD_MODULES:BOOL=${{ contains(matrix.name, 'modules') }} \
${LLVM_FROM_SOURCE_PREFIX:+"-DCMAKE_CXX_COMPILER=${LLVM_FROM_SOURCE_PREFIX}/bin/clang++"} \
${LLVM_FROM_SOURCE_LIBDIR:+"-DCMAKE_BUILD_RPATH=${LLVM_FROM_SOURCE_LIBDIR}"} \
-DCMAKE_CXX_STDLIB_MODULES_JSON="${LLVM_FROM_SOURCE_MODULES_JSON:-/usr/lib/llvm-22/lib/libc++.modules.json}" \
;
# Compile
# Run a serial build if we're building the modular build because it tends
# to result in fewer Clang ICEs.
cmake --build build -v -j ${{ contains(matrix.name, 'modules') && 1 || 512 }};
# Verify that public headers are self-contained. This alone doesn't
# depend on the rest of the build matrix, but the SKIP_LINTING
# exclusions in CMakeLists.txt for optional-dependency and
# platform-specific headers do: run it only here and it would
# silently never compile exec/taskflow/taskflow_thread_pool.hpp,
# exec/windows/filetime_clock.hpp, or exec/windows/windows_thread_pool.hpp
# anywhere in CI, defeating the point of checking them at all. So:
# Taskflow is force-enabled above just for this one job (verified
# locally that STDEXEC_ENABLE_TASKFLOW builds clean via CPM, same as
# the existing Boost/ASIO fetch), which covers the TBB and Taskflow
# exclusions between them; the Windows-only headers are covered
# separately by the equivalent step added to test-windows.ps1, which
# runs on an actual Windows job where WIN32 is true.
if [ "${{ matrix.name }}" = "CPU (clang 22, Debug)" ]; then
cmake --build build -v --target all_verify_interface_header_sets;
fi
# Print sccache stats
sccache -s;
# Tests
SCCACHE_NO_CACHE=1 SCCACHE_NO_DIST_COMPILE=1 \
ctest --test-dir build --verbose --output-on-failure --timeout 60;
- if: ${{ !cancelled() }}
name: Upload sccache logs
uses: actions/upload-artifact@v4
with:
name: sccache-client-logs-${{env.ARTIFACT_PREFIX}}-${{env.ARTIFACT_SUFFIX}}
path: /tmp/sccache*.log
compression-level: 9
valgrind-run-loop:
runs-on: ubuntu-latest
name: CPU (gcc 14, Valgrind run_loop)
container:
options: -u root
image: rapidsai/devcontainers:26.08-cpp-gcc14-cuda12.9
steps:
- name: Checkout stdexec
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Valgrind
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends valgrind
- name: Build run_loop reproducer
run: |
cmake -S . -B build -GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DSTDEXEC_BUILD_TESTS=ON
cmake --build build --target test.run_loop_finish_repro -v
- name: Run run_loop reproducer under Valgrind
run: |
timeout 60s valgrind \
--fair-sched=no \
--error-exitcode=1 \
--quiet \
./build/test/test.run_loop_finish_repro
ci-cpu:
runs-on: ubuntu-latest
name: CI (CPU)
needs:
- build-cpu
- valgrind-run-loop
steps:
- run: echo "CI (CPU) success"
build-cpu-windows:
runs-on: windows-2022
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- { compiler: "cl", build: "Debug", name: "CPU (Windows) (msvc 14.43, Debug)", tag: cuda12.9-cl14.43 }
- { compiler: "cl", build: "Release", name: "CPU (Windows) (msvc 14.43, Release)", tag: cuda12.9-cl14.43 }
- { compiler: "cl", build: "Debug", name: "CPU (Windows) (msvc 14.50, Debug)", tag: cuda13.2-cl14.50 }
- { compiler: "cl", build: "Release", name: "CPU (Windows) (msvc 14.50, Release)", tag: cuda13.2-cl14.50 }
#- { compiler: "clang++", build: "Debug", name: "CPU (Windows) (clang, Debug)" }
#- { compiler: "clang++", build: "Release", name: "CPU (Windows) (clang, Release)" }
#- { compiler: "clang-cl", build: "Debug", name: "CPU (Windows) (clang-cl, Debug)" }
#- { compiler: "clang-cl", build: "Release", name: "CPU (Windows) (clang-cl, Release)" }
steps:
- name: Checkout stdexec (Windows)
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build and test CPU schedulers (Windows)
shell: pwsh
run: |
docker pull rapidsai/devcontainers:26.08-${{ matrix.tag }}-windows2022
docker run --isolation=process -v "$(pwd):C:/stdexec" rapidsai/devcontainers:26.08-${{ matrix.tag }}-windows2022 powershell C:/stdexec/.github/workflows/test-windows.ps1 -Compiler '${{ matrix.compiler }}' -Config '${{ matrix.build }}'
ci-cpu-windows:
runs-on: windows-latest
name: CI (CPU) (Windows)
needs:
- build-cpu-windows
steps:
- run: echo "CI (CPU) (Windows) success"
build-cpu-macos:
runs-on: macos-26-large
name: macos-${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- { compiler: "clang++", build: "Debug", name: "CPU (MacOS) (clang, Debug)" }
- { compiler: "clang++", build: "Release", name: "CPU (MacOS) (clang, Release)" }
steps:
- name: Checkout stdexec (MacOS)
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install dependencies
run: |
brew update
brew install ninja
shell: bash
- name: Build and test CPU schedulers (MacOS)
shell: bash
run: |
mkdir build
cmake -S. -Bbuild -GNinja \
-DCMAKE_BUILD_TYPE=${{ matrix.build }} \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \
-DSTDEXEC_ENABLE_ASIO:BOOL=TRUE \
-DSTDEXEC_ASIO_IMPLEMENTATION:STRING=boost \
-DCMAKE_CXX_STANDARD:STRING=20 \
-DSTDEXEC_BUILD_TESTS:BOOL=ON
cmake --build build/ -v
cd build
ctest --output-on-failure
ci-cpu-macos:
runs-on: macos-latest-large
name: CI (CPU) (MacOS)
needs:
- build-cpu-macos
steps:
- run: echo "CI (CPU) (MacOS) success"