-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (66 loc) · 2.47 KB
/
Copy pathci.yml
File metadata and controls
82 lines (66 loc) · 2.47 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
name: CI
on:
push:
branches: [master]
pull_request:
jobs:
# The default build is CPU-only, so runners need no CUDA toolkit; the full
# finite-difference gradient-check suite exercises the CPU maths, and the
# kernels are checked against it locally by tests/cuda_parity.rs.
cpu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build (CPU-only)
run: cargo build --all-targets
- name: Gradient checks (finite difference)
run: cargo test --test gradcheck -- --nocapture
- name: Robustness (resume, anomalies, freezing)
run: cargo test --test robustness
- name: Generation (kv cache, sampling)
run: cargo test --test generation
- name: Unit + integration tests
run: cargo test
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
# Hosted runners have no GPU, so the kernels cannot run here. They still
# compile: nvcc parses kernels.cu, the linker resolves every FFI symbol
# against the real libraries, and a signature drift between ffi.rs and the
# kernels fails in CI instead of on the next machine with a GPU. The parity
# suite notices there is no device at runtime and skips itself.
cuda-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
# No version pin: the action's default tracks what the runner image can
# actually install, and any recent nvcc compiles these kernels.
- name: Install CUDA toolkit (no driver, compile only)
uses: Jimver/cuda-toolkit@v0.2.36
with:
method: 'network'
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-cuda-${{ hashFiles('**/Cargo.lock') }}
- name: Build with the cuda feature
run: cargo build --features cuda --all-targets
- name: Parity tests (self-skip without a device)
run: cargo test --features cuda --test cuda_parity -- --test-threads=1