forked from karpathy/llm.c
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (78 loc) · 2.46 KB
/
ci.yml
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Build and test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-and-test-cpu:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install OpenMP
run: |
if [ "${{ runner.os }}" == "Linux" ]; then
sudo apt-get update && sudo apt-get install -y libomp-dev
elif [ "${{ runner.os }}" == "macOS" ]; then
brew install libomp
fi
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run preprocessing
run: python prepro_tinyshakespeare.py
- name: Train model
run: python train_gpt2.py --device=cpu
- name: Compile training and testing program
run: make test_gpt2 train_gpt2
- name: Execute testing program (With OpenMP)
run: OMP_NUM_THREADS=8 ./test_gpt2
- name: Compile training and testing program without OpenMP
run: NO_OMP=1 make test_gpt2 train_gpt2
- name: Execute testing program (No OpenMP)
run: ./test_gpt2
build-cuda-fp32:
runs-on: ubuntu-latest
container:
image: nvidia/cuda:12.4.1-devel-ubuntu22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build FP32 checkpoint
run: make train_gpt2fp32cu test_gpt2fp32cu
- name: Build FP32 precision
run: PRECISION=FP32 make train_gpt2cu test_gpt2cu profile_gpt2cu
build-cuda-bf16:
runs-on: ubuntu-latest
container:
image: nvidia/cuda:12.4.1-devel-ubuntu22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build project
run: PRECISION=BF16 make test_gpt2cu train_gpt2cu profile_gpt2cu
build-cuda-fp16:
runs-on: ubuntu-latest
container:
image: nvidia/cuda:12.4.1-devel-ubuntu22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build project
run: PRECISION=FP16 make test_gpt2cu train_gpt2cu profile_gpt2cu
build-cuda-kernels:
runs-on: ubuntu-latest
container:
image: nvidia/cuda:12.4.1-devel-ubuntu22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install OpenMP and OpenMPI
run: apt-get update && apt-get install -y libomp-dev libopenmpi-dev
- name: Build project
run: make -j4 -C dev/cuda