Skip to content

Commit 73b9ae4

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

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: 32 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,38 @@ 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+
uses:
64+
./.github/workflows/ci-test.yml
3665
with:
3766
host-platform: ${{ matrix.host-platform }}
3867
python-version: ${{ matrix.python-version }}

.github/workflows/ci-test.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
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+
needs:
34+
- build
35+
steps:
36+
- name: Run nvidia-smi to make sure GPU is working
37+
shell: bash --noprofile --norc -xeuo pipefail {0}
38+
run: nvidia-smi
39+
40+
- name: Checkout ${{ github.event.repository.name }}
41+
uses: actions/checkout@v4
42+
with:
43+
fetch-depth: 0
44+
45+
- name: Set up test environment
46+
shell: bash --noprofile --norc -xeuo pipefail {0}
47+
run: |
48+
# make outputs from the previous job as env vars
49+
echo "CUDA_CORE_ARTIFACT_NAME=${{ needs.build.outputs.CUDA_CORE_ARTIFACT_NAME }}" >> $GITHUB_ENV
50+
echo "CUDA_CORE_ARTIFACTS_DIR=${{ needs.build.outputs.CUDA_CORE_ARTIFACTS_DIR }}" >> $GITHUB_ENV
51+
echo "CUDA_BINDINGS_ARTIFACT_NAME=${{ needs.build.outputs.CUDA_BINDINGS_ARTIFACT_NAME }}" >> $GITHUB_ENV
52+
echo "CUDA_BINDINGS_ARTIFACTS_DIR=${{ needs.build.outputs.CUDA_BINDINGS_ARTIFACTS_DIR }}" >> $GITHUB_ENV
53+
54+
- name: Download bindings build artifacts
55+
uses: actions/download-artifact@v4
56+
with:
57+
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
58+
path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
59+
60+
- name: Display structure of downloaded bindings artifacts
61+
shell: bash --noprofile --norc -xeuo pipefail {0}
62+
run: |
63+
pwd
64+
ls -lahR $CUDA_BINDINGS_ARTIFACTS_DIR
65+
66+
- name: Download core build artifacts
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
70+
path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
71+
72+
- name: Display structure of downloaded core build artifacts
73+
shell: bash --noprofile --norc -xeuo pipefail {0}
74+
run: |
75+
pwd
76+
ls -lahR $CUDA_CORE_ARTIFACTS_DIR
77+
78+
- name: Set up Python ${{ inputs.python-version }}
79+
uses: actions/setup-python@v5
80+
with:
81+
python-version: ${{ inputs.python-version }}
82+
83+
# The cache action needs this
84+
- name: Install zstd
85+
shell: bash --noprofile --norc -xeuo pipefail {0}
86+
run: |
87+
apt update
88+
apt install zstd
89+
90+
- name: Set up mini CTK
91+
uses: ./.github/actions/fetch_ctk
92+
continue-on-error: false
93+
with:
94+
host-platform: ${{ inputs.host-platform }}
95+
cuda-version: ${{ inputs.cuda-version }}
96+
fail-on-ctk-cache-miss: true
97+
98+
- name: Run test / analysis
99+
shell: bash --noprofile --norc -xeuo pipefail {0}
100+
run: |
101+
ls $CUDA_PATH
102+
103+
REPO_DIR=$(pwd)
104+
105+
cd "${CUDA_BINDINGS_ARTIFACTS_DIR}"
106+
pip install *.whl
107+
108+
cd "${CUDA_CORE_ARTIFACTS_DIR}"
109+
pip install *.whl
110+
111+
cd "${REPO_DIR}/cuda_bindings"
112+
pip install -r requirements.txt
113+
pytest -rxXs tests/
114+
# TODO: enable cython tests
115+
#pytest tests/cython
116+
117+
cd "${REPO_DIR}/cuda_core"
118+
pytest -rxXs tests/

0 commit comments

Comments
 (0)