-
Notifications
You must be signed in to change notification settings - Fork 134
194 lines (166 loc) · 6.61 KB
/
cortex-cpp-quality-gate.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: CI Quality Gate Cortex CPP
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
[
"cortex-cpp/**",
]
workflow_dispatch:
env:
LLM_MODEL_URL: https://delta.jan.ai/tinyllama-1.1b-chat-v0.3.Q2_K.gguf
EMBEDDING_MODEL_URL: https://catalog.jan.ai/dist/models/embeds/nomic-embed-text-v1.5.f16.gguf
PYTHON_FILE_EXECUTION_PATH: "python-file-to-test.py"
jobs:
build-and-test:
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
include:
- os: "linux"
name: "amd64-avx2"
runs-on: "ubuntu-18-04"
cmake-flags: "-DLLAMA_AVX2=ON -DLLAMA_NATIVE=OFF"
run-e2e: true
run-python-e2e: true
- os: "linux"
name: "amd64-avx"
runs-on: "ubuntu-18-04"
cmake-flags: "-DLLAMA_AVX2=OFF -DLLAMA_NATIVE=OFF"
run-e2e: false
run-python-e2e: false
- os: "linux"
name: "amd64-avx512"
runs-on: "ubuntu-18-04"
cmake-flags: "-DLLAMA_AVX512=ON -DLLAMA_NATIVE=OFF"
run-e2e: false
run-python-e2e: false
- os: "linux"
name: "amd64-vulkan"
runs-on: "ubuntu-18-04-cuda-11-7"
cmake-flags: "-DLLAMA_VULKAN=ON -DLLAMA_NATIVE=OFF"
run-e2e: false
run-python-e2e: false
- os: "linux"
name: "amd64-cuda-11-7"
runs-on: "ubuntu-18-04-cuda-11-7"
cmake-flags: "-DCUDA_11_7=ON -DLLAMA_NATIVE=OFF -DLLAMA_CUDA=ON"
run-e2e: false
run-python-e2e: false
- os: "linux"
name: "amd64-cuda-12-0"
runs-on: "ubuntu-18-04-cuda-12-0"
cmake-flags: "-DCUDA_12_0=ON -DLLAMA_NATIVE=OFF -DLLAMA_CUDA=ON"
run-e2e: false
run-python-e2e: false
- os: "mac"
name: "amd64"
runs-on: "macos-13"
cmake-flags: ""
run-e2e: true
run-python-e2e: true
- os: "mac"
name: "arm64"
runs-on: "mac-silicon"
cmake-flags: "-DMAC_ARM64=ON"
run-e2e: true
run-python-e2e: true
- os: "windows"
name: "amd64-avx2"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DLLAMA_AVX2=ON -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE"
run-e2e: true
run-python-e2e: true
- os: "windows"
name: "amd64-avx"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DLLAMA_AVX2=OFF -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE"
run-e2e: false
run-python-e2e: false
- os: "windows"
name: "amd64-avx512"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DLLAMA_AVX512=ON -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE"
run-e2e: false
run-python-e2e: false
- os: "windows"
name: "amd64-vulkan"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DLLAMA_VULKAN=ON -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE"
run-e2e: false
run-python-e2e: false
- os: "windows"
name: "amd64-avx2-cuda-12-0"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DLLAMA_AVX2=ON -DLLAMA_NATIVE=OFF -DCUDA_12_0=ON -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE"
run-e2e: false
run-python-e2e: false
- os: "windows"
name: "amd64-avx-cuda-12-0"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DLLAMA_AVX2=OFF -DLLAMA_NATIVE=OFF -DCUDA_12_0=ON -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE"
run-e2e: false
run-python-e2e: false
- os: "windows"
name: "amd64-avx512-cuda-12-0"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DLLAMA_AVX512=ON -DLLAMA_NATIVE=OFF -DCUDA_12_0=ON -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE"
run-e2e: false
run-python-e2e: false
- os: "windows"
name: "amd64-avx2-cuda-11-7"
runs-on: "windows-cuda-11-7"
cmake-flags: "-DLLAMA_AVX2=ON -DLLAMA_NATIVE=OFF -DCUDA_11_7=ON -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE"
run-e2e: false
run-python-e2e: false
- os: "windows"
name: "amd64-avx-cuda-11-7"
runs-on: "windows-cuda-11-7"
cmake-flags: "-DLLAMA_AVX2=OFF -DLLAMA_NATIVE=OFF -DCUDA_11_7=ON -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE"
run-e2e: false
run-python-e2e: false
- os: "windows"
name: "amd64-avx512-cuda-11-7"
runs-on: "windows-cuda-11-7"
cmake-flags: "-DLLAMA_AVX512=ON -DLLAMA_NATIVE=OFF -DCUDA_11_7=ON -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE"
run-e2e: false
run-python-e2e: false
steps:
- name: Clone
id: checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install choco on Windows
if: runner.os == 'Windows'
run: |
choco install make -y
- name: Build
run: |
cd cortex-cpp
make build CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}"
- name: Pre-package
run: |
cd cortex-cpp
make pre-package
- name: Package
run: |
cd cortex-cpp
make package
- name: Run e2e testing
if: ${{ matrix.run-e2e }}
run: |
cd cortex-cpp
make run-e2e-test RUN_TESTS=true LLM_MODEL_URL=${{ env.LLM_MODEL_URL }} EMBEDDING_MODEL_URL=${{ env.EMBEDDING_MODEL_URL }}
- name: Run python e2e testing
if: ${{ matrix.run-python-e2e }}
run: |
cd cortex-cpp
make run-python-e2e-test RUN_TESTS=true PYTHON_FILE_EXECUTION_PATH=${{ env.PYTHON_FILE_EXECUTION_PATH }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: cortex-cpp-${{ matrix.os }}-${{ matrix.name }}
path: ./cortex-cpp/cortex-cpp