Skip to content

Commit 1079b39

Browse files
committed
separate test matrix from build matrix and expand it (retry)
1 parent 243a46f commit 1079b39

File tree

3 files changed

+151
-109
lines changed

3 files changed

+151
-109
lines changed

.github/workflows/gh-build-and-test.yml renamed to .github/workflows/ci-build.yml

Lines changed: 1 addition & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313

1414
jobs:
1515
build:
16-
name: Build (${{ inputs.host-platform }}, Python "${{ inputs.python-version }}")
16+
name: Build (${{ inputs.host-platform }}, Python ${{ inputs.python-version }})
1717
if: ${{ github.repository_owner == 'nvidia' }}
1818
permissions:
1919
id-token: write # This is required for configure-aws-credentials
@@ -163,108 +163,3 @@ jobs:
163163
echo "CUDA_CORE_ARTIFACTS_DIR=${CUDA_CORE_ARTIFACTS_DIR}" >> $GITHUB_OUTPUT
164164
echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
165165
echo "CUDA_BINDINGS_ARTIFACTS_DIR=${CUDA_BINDINGS_ARTIFACTS_DIR}" >> $GITHUB_OUTPUT
166-
167-
test:
168-
# TODO: improve the name once a separate test matrix is defined
169-
name: Test (CUDA ${{ inputs.cuda-version }})
170-
# TODO: enable testing once win-64 GPU runners are up
171-
if: ${{ (github.repository_owner == 'nvidia') &&
172-
startsWith(inputs.host-platform, 'linux') }}
173-
permissions:
174-
id-token: write # This is required for configure-aws-credentials
175-
contents: read # This is required for actions/checkout
176-
runs-on: ${{ (inputs.host-platform == 'linux-x64' && 'linux-amd64-gpu-v100-latest-1') ||
177-
(inputs.host-platform == 'linux-aarch64' && 'linux-arm64-gpu-a100-latest-1') }}
178-
# Our self-hosted runners require a container
179-
# TODO: use a different (nvidia?) container
180-
container:
181-
options: -u root --security-opt seccomp=unconfined --shm-size 16g
182-
image: ubuntu:22.04
183-
env:
184-
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
185-
needs:
186-
- build
187-
steps:
188-
- name: Run nvidia-smi to make sure GPU is working
189-
shell: bash --noprofile --norc -xeuo pipefail {0}
190-
run: nvidia-smi
191-
192-
- name: Checkout ${{ github.event.repository.name }}
193-
uses: actions/checkout@v4
194-
with:
195-
fetch-depth: 0
196-
197-
- name: Set up test environment
198-
shell: bash --noprofile --norc -xeuo pipefail {0}
199-
run: |
200-
# make outputs from the previous job as env vars
201-
echo "CUDA_CORE_ARTIFACT_NAME=${{ needs.build.outputs.CUDA_CORE_ARTIFACT_NAME }}" >> $GITHUB_ENV
202-
echo "CUDA_CORE_ARTIFACTS_DIR=${{ needs.build.outputs.CUDA_CORE_ARTIFACTS_DIR }}" >> $GITHUB_ENV
203-
echo "CUDA_BINDINGS_ARTIFACT_NAME=${{ needs.build.outputs.CUDA_BINDINGS_ARTIFACT_NAME }}" >> $GITHUB_ENV
204-
echo "CUDA_BINDINGS_ARTIFACTS_DIR=${{ needs.build.outputs.CUDA_BINDINGS_ARTIFACTS_DIR }}" >> $GITHUB_ENV
205-
206-
- name: Download bindings build artifacts
207-
uses: actions/download-artifact@v4
208-
with:
209-
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
210-
path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
211-
212-
- name: Display structure of downloaded bindings artifacts
213-
shell: bash --noprofile --norc -xeuo pipefail {0}
214-
run: |
215-
pwd
216-
ls -lahR $CUDA_BINDINGS_ARTIFACTS_DIR
217-
218-
- name: Download core build artifacts
219-
uses: actions/download-artifact@v4
220-
with:
221-
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
222-
path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
223-
224-
- name: Display structure of downloaded core build artifacts
225-
shell: bash --noprofile --norc -xeuo pipefail {0}
226-
run: |
227-
pwd
228-
ls -lahR $CUDA_CORE_ARTIFACTS_DIR
229-
230-
- name: Set up Python ${{ inputs.python-version }}
231-
uses: actions/setup-python@v5
232-
with:
233-
python-version: ${{ inputs.python-version }}
234-
235-
# The cache action needs this
236-
- name: Install zstd
237-
shell: bash --noprofile --norc -xeuo pipefail {0}
238-
run: |
239-
apt update
240-
apt install zstd
241-
242-
- name: Set up mini CTK
243-
uses: ./.github/actions/fetch_ctk
244-
continue-on-error: false
245-
with:
246-
host-platform: ${{ inputs.host-platform }}
247-
cuda-version: ${{ inputs.cuda-version }}
248-
fail-on-ctk-cache-miss: true
249-
250-
- name: Run test / analysis
251-
shell: bash --noprofile --norc -xeuo pipefail {0}
252-
run: |
253-
ls $CUDA_PATH
254-
255-
REPO_DIR=$(pwd)
256-
257-
cd "${CUDA_BINDINGS_ARTIFACTS_DIR}"
258-
pip install *.whl
259-
260-
cd "${CUDA_CORE_ARTIFACTS_DIR}"
261-
pip install *.whl
262-
263-
cd "${REPO_DIR}/cuda_bindings"
264-
pip install -r requirements.txt
265-
pytest -rxXs tests/
266-
# TODO: enable cython tests
267-
#pytest tests/cython
268-
269-
cd "${REPO_DIR}/cuda_core"
270-
pytest -rxXs tests/

