-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (66 loc) · 2.31 KB
/
Copy pathgpu.yml
File metadata and controls
78 lines (66 loc) · 2.31 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
name: GPU
on:
push:
branches: [canon]
pull_request:
types: [labeled]
permissions:
contents: read
issues: write
pull-requests: write
env:
LLVM_VERSION: "20"
jobs:
gpu-test:
if: >-
github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.label.name == 'gpu-test' &&
github.actor == github.repository_owner && github.triggering_actor == github.repository_owner &&
github.event.pull_request.head.repo.full_name == github.repository)
concurrency:
group: gpu-ci
cancel-in-progress: false
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Install LLVM ${{ env.LLVM_VERSION }} and MLIR
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo add-apt-repository -y "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${LLVM_VERSION} main"
sudo apt-get update
sudo apt-get install -y \
clang-${LLVM_VERSION} \
llvm-${LLVM_VERSION}-dev \
libmlir-${LLVM_VERSION}-dev \
mlir-${LLVM_VERSION}-tools
- uses: astral-sh/setup-uv@v4
- name: Install Python dependencies
run: uv sync
- name: Configure
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang-${LLVM_VERSION} \
-DCMAKE_CXX_COMPILER=clang++-${LLVM_VERSION} \
-DMLIR_DIR=/usr/lib/llvm-${LLVM_VERSION}/lib/cmake/mlir \
-DLLVM_DIR=/usr/lib/llvm-${LLVM_VERSION}/lib/cmake/llvm
- name: Build
run: cmake --build build
- name: Run GPU tests on Vast.ai
env:
VASTAI_API_KEY: ${{ secrets.VASTAI_API_KEY }}
run: |
if [ -z "$VASTAI_API_KEY" ]; then
echo "VASTAI_API_KEY repository secret is not configured" >&2
exit 1
fi
uv run pytest -v -m gpu
- name: Remove GPU test trigger label
if: always() && github.event_name == 'pull_request'
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
gh api --method DELETE \
"repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/labels/gpu-test"