@@ -53,24 +53,17 @@ jobs:
53
53
fail-fast : false
54
54
matrix :
55
55
config :
56
- - name : " Windows MSVC"
56
+ - name : " Windows for x64"
57
+ os : windows-2019
58
+ artifact : " win-x64"
59
+ - name : " Windows for Arm"
57
60
os : windows-2022
58
- cc : " cl"
59
- cxx : " cl"
60
- environment_script : " C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
61
- generators : " Visual Studio 17 2022"
62
- artifact : " win"
63
- - name : " Ubuntu GCC"
64
- os : ubuntu-22.04
65
- cc : " gcc"
66
- cxx : " g++"
67
- generators : " Ninja"
61
+ artifact : " win-arm"
62
+ - name : " Ubuntu"
63
+ os : ubuntu-20.04
68
64
artifact : " linux"
69
- - name : " macOS Clang "
65
+ - name : " macOS"
70
66
os : macos-13
71
- cc : " clang"
72
- cxx : " clang++"
73
- generators : " Xcode"
74
67
artifact : " mac"
75
68
76
69
steps :
97
90
choco install ninja cmake
98
91
99
92
- name : Install dependencies on Ubuntu
100
- if : startsWith( matrix.config.name, 'Ubuntu GCC')
93
+ if : matrix.config.name == 'Ubuntu'
101
94
run : |
102
95
sudo apt-get update
103
96
sudo apt-get install ninja-build cmake libtbb-dev g++-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
@@ -108,24 +101,24 @@ jobs:
108
101
which arm-linux-gnueabihf-gcc
109
102
which arm-linux-gnueabihf-g++
110
103
111
- - name : Install Cuda on Windows
112
- if : startsWith( matrix.config.os, 'windows')
104
+ - name : Install Cuda on Windows for x64
105
+ if : matrix.config.name == 'Windows for x64'
113
106
uses : Jimver/cuda-toolkit@v0.2.15
114
107
with :
115
- cuda : ' 12.4.1 '
108
+ cuda : ' 12.2.0 '
116
109
method : ' network'
117
110
sub-packages : ' ["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
118
111
use-local-cache : false
119
112
120
113
- name : Install Cuda on Ubuntu
121
- if : startsWith( matrix.config.name, 'Ubuntu GCC')
114
+ if : matrix.config.name == 'Ubuntu'
122
115
uses : Jimver/cuda-toolkit@v0.2.15
123
116
with :
124
- cuda : ' 12.4.1 '
117
+ cuda : ' 12.2.0 '
125
118
method : ' network'
126
119
127
- - name : Install Vulkan SDK on Windows
128
- if : startsWith( matrix.config.os, 'windows')
120
+ - name : Install Vulkan SDK on Windows for x64
121
+ if : matrix.config.name == 'Windows for x64'
129
122
shell : powershell
130
123
env :
131
124
VULKAN_VERSION : 1.3.261.1
@@ -136,15 +129,15 @@ jobs:
136
129
Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"
137
130
138
131
- name : Install Vulkan SDK on Ubuntu
139
- if : startsWith( matrix.config.name, 'Ubuntu GCC')
132
+ if : matrix.config.name == 'Ubuntu'
140
133
run : |
141
- wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/ apt/trusted.gpg.d/lunarg.asc
142
- sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy .list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy .list
134
+ wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
135
+ sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-focal .list https://packages.lunarg.com/vulkan/lunarg-vulkan-focal .list
143
136
sudo apt update
144
137
sudo apt install vulkan-sdk
145
138
146
139
- name : Install dependencies on macOS
147
- if : startsWith( matrix.config.os, 'macos')
140
+ if : matrix.config.name == 'macOS'
148
141
run : |
149
142
brew install cmake ninja
150
143
alias make=cmake
@@ -203,10 +196,11 @@ jobs:
203
196
}
204
197
205
198
// build binaries
206
- if (process.env.ARTIFACT_NAME === "win") {
199
+ if (process.env.ARTIFACT_NAME === "win-x64 ") {
207
200
await buildBinary("x64", ["--gpu", "false"]);
208
201
await buildBinary("x64", ["--gpu", "cuda"]);
209
202
await buildBinary("x64", ["--gpu", "vulkan"]);
203
+ } else if (process.env.ARTIFACT_NAME === "win-arm") {
210
204
await buildBinary("arm64", ["--gpu", "false"], windowsOnArmNodeVersion);
211
205
} else if (process.env.ARTIFACT_NAME === "linux") {
212
206
await buildBinary("x64", ["--gpu", "false"]);
@@ -234,53 +228,53 @@ jobs:
234
228
235
229
EOF
236
230
237
- # - name: Cache UPX
238
- # id: cache-upx
239
- # uses: actions/cache@v4
240
- # with:
241
- # path: "upxInstallations/**"
242
- # key: cache-upx-${{ runner.os }}-${{ github.workflow }}
243
- #
244
- # - name: Compress CUDA binary on Windows
245
- # if: startsWith( matrix.config.os, 'windows')
246
- # shell: bash
247
- # env:
248
- # UPX_VERSION: 4.2.4
249
- # run: |
250
- # mkdir -p upxInstallations
251
- #
252
- # if [ ! -f "./upxInstallations/upx-${UPX_VERSION}-win64.zip" ]; then
253
- # pushd upxInstallations
254
- # curl -OL "https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-win64.zip"
255
- # popd
256
- # fi
257
- #
258
- # mkdir -p upx
259
- # unzip -d ./upx "./upxInstallations/upx-${UPX_VERSION}-win64.zip"
260
- # mv "./upx/upx-${UPX_VERSION}-win64" ./upx/upx
261
- #
262
- # ./upx/upx/upx.exe --best ./bins/win-x64-cuda/llama-addon.node
263
- #
264
- # - name: Compress CUDA binary on Ubuntu
265
- # if: startsWith( matrix.config.name, 'Ubuntu GCC')
266
- # env:
267
- # UPX_VERSION: 4.2.4
268
- # run: |
269
- # mkdir -p upxInstallations
270
- #
271
- # if [ ! -f "./upxInstallations/upx-${UPX_VERSION}-amd64_linux.tar.xz" ]; then
272
- # pushd upxInstallations
273
- # curl -OL "https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-amd64_linux.tar.xz"
274
- # popd
275
- # fi
276
- #
277
- # mkdir -p upx
278
- # tar -xvf "./upxInstallations/upx-${UPX_VERSION}-amd64_linux.tar.xz" -C ./upx
279
- # mv "./upx/upx-${UPX_VERSION}-amd64_linux" ./upx/upx
280
- #
281
- # chmod +x ./bins/linux-x64-cuda/llama-addon.node
282
- # ./upx/upx/upx --best ./bins/linux-x64-cuda/llama-addon.node
283
- # chmod -x ./bins/linux-x64-cuda/llama-addon.node
231
+ - name : Cache UPX
232
+ id : cache-upx
233
+ uses : actions/cache@v4
234
+ with :
235
+ path : " upxInstallations/**"
236
+ key : cache-upx-${{ runner.os }}-${{ github.workflow }}
237
+
238
+ - name : Compress CUDA binary on Windows
239
+ if : matrix.config.name == 'Windows for x64'
240
+ shell : bash
241
+ env :
242
+ UPX_VERSION : 4.2.4
243
+ run : |
244
+ mkdir -p upxInstallations
245
+
246
+ if [ ! -f "./upxInstallations/upx-${UPX_VERSION}-win64.zip" ]; then
247
+ pushd upxInstallations
248
+ curl -OL "https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-win64.zip"
249
+ popd
250
+ fi
251
+
252
+ mkdir -p upx
253
+ unzip -d ./upx "./upxInstallations/upx-${UPX_VERSION}-win64.zip"
254
+ mv "./upx/upx-${UPX_VERSION}-win64" ./upx/upx
255
+
256
+ ./upx/upx/upx.exe --best ./bins/win-x64-cuda/llama-addon.node
257
+
258
+ - name : Compress CUDA binary on Ubuntu
259
+ if : matrix.config.name == 'Ubuntu'
260
+ env :
261
+ UPX_VERSION : 4.2.4
262
+ run : |
263
+ mkdir -p upxInstallations
264
+
265
+ if [ ! -f "./upxInstallations/upx-${UPX_VERSION}-amd64_linux.tar.xz" ]; then
266
+ pushd upxInstallations
267
+ curl -OL "https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-amd64_linux.tar.xz"
268
+ popd
269
+ fi
270
+
271
+ mkdir -p upx
272
+ tar -xvf "./upxInstallations/upx-${UPX_VERSION}-amd64_linux.tar.xz" -C ./upx
273
+ mv "./upx/upx-${UPX_VERSION}-amd64_linux" ./upx/upx
274
+
275
+ chmod +x ./bins/linux-x64-cuda/llama-addon.node
276
+ ./upx/upx/upx --best ./bins/linux-x64-cuda/llama-addon.node
277
+ chmod -x ./bins/linux-x64-cuda/llama-addon.node
284
278
285
279
- name : Publish artifact
286
280
uses : actions/upload-artifact@v4
@@ -510,7 +504,7 @@ jobs:
510
504
- name : " Windows"
511
505
os : windows-2022
512
506
- name : " Ubuntu"
513
- os : ubuntu-22 .04
507
+ os : ubuntu-20 .04
514
508
- name : " macOS"
515
509
os : macos-13
516
510
@@ -521,7 +515,7 @@ jobs:
521
515
node-version : " 20"
522
516
523
517
- name : Install dependencies on Ubuntu
524
- if : startsWith( matrix.config.name, 'Ubuntu')
518
+ if : matrix.config.name == 'Ubuntu'
525
519
run : |
526
520
sudo apt-get update
527
521
sudo apt-get install libarchive-tools rpm
0 commit comments