.github/workflows/ci-gh.yml

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- "main"
1212

1313
jobs:
14-
ci:
14+
build:
1515
strategy:
1616
fail-fast: false
1717
matrix:
@@ -30,9 +30,40 @@ jobs:
3030
# Note: this is for build-time only; the test-time matrix needs to be
3131
# defined separately.
3232
- "12.6.2"
33-
name: "CI"
33+
name: "CI-BUILD"
3434
uses:
35-
./.github/workflows/gh-build-and-test.yml
35+
./.github/workflows/ci-build.yml
36+
with:
37+
host-platform: ${{ matrix.host-platform }}
38+
python-version: ${{ matrix.python-version }}
39+
cuda-version: ${{ matrix.cuda-version }}
40+
secrets: inherit
41+
42+
test:
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
# TODO: align host-platform names with conda convention
47+
host-platform:
48+
- linux-x64
49+
- linux-aarch64
50+
- win-x64
51+
python-version:
52+
- "3.13"
53+
- "3.12"
54+
- "3.11"
55+
- "3.10"
56+
- "3.9"
57+
cuda-version:
58+
# Note: this is for test-time only.
59+
- "12.6.2"
60+
- "12.0.1"
61+
- "11.8.0"
62+
name: "CI-TEST"
63+
needs:
64+
- build
65+
uses:
66+
./.github/workflows/ci-test.yml
3667
with:
3768
host-platform: ${{ matrix.host-platform }}
3869
python-version: ${{ matrix.python-version }}

