Skip to content

Commit 5d9b6ca

Browse files
committed
[CI] Merge back the compile and the test jobs
1 parent 7186539 commit 5d9b6ca

3 files changed

Lines changed: 5 additions & 36 deletions

File tree

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,19 @@
11
name: GPU Test
2-
description: Compile kernels on CPU, then run tests on GPU inside apptainer
3-
4-
inputs:
5-
arch:
6-
description: 'Target SM architecture (e.g. 90 for H100, 100 for B300)'
7-
required: true
2+
description: Compile and run tests inside apptainer
83

94
runs:
105
using: composite
116
steps:
12-
- name: Compile kernels (CPU only)
13-
shell: bash
14-
run: |
15-
CACHE_DIR=$HOME/.quack_cache_${{ github.run_id }}
16-
mkdir -p "$CACHE_DIR"
17-
apptainer exec --writable-tmpfs \
18-
--bind "$CACHE_DIR":/cache \
19-
~/attention_26.03.07.sif bash -c "
20-
export PYTHONPATH=\$PWD:\$PYTHONPATH &&
21-
export QUACK_CACHE_DIR=/cache &&
22-
export QUACK_ARCH=${{ inputs.arch }} &&
23-
export CUTE_DSL_ARCH=sm_${{ inputs.arch }}a &&
24-
pytest tests/ --compile-only -n 24
25-
"
26-
27-
- name: Run tests (GPU)
7+
- name: Compile and run tests
288
shell: bash
299
run: |
30-
CACHE_DIR=$HOME/.quack_cache_${{ github.run_id }}
31-
apptainer exec --nv --writable-tmpfs \
32-
--bind "$CACHE_DIR":/cache \
33-
~/attention_26.03.07.sif bash -c "
10+
apptainer exec --nv --writable-tmpfs ~/attention_26.03.07.sif bash -c "
3411
export PYTHONPATH=\$PWD:\$PYTHONPATH &&
35-
export QUACK_CACHE_DIR=/cache &&
12+
export QUACK_CACHE_DIR=\$HOME/.quack_cache &&
13+
pytest tests/ --compile-only -n 24 &&
3614
FREE_GPUS=\$(nvidia-smi --query-gpu=index,memory.free --format=csv,noheader,nounits | awk -F', ' '\$2 >= 40000 {print \$1}' | paste -sd,) &&
3715
if [ -z \"\$FREE_GPUS\" ]; then echo 'No GPUs with >= 40GB free memory'; exit 1; fi &&
3816
echo \"Running tests on GPUs: \$FREE_GPUS\" &&
3917
NUM_GPUS=\$(echo \"\$FREE_GPUS\" | tr ',' '\n' | wc -l) &&
4018
CUDA_VISIBLE_DEVICES=\$FREE_GPUS pytest tests/ -n \$NUM_GPUS
4119
"
42-
43-
- name: Clean up cache
44-
if: always()
45-
shell: bash
46-
run: rm -rf "$HOME/.quack_cache_${{ github.run_id }}"

.github/workflows/ci-pr.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,3 @@ jobs:
3939
with:
4040
ref: ${{ github.event.pull_request.head.sha }}
4141
- uses: ./.github/actions/gpu-test
42-
with:
43-
arch: ${{ matrix.gpu == 'h100' && '90' || '100' }}

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,3 @@ jobs:
2727
steps:
2828
- uses: actions/checkout@v4
2929
- uses: ./.github/actions/gpu-test
30-
with:
31-
arch: ${{ matrix.gpu == 'h100' && '90' || '100' }}

0 commit comments

Comments
 (0)