.github/workflows/ci-test.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
host-platform:
5+
type: string
6+
required: true
7+
python-version:
8+
type: string
9+
required: true
10+
cuda-version:
11+
type: string
12+
required: true
13+
14+
jobs:
15+
test:
16+
# TODO: improve the name once a separate test matrix is defined
17+
name: Test (${{ inputs.host-platform }}, CUDA ${{ inputs.cuda-version }}, Python ${{ inputs.python-version }})
18+
# TODO: enable testing once win-64 GPU runners are up
19+
if: ${{ (github.repository_owner == 'nvidia') &&
20+
startsWith(inputs.host-platform, 'linux') }}
21+
permissions:
22+
id-token: write # This is required for configure-aws-credentials
23+
contents: read # This is required for actions/checkout
24+
runs-on: ${{ (inputs.host-platform == 'linux-x64' && 'linux-amd64-gpu-v100-latest-1') ||
25+
(inputs.host-platform == 'linux-aarch64' && 'linux-arm64-gpu-a100-latest-1') }}
26+
# Our self-hosted runners require a container
27+
# TODO: use a different (nvidia?) container
28+
container:
29+
options: -u root --security-opt seccomp=unconfined --shm-size 16g
30+
image: ubuntu:22.04
31+
env:
32+
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
33+
steps:
34+
- name: Run nvidia-smi to make sure GPU is working
35+
shell: bash --noprofile --norc -xeuo pipefail {0}
36+
run: nvidia-smi
37+
38+
- name: Checkout ${{ github.event.repository.name }}
39+
uses: actions/checkout@v4
40+
with:
41+
fetch-depth: 0
42+
43+
- name: Set up test environment
44+
shell: bash --noprofile --norc -xeuo pipefail {0}
45+
run: |
46+
# make outputs from the previous job as env vars
47+
echo "CUDA_CORE_ARTIFACT_NAME=${{ needs.build.outputs.CUDA_CORE_ARTIFACT_NAME }}" >> $GITHUB_ENV
48+
echo "CUDA_CORE_ARTIFACTS_DIR=${{ needs.build.outputs.CUDA_CORE_ARTIFACTS_DIR }}" >> $GITHUB_ENV
49+
echo "CUDA_BINDINGS_ARTIFACT_NAME=${{ needs.build.outputs.CUDA_BINDINGS_ARTIFACT_NAME }}" >> $GITHUB_ENV
50+
echo "CUDA_BINDINGS_ARTIFACTS_DIR=${{ needs.build.outputs.CUDA_BINDINGS_ARTIFACTS_DIR }}" >> $GITHUB_ENV
51+
52+
- name: Download bindings build artifacts
53+
uses: actions/download-artifact@v4
54+
with:
55+
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
56+
path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
57+
58+
- name: Display structure of downloaded bindings artifacts
59+
shell: bash --noprofile --norc -xeuo pipefail {0}
60+
run: |
61+
pwd
62+
ls -lahR $CUDA_BINDINGS_ARTIFACTS_DIR
63+
64+
- name: Download core build artifacts
65+
uses: actions/download-artifact@v4
66+
with:
67+
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
68+
path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
69+
70+
- name: Display structure of downloaded core build artifacts
71+
shell: bash --noprofile --norc -xeuo pipefail {0}
72+
run: |
73+
pwd
74+
ls -lahR $CUDA_CORE_ARTIFACTS_DIR
75+
76+
- name: Set up Python ${{ inputs.python-version }}
77+
uses: actions/setup-python@v5
78+
with:
79+
python-version: ${{ inputs.python-version }}
80+
81+
# The cache action needs this
82+
- name: Install zstd
83+
shell: bash --noprofile --norc -xeuo pipefail {0}
84+
run: |
85+
apt update
86+
apt install zstd
87+
88+
- name: Set up mini CTK
89+
uses: ./.github/actions/fetch_ctk
90+
continue-on-error: false
91+
with:
92+
host-platform: ${{ inputs.host-platform }}
93+
cuda-version: ${{ inputs.cuda-version }}
94+
fail-on-ctk-cache-miss: true
95+
96+
- name: Run test / analysis
97+
shell: bash --noprofile --norc -xeuo pipefail {0}
98+
run: |
99+
ls $CUDA_PATH
100+
101+
REPO_DIR=$(pwd)
102+
103+
cd "${CUDA_BINDINGS_ARTIFACTS_DIR}"
104+
pip install *.whl
105+
106+
cd "${CUDA_CORE_ARTIFACTS_DIR}"
107+
pip install *.whl
108+
109+
cd "${REPO_DIR}/cuda_bindings"
110+
pip install -r requirements.txt
111+
pytest -rxXs tests/
112+
# TODO: enable cython tests
113+
#pytest tests/cython
114+
115+
cd "${REPO_DIR}/cuda_core"
116+
pytest -rxXs tests/

0 commit comments

Comments
 (0)