@fugood/llama.node 0.3.17 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/CMakeLists.txt +3 -1
  2. package/bin/darwin/arm64/llama-node.node +0 -0
  3. package/bin/darwin/x64/llama-node.node +0 -0
  4. package/bin/linux/arm64/llama-node.node +0 -0
  5. package/bin/linux/x64/llama-node.node +0 -0
  6. package/bin/linux-cuda/arm64/llama-node.node +0 -0
  7. package/bin/linux-cuda/x64/llama-node.node +0 -0
  8. package/bin/linux-vulkan/arm64/llama-node.node +0 -0
  9. package/bin/linux-vulkan/x64/llama-node.node +0 -0
  10. package/bin/win32/arm64/llama-node.node +0 -0
  11. package/bin/win32/arm64/node.lib +0 -0
  12. package/bin/win32/x64/llama-node.node +0 -0
  13. package/bin/win32/x64/node.lib +0 -0
  14. package/bin/win32-vulkan/arm64/llama-node.node +0 -0
  15. package/bin/win32-vulkan/arm64/node.lib +0 -0
  16. package/bin/win32-vulkan/x64/llama-node.node +0 -0
  17. package/bin/win32-vulkan/x64/node.lib +0 -0
  18. package/lib/binding.ts +39 -2
  19. package/lib/index.js +132 -1
  20. package/lib/index.ts +203 -3
  21. package/package.json +2 -1
  22. package/src/EmbeddingWorker.cpp +1 -1
  23. package/src/LlamaCompletionWorker.cpp +366 -19
  24. package/src/LlamaCompletionWorker.h +30 -10
  25. package/src/LlamaContext.cpp +213 -5
  26. package/src/LlamaContext.h +12 -0
  27. package/src/common.hpp +15 -0
  28. package/src/llama.cpp/.github/workflows/build-linux-cross.yml +133 -24
  29. package/src/llama.cpp/.github/workflows/build.yml +41 -762
  30. package/src/llama.cpp/.github/workflows/docker.yml +5 -2
  31. package/src/llama.cpp/.github/workflows/release.yml +716 -0
  32. package/src/llama.cpp/.github/workflows/server.yml +12 -12
  33. package/src/llama.cpp/CMakeLists.txt +5 -17
  34. package/src/llama.cpp/cmake/build-info.cmake +8 -2
  35. package/src/llama.cpp/cmake/x64-windows-llvm.cmake +0 -6
  36. package/src/llama.cpp/common/CMakeLists.txt +31 -3
  37. package/src/llama.cpp/common/arg.cpp +48 -29
  38. package/src/llama.cpp/common/chat.cpp +128 -106
  39. package/src/llama.cpp/common/chat.h +2 -0
  40. package/src/llama.cpp/common/common.cpp +37 -1
  41. package/src/llama.cpp/common/common.h +18 -9
  42. package/src/llama.cpp/common/llguidance.cpp +1 -0
  43. package/src/llama.cpp/common/minja/chat-template.hpp +9 -5
  44. package/src/llama.cpp/common/minja/minja.hpp +69 -36
  45. package/src/llama.cpp/common/regex-partial.cpp +204 -0
  46. package/src/llama.cpp/common/regex-partial.h +56 -0
  47. package/src/llama.cpp/common/sampling.cpp +57 -50
  48. package/src/llama.cpp/examples/CMakeLists.txt +2 -23
  49. package/src/llama.cpp/examples/embedding/embedding.cpp +2 -11
  50. package/src/llama.cpp/examples/parallel/parallel.cpp +86 -14
  51. package/src/llama.cpp/examples/training/CMakeLists.txt +5 -0
  52. package/src/llama.cpp/examples/training/finetune.cpp +96 -0
  53. package/src/llama.cpp/ggml/CMakeLists.txt +27 -0
  54. package/src/llama.cpp/ggml/include/ggml-backend.h +4 -4
  55. package/src/llama.cpp/ggml/include/ggml-cpp.h +1 -1
  56. package/src/llama.cpp/ggml/include/ggml-opt.h +47 -28
  57. package/src/llama.cpp/ggml/include/ggml.h +10 -7
  58. package/src/llama.cpp/ggml/src/CMakeLists.txt +1 -1
  59. package/src/llama.cpp/ggml/src/ggml-alloc.c +4 -1
  60. package/src/llama.cpp/ggml/src/ggml-backend.cpp +9 -5
  61. package/src/llama.cpp/ggml/src/ggml-cpu/CMakeLists.txt +20 -13
  62. package/src/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp +0 -2
  63. package/src/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c +306 -6
  64. package/src/llama.cpp/ggml/src/ggml-cpu/ggml-cpu.c +4 -13
  65. package/src/llama.cpp/ggml/src/ggml-cpu/ggml-cpu.cpp +29 -16
  66. package/src/llama.cpp/ggml/src/ggml-cpu/kleidiai/kernels.cpp +88 -5
  67. package/src/llama.cpp/ggml/src/ggml-cpu/kleidiai/kernels.h +47 -12
  68. package/src/llama.cpp/ggml/src/ggml-cpu/kleidiai/kleidiai.cpp +264 -69
  69. package/src/llama.cpp/ggml/src/ggml-cpu/llamafile/sgemm.cpp +501 -0
  70. package/src/llama.cpp/ggml/src/ggml-cpu/ops.cpp +0 -13
  71. package/src/llama.cpp/ggml/src/ggml-cpu/vec.cpp +0 -6
  72. package/src/llama.cpp/ggml/src/ggml-cuda/CMakeLists.txt +23 -4
  73. package/src/llama.cpp/ggml/src/ggml-metal/ggml-metal-impl.h +36 -11
  74. package/src/llama.cpp/ggml/src/ggml-opencl/ggml-opencl.cpp +0 -2
  75. package/src/llama.cpp/ggml/src/ggml-opt.cpp +368 -190
  76. package/src/llama.cpp/ggml/src/ggml-quants.c +0 -6
  77. package/src/llama.cpp/ggml/src/ggml-rpc/ggml-rpc.cpp +41 -27
  78. package/src/llama.cpp/ggml/src/ggml-sycl/CMakeLists.txt +29 -23
  79. package/src/llama.cpp/ggml/src/ggml-sycl/backend.hpp +9 -8
  80. package/src/llama.cpp/ggml/src/ggml-sycl/binbcast.cpp +121 -232
  81. package/src/llama.cpp/ggml/src/ggml-sycl/common.hpp +7 -15
  82. package/src/llama.cpp/ggml/src/ggml-sycl/convert.cpp +72 -25
  83. package/src/llama.cpp/ggml/src/ggml-sycl/convert.hpp +14 -7
  84. package/src/llama.cpp/ggml/src/ggml-sycl/dequantize.hpp +59 -21
  85. package/src/llama.cpp/ggml/src/ggml-sycl/dmmv.cpp +7 -1
  86. package/src/llama.cpp/ggml/src/ggml-sycl/element_wise.cpp +0 -23
  87. package/src/llama.cpp/ggml/src/ggml-sycl/gemm.hpp +37 -8
  88. package/src/llama.cpp/ggml/src/ggml-sycl/ggml-sycl.cpp +338 -166
  89. package/src/llama.cpp/ggml/src/ggml-sycl/mmvq.cpp +185 -89
  90. package/src/llama.cpp/ggml/src/ggml-sycl/quants.hpp +83 -0
  91. package/src/llama.cpp/ggml/src/ggml-sycl/vecdotq.hpp +128 -53
  92. package/src/llama.cpp/ggml/src/ggml-vulkan/CMakeLists.txt +81 -70
  93. package/src/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp +657 -193
  94. package/src/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/CMakeLists.txt +20 -0
  95. package/src/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp +123 -29
  96. package/src/llama.cpp/ggml/src/ggml.c +29 -20
  97. package/src/llama.cpp/ggml/src/gguf.cpp +33 -33
  98. package/src/llama.cpp/include/llama.h +52 -11
  99. package/src/llama.cpp/requirements/requirements-all.txt +3 -3
  100. package/src/llama.cpp/scripts/xxd.cmake +1 -1
  101. package/src/llama.cpp/src/CMakeLists.txt +1 -0
  102. package/src/llama.cpp/src/llama-adapter.cpp +6 -0
  103. package/src/llama.cpp/src/llama-arch.cpp +3 -0
  104. package/src/llama.cpp/src/llama-batch.cpp +5 -1
  105. package/src/llama.cpp/src/llama-batch.h +2 -1
  106. package/src/llama.cpp/src/llama-chat.cpp +17 -7
  107. package/src/llama.cpp/src/llama-chat.h +1 -0
  108. package/src/llama.cpp/src/llama-context.cpp +389 -501
  109. package/src/llama.cpp/src/llama-context.h +44 -32
  110. package/src/llama.cpp/src/llama-cparams.h +1 -0
  111. package/src/llama.cpp/src/llama-graph.cpp +20 -38
  112. package/src/llama.cpp/src/llama-graph.h +12 -8
  113. package/src/llama.cpp/src/llama-kv-cache.cpp +1503 -389
  114. package/src/llama.cpp/src/llama-kv-cache.h +271 -85
  115. package/src/llama.cpp/src/llama-memory.h +11 -1
  116. package/src/llama.cpp/src/llama-model-loader.cpp +24 -15
  117. package/src/llama.cpp/src/llama-model-saver.cpp +281 -0
  118. package/src/llama.cpp/src/llama-model-saver.h +37 -0
  119. package/src/llama.cpp/src/llama-model.cpp +316 -69
  120. package/src/llama.cpp/src/llama-model.h +8 -1
  121. package/src/llama.cpp/src/llama-quant.cpp +15 -13
  122. package/src/llama.cpp/src/llama-sampling.cpp +18 -6
  123. package/src/llama.cpp/src/llama-vocab.cpp +42 -4
  124. package/src/llama.cpp/src/llama-vocab.h +6 -0
  125. package/src/llama.cpp/src/llama.cpp +14 -0
  126. package/src/llama.cpp/tests/CMakeLists.txt +10 -2
  127. package/src/llama.cpp/tests/test-backend-ops.cpp +107 -47
  128. package/src/llama.cpp/tests/test-chat-template.cpp +10 -11
  129. package/src/llama.cpp/tests/test-chat.cpp +3 -1
  130. package/src/llama.cpp/tests/test-mtmd-c-api.c +63 -0
  131. package/src/llama.cpp/tests/test-opt.cpp +33 -21
  132. package/src/llama.cpp/tests/test-regex-partial.cpp +288 -0
  133. package/src/llama.cpp/tests/test-sampling.cpp +1 -1
  134. package/src/llama.cpp/tools/CMakeLists.txt +39 -0
  135. package/src/llama.cpp/{examples → tools}/batched-bench/batched-bench.cpp +2 -2
  136. package/src/llama.cpp/{examples → tools}/imatrix/imatrix.cpp +11 -9
  137. package/src/llama.cpp/{examples → tools}/llama-bench/llama-bench.cpp +495 -348
  138. package/src/llama.cpp/{examples → tools}/main/main.cpp +6 -9
  139. package/src/llama.cpp/{examples/llava → tools/mtmd}/CMakeLists.txt +1 -35
  140. package/src/llama.cpp/{examples/llava → tools/mtmd}/clip-impl.h +25 -5
  141. package/src/llama.cpp/{examples/llava → tools/mtmd}/clip.cpp +1440 -1349
  142. package/src/llama.cpp/tools/mtmd/clip.h +99 -0
  143. package/src/llama.cpp/{examples/llava → tools/mtmd}/mtmd-cli.cpp +70 -44
  144. package/src/llama.cpp/tools/mtmd/mtmd-helper.cpp +310 -0
  145. package/src/llama.cpp/{examples/llava → tools/mtmd}/mtmd.cpp +251 -281
  146. package/src/llama.cpp/tools/mtmd/mtmd.h +331 -0
  147. package/src/llama.cpp/{examples → tools}/perplexity/perplexity.cpp +4 -2
  148. package/src/llama.cpp/{examples → tools}/quantize/quantize.cpp +13 -76
  149. package/src/llama.cpp/{examples → tools}/rpc/rpc-server.cpp +70 -74
  150. package/src/llama.cpp/{examples → tools}/run/run.cpp +18 -4
  151. package/src/llama.cpp/{examples → tools}/server/CMakeLists.txt +2 -1
  152. package/src/llama.cpp/{examples → tools}/server/server.cpp +291 -76
  153. package/src/llama.cpp/{examples → tools}/server/utils.hpp +377 -5
  154. package/src/llama.cpp/cmake/arm64-windows-msvc.cmake +0 -6
  155. package/src/llama.cpp/examples/infill/CMakeLists.txt +0 -5
  156. package/src/llama.cpp/examples/infill/infill.cpp +0 -590
  157. package/src/llama.cpp/examples/llava/android/build_64.sh +0 -8
  158. package/src/llama.cpp/examples/llava/clip-quantize-cli.cpp +0 -59
  159. package/src/llama.cpp/examples/llava/clip.h +0 -135
  160. package/src/llama.cpp/examples/llava/llava.cpp +0 -586
  161. package/src/llama.cpp/examples/llava/llava.h +0 -49
  162. package/src/llama.cpp/examples/llava/mtmd.h +0 -168
  163. package/src/llama.cpp/examples/llava/qwen2vl-test.cpp +0 -636
  164. /package/src/llama.cpp/{examples → tools}/batched-bench/CMakeLists.txt +0 -0
  165. /package/src/llama.cpp/{examples → tools}/cvector-generator/CMakeLists.txt +0 -0
  166. /package/src/llama.cpp/{examples → tools}/cvector-generator/completions.txt +0 -0
  167. /package/src/llama.cpp/{examples → tools}/cvector-generator/cvector-generator.cpp +0 -0
  168. /package/src/llama.cpp/{examples → tools}/cvector-generator/mean.hpp +0 -0
  169. /package/src/llama.cpp/{examples → tools}/cvector-generator/negative.txt +0 -0
  170. /package/src/llama.cpp/{examples → tools}/cvector-generator/pca.hpp +0 -0
  171. /package/src/llama.cpp/{examples → tools}/cvector-generator/positive.txt +0 -0
  172. /package/src/llama.cpp/{examples → tools}/export-lora/CMakeLists.txt +0 -0
  173. /package/src/llama.cpp/{examples → tools}/export-lora/export-lora.cpp +0 -0
  174. /package/src/llama.cpp/{examples → tools}/gguf-split/CMakeLists.txt +0 -0
  175. /package/src/llama.cpp/{examples → tools}/gguf-split/gguf-split.cpp +0 -0
  176. /package/src/llama.cpp/{examples → tools}/imatrix/CMakeLists.txt +0 -0
  177. /package/src/llama.cpp/{examples → tools}/llama-bench/CMakeLists.txt +0 -0
  178. /package/src/llama.cpp/{examples → tools}/main/CMakeLists.txt +0 -0
  179. /package/src/llama.cpp/{examples/llava → tools/mtmd}/deprecation-warning.cpp +0 -0
  180. /package/src/llama.cpp/{examples/llava → tools/mtmd}/requirements.txt +0 -0
  181. /package/src/llama.cpp/{examples → tools}/perplexity/CMakeLists.txt +0 -0
  182. /package/src/llama.cpp/{examples → tools}/quantize/CMakeLists.txt +0 -0
  183. /package/src/llama.cpp/{examples → tools}/rpc/CMakeLists.txt +0 -0
  184. /package/src/llama.cpp/{examples → tools}/run/CMakeLists.txt +0 -0
  185. /package/src/llama.cpp/{examples → tools}/run/linenoise.cpp/linenoise.cpp +0 -0
  186. /package/src/llama.cpp/{examples → tools}/run/linenoise.cpp/linenoise.h +0 -0
  187. /package/src/llama.cpp/{examples → tools}/server/bench/requirements.txt +0 -0
  188. /package/src/llama.cpp/{examples → tools}/server/httplib.h +0 -0
  189. /package/src/llama.cpp/{examples → tools}/server/tests/requirements.txt +0 -0
  190. /package/src/llama.cpp/{examples → tools}/tokenize/CMakeLists.txt +0 -0
  191. /package/src/llama.cpp/{examples → tools}/tokenize/tokenize.cpp +0 -0
  192. /package/src/llama.cpp/{examples → tools}/tts/CMakeLists.txt +0 -0
  193. /package/src/llama.cpp/{examples → tools}/tts/tts.cpp +0 -0
@@ -2,30 +2,19 @@ name: CI
2
2
 
3
3
  on:
4
4
  workflow_dispatch: # allows manual triggering
5
- inputs:
6
- create_release:
7
- description: 'Create new release'
8
- required: true
9
- type: boolean
10
5
  push:
11
6
  branches:
12
7
  - master
13
- paths: ['.github/workflows/build.yml', '.github/workflows/build-linux-cross.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cuh', '**/*.swift', '**/*.m', '**/*.metal', '**/*.comp']
8
+ paths: ['.github/workflows/build.yml', '.github/workflows/build-linux-cross.yml', '**/CMakeLists.txt', '**/.cmake', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cuh', '**/*.swift', '**/*.m', '**/*.metal', '**/*.comp']
14
9
  pull_request:
15
10
  types: [opened, synchronize, reopened]
16
- paths: ['.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cuh', '**/*.swift', '**/*.m', '**/*.metal', '**/*.comp']
11
+ paths: ['.github/workflows/build.yml', '.github/workflows/build-linux-cross.yml', '**/CMakeLists.txt', '**/.cmake', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cuh', '**/*.swift', '**/*.m', '**/*.metal', '**/*.comp']
17
12
 
18
13
  concurrency:
19
14
  group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
20
15
  cancel-in-progress: true
21
16
 
22
- # Fine-grant permission
23
- # https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
24
- permissions:
25
- contents: write # for creating release
26
-
27
17
  env:
28
- BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
29
18
  GGML_NLOOP: 3
30
19
  GGML_N_THREADS: 1
31
20
  LLAMA_LOG_COLORS: 1
@@ -40,8 +29,6 @@ jobs:
40
29
  - name: Clone
41
30
  id: checkout
42
31
  uses: actions/checkout@v4
43
- with:
44
- fetch-depth: 0
45
32
 
46
33
  - name: ccache
47
34
  uses: hendrikmuhs/ccache-action@v1.2.16
@@ -74,33 +61,6 @@ jobs:
74
61
  cd build
75
62
  ctest -L 'main|curl' --verbose --timeout 900
76
63
 
77
- - name: Determine tag name
78
- id: tag
79
- shell: bash
80
- run: |
81
- BUILD_NUMBER="$(git rev-list --count HEAD)"
82
- SHORT_HASH="$(git rev-parse --short=7 HEAD)"
83
- if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
84
- echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
85
- else
86
- SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
87
- echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
88
- fi
89
-
90
- - name: Pack artifacts
91
- id: pack_artifacts
92
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
93
- run: |
94
- cp LICENSE ./build/bin/
95
- zip -r llama-${{ steps.tag.outputs.name }}-bin-macos-arm64.zip ./build/bin/*
96
-
97
- - name: Upload artifacts
98
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
99
- uses: actions/upload-artifact@v4
100
- with:
101
- path: llama-${{ steps.tag.outputs.name }}-bin-macos-arm64.zip
102
- name: llama-bin-macos-arm64.zip
103
-
104
64
  macOS-latest-cmake-x64:
105
65
  runs-on: macos-13
106
66
 
@@ -108,8 +68,6 @@ jobs:
108
68
  - name: Clone
109
69
  id: checkout
110
70
  uses: actions/checkout@v4
111
- with:
112
- fetch-depth: 0
113
71
 
114
72
  - name: ccache
115
73
  uses: hendrikmuhs/ccache-action@v1.2.16
@@ -143,33 +101,6 @@ jobs:
143
101
  cd build
144
102
  ctest -L main --verbose --timeout 900
145
103
 
146
- - name: Determine tag name
147
- id: tag
148
- shell: bash
149
- run: |
150
- BUILD_NUMBER="$(git rev-list --count HEAD)"
151
- SHORT_HASH="$(git rev-parse --short=7 HEAD)"
152
- if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
153
- echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
154
- else
155
- SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
156
- echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
157
- fi
158
-
159
- - name: Pack artifacts
160
- id: pack_artifacts
161
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
162
- run: |
163
- cp LICENSE ./build/bin/
164
- zip -r llama-${{ steps.tag.outputs.name }}-bin-macos-x64.zip ./build/bin/*
165
-
166
- - name: Upload artifacts
167
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
168
- uses: actions/upload-artifact@v4
169
- with:
170
- path: llama-${{ steps.tag.outputs.name }}-bin-macos-x64.zip
171
- name: llama-bin-macos-x64.zip
172
-
173
104
  ubuntu-cpu-cmake:
174
105
  strategy:
175
106
  matrix:
@@ -185,8 +116,6 @@ jobs:
185
116
  - name: Clone
186
117
  id: checkout
187
118
  uses: actions/checkout@v4
188
- with:
189
- fetch-depth: 0
190
119
 
191
120
  - name: ccache
192
121
  uses: hendrikmuhs/ccache-action@v1.2.16
@@ -225,33 +154,6 @@ jobs:
225
154
  ./bin/llama-convert-llama2c-to-ggml --copy-vocab-from-model ./tok512.bin --llama2c-model stories260K.bin --llama2c-output-model stories260K.gguf
226
155
  ./bin/llama-cli -m stories260K.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
227
156
 
228
- - name: Determine tag name
229
- id: tag
230
- shell: bash
231
- run: |
232
- BUILD_NUMBER="$(git rev-list --count HEAD)"
233
- SHORT_HASH="$(git rev-parse --short=7 HEAD)"
234
- if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
235
- echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
236
- else
237
- SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
238
- echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
239
- fi
240
-
241
- - name: Pack artifacts
242
- id: pack_artifacts
243
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
244
- run: |
245
- cp LICENSE ./build/bin/
246
- zip -r llama-${{ steps.tag.outputs.name }}-bin-ubuntu-${{ matrix.build }}.zip ./build/bin/*
247
-
248
- - name: Upload artifacts
249
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
250
- uses: actions/upload-artifact@v4
251
- with:
252
- path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-${{ matrix.build }}.zip
253
- name: llama-bin-ubuntu-${{ matrix.build }}.zip
254
-
255
157
  ubuntu-latest-cmake-sanitizer:
256
158
  runs-on: ubuntu-latest
257
159
 
@@ -378,8 +280,6 @@ jobs:
378
280
  - name: Clone
379
281
  id: checkout
380
282
  uses: actions/checkout@v4
381
- with:
382
- fetch-depth: 0
383
283
 
384
284
  - name: ccache
385
285
  uses: hendrikmuhs/ccache-action@v1.2.16
@@ -407,34 +307,7 @@ jobs:
407
307
  run: |
408
308
  cd build
409
309
  # This is using llvmpipe and runs slower than other backends
410
- ctest -L main --verbose --timeout 2700
411
-
412
- - name: Determine tag name
413
- id: tag
414
- shell: bash
415
- run: |
416
- BUILD_NUMBER="$(git rev-list --count HEAD)"
417
- SHORT_HASH="$(git rev-parse --short=7 HEAD)"
418
- if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
419
- echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
420
- else
421
- SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
422
- echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
423
- fi
424
-
425
- - name: Pack artifacts
426
- id: pack_artifacts
427
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
428
- run: |
429
- cp LICENSE ./build/bin/
430
- zip -r llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.zip ./build/bin/*
431
-
432
- - name: Upload artifacts
433
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
434
- uses: actions/upload-artifact@v4
435
- with:
436
- path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.zip
437
- name: llama-bin-ubuntu-vulkan-x64.zip
310
+ ctest -L main --verbose --timeout 3600
438
311
 
439
312
  ubuntu-22-cmake-hip:
440
313
  runs-on: ubuntu-22.04
@@ -601,9 +474,8 @@ jobs:
601
474
  -DGGML_SYCL_F16=ON
602
475
  cmake --build build --config Release -j $(nproc)
603
476
 
604
- # Disabled for now due to sporadic issue syncing.
605
- # build-linux-cross:
606
- # uses: ./.github/workflows/build-linux-cross.yml
477
+ build-linux-cross:
478
+ uses: ./.github/workflows/build-linux-cross.yml
607
479
 
608
480
  macOS-latest-cmake-ios:
609
481
  runs-on: macos-latest
@@ -634,6 +506,7 @@ jobs:
634
506
  -DGGML_METAL_EMBED_LIBRARY=ON \
635
507
  -DLLAMA_BUILD_COMMON=OFF \
636
508
  -DLLAMA_BUILD_EXAMPLES=OFF \
509
+ -DLLAMA_BUILD_TOOLS=OFF \
637
510
  -DLLAMA_BUILD_TESTS=OFF \
638
511
  -DLLAMA_BUILD_SERVER=OFF \
639
512
  -DCMAKE_SYSTEM_NAME=iOS \
@@ -670,6 +543,7 @@ jobs:
670
543
  -DGGML_METAL_EMBED_LIBRARY=ON \
671
544
  -DLLAMA_BUILD_COMMON=OFF \
672
545
  -DLLAMA_BUILD_EXAMPLES=OFF \
546
+ -DLLAMA_BUILD_TOOLS=OFF \
673
547
  -DLLAMA_BUILD_TESTS=OFF \
674
548
  -DLLAMA_BUILD_SERVER=OFF \
675
549
  -DCMAKE_SYSTEM_NAME=tvOS \
@@ -700,6 +574,7 @@ jobs:
700
574
  -DGGML_METAL_EMBED_LIBRARY=ON \
701
575
  -DLLAMA_BUILD_COMMON=OFF \
702
576
  -DLLAMA_BUILD_EXAMPLES=OFF \
577
+ -DLLAMA_BUILD_TOOLS=OFF \
703
578
  -DLLAMA_BUILD_TESTS=OFF \
704
579
  -DLLAMA_BUILD_SERVER=OFF \
705
580
  -DCMAKE_SYSTEM_NAME=visionOS \
@@ -740,6 +615,7 @@ jobs:
740
615
  -DGGML_METAL_EMBED_LIBRARY=ON \
741
616
  -DLLAMA_CURL=OFF \
742
617
  -DLLAMA_BUILD_EXAMPLES=OFF \
618
+ -DLLAMA_BUILD_TOOLS=OFF \
743
619
  -DLLAMA_BUILD_TESTS=OFF \
744
620
  -DLLAMA_BUILD_SERVER=OFF \
745
621
  -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
@@ -768,7 +644,7 @@ jobs:
768
644
  uses: hendrikmuhs/ccache-action@v1.2.16
769
645
  with:
770
646
  key: windows-msys2
771
- variant: sccache
647
+ variant: ccache
772
648
  evict-old-files: 1d
773
649
 
774
650
  - name: Setup ${{ matrix.sys }}
@@ -811,39 +687,29 @@ jobs:
811
687
  strategy:
812
688
  matrix:
813
689
  include:
814
- - build: 'noavx-x64'
815
- defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF'
816
- - build: 'avx2-x64'
817
- defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON'
818
- - build: 'avx-x64'
819
- defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_AVX2=OFF'
820
- - build: 'avx512-x64'
821
- defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_AVX512=ON'
690
+ - build: 'cpu-x64'
691
+ defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_OPENMP=OFF'
822
692
  - build: 'openblas-x64'
823
- defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"'
824
- - build: 'kompute-x64'
825
- defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_KOMPUTE=ON -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON'
693
+ defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_OPENMP=OFF -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"'
826
694
  - build: 'vulkan-x64'
827
- defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_VULKAN=ON'
695
+ defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_VULKAN=ON'
828
696
  - build: 'llvm-arm64'
829
697
  defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON'
830
- - build: 'msvc-arm64'
831
- defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-msvc.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON'
832
698
  - build: 'llvm-arm64-opencl-adreno'
833
699
  defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" -DGGML_OPENCL=ON -DGGML_OPENCL_USE_ADRENO_KERNELS=ON'
700
+ # - build: 'kompute-x64'
701
+ # defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_OPENMP=OFF -DGGML_KOMPUTE=ON -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON'
834
702
 
835
703
  steps:
836
704
  - name: Clone
837
705
  id: checkout
838
706
  uses: actions/checkout@v4
839
- with:
840
- fetch-depth: 0
841
707
 
842
708
  - name: ccache
843
709
  uses: hendrikmuhs/ccache-action@v1.2.16
844
710
  with:
845
711
  key: windows-latest-cmake-${{ matrix.build }}
846
- variant: sccache
712
+ variant: ccache
847
713
  evict-old-files: 1d
848
714
 
849
715
  - name: Clone Kompute submodule
@@ -919,68 +785,26 @@ jobs:
919
785
  cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release/openblas.dll
920
786
  cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release/OpenBLAS-${env:OPENBLAS_VERSION}.txt
921
787
 
922
- - name: Check AVX512F support
923
- id: check_avx512f
924
- if: ${{ matrix.build == 'avx512-x64' }}
925
- continue-on-error: true
926
- run: |
927
- cd build
928
- $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
929
- $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
930
- $cl = $(join-path $msvc 'bin\Hostx64\x64\cl.exe')
931
- echo 'int main(void){unsigned int a[4];__cpuid(a,7);return !(a[1]&65536);}' >> avx512f.c
932
- & $cl /O2 /GS- /kernel avx512f.c /link /nodefaultlib /entry:main
933
- .\avx512f.exe && echo "AVX512F: YES" && ( echo HAS_AVX512F=1 >> $env:GITHUB_ENV ) || echo "AVX512F: NO"
934
-
935
788
  - name: Test
936
789
  id: cmake_test
937
- # not all machines have native AVX-512
938
- if: ${{ matrix.build != 'msvc-arm64' && matrix.build != 'llvm-arm64' && matrix.build != 'llvm-arm64-opencl-adreno' && matrix.build != 'kompute-x64' && matrix.build != 'vulkan-x64' && (matrix.build != 'avx512-x64' || env.HAS_AVX512F == '1') }}
790
+ if: ${{ matrix.build != 'llvm-arm64' && matrix.build != 'llvm-arm64-opencl-adreno' }}
939
791
  run: |
940
792
  cd build
941
793
  ctest -L main -C Release --verbose --timeout 900
942
794
 
943
- - name: Test (Intel SDE)
944
- id: cmake_test_sde
945
- if: ${{ matrix.build == 'avx512-x64' && env.HAS_AVX512F == '0' }} # use Intel SDE for AVX-512 emulation
946
- run: |
947
- curl.exe -o $env:RUNNER_TEMP/sde.tar.xz -L "https://downloadmirror.intel.com/813591/sde-external-${env:SDE_VERSION}-win.tar.xz"
948
- # for some weird reason windows tar doesn't like sde tar.xz
949
- 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar.xz
950
- 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar
951
- $sde = $(join-path $env:RUNNER_TEMP sde-external-${env:SDE_VERSION}-win/sde.exe)
952
- cd build
953
- $env:LLAMA_SKIP_TESTS_SLOW_ON_EMULATOR = 1
954
- & $sde -future -- ctest -L main -C Release --verbose --timeout 900
955
-
956
- - name: Determine tag name
957
- id: tag
958
- shell: bash
959
- run: |
960
- BUILD_NUMBER="$(git rev-list --count HEAD)"
961
- SHORT_HASH="$(git rev-parse --short=7 HEAD)"
962
- if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
963
- echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
964
- else
965
- SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
966
- echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
967
- fi
968
-
969
- - name: Pack artifacts
970
- id: pack_artifacts
971
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
972
- env:
973
- CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
974
- run: |
975
- Copy-Item $env:CURL_PATH\bin\libcurl-x64.dll .\build\bin\Release\libcurl-x64.dll
976
- 7z a llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}.zip .\build\bin\Release\*
977
-
978
- - name: Upload artifacts
979
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
980
- uses: actions/upload-artifact@v4
981
- with:
982
- path: llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}.zip
983
- name: llama-bin-win-${{ matrix.build }}.zip
795
+ # TODO: disabled for now, consider adding tests for all CPU variants instead
796
+ # - name: Test (Intel SDE)
797
+ # id: cmake_test_sde
798
+ # if: ${{ matrix.build == 'avx512-x64' && env.HAS_AVX512F == '0' }} # use Intel SDE for AVX-512 emulation
799
+ # run: |
800
+ # curl.exe -o $env:RUNNER_TEMP/sde.tar.xz -L "https://downloadmirror.intel.com/813591/sde-external-${env:SDE_VERSION}-win.tar.xz"
801
+ # # for some weird reason windows tar doesn't like sde tar.xz
802
+ # 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar.xz
803
+ # 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar
804
+ # $sde = $(join-path $env:RUNNER_TEMP sde-external-${env:SDE_VERSION}-win/sde.exe)
805
+ # cd build
806
+ # $env:LLAMA_SKIP_TESTS_SLOW_ON_EMULATOR = 1
807
+ # & $sde -future -- ctest -L main -C Release --verbose --timeout 900
984
808
 
985
809
  ubuntu-latest-cmake-cuda:
986
810
  runs-on: ubuntu-latest
@@ -990,8 +814,6 @@ jobs:
990
814
  - name: Clone
991
815
  id: checkout
992
816
  uses: actions/checkout@v4
993
- with:
994
- fetch-depth: 0
995
817
 
996
818
  - name: Install dependencies
997
819
  env:
@@ -1023,77 +845,23 @@ jobs:
1023
845
  strategy:
1024
846
  matrix:
1025
847
  cuda: ['12.4', '11.7']
1026
- build: ['cuda']
1027
848
 
1028
849
  steps:
1029
850
  - name: Clone
1030
851
  id: checkout
1031
852
  uses: actions/checkout@v4
1032
- with:
1033
- fetch-depth: 0
1034
853
 
1035
854
  - name: Install ccache
1036
855
  uses: hendrikmuhs/ccache-action@v1.2.16
1037
856
  with:
1038
- key: ${{ github.job }}-${{ matrix.cuda }}-${{ matrix.build }}
1039
- variant: sccache
857
+ key: windows-cuda-${{ matrix.cuda }}
858
+ variant: ccache
1040
859
  evict-old-files: 1d
1041
860
 
1042
- - name: Install Cuda Toolkit 11.7
1043
- if: ${{ matrix.cuda == '11.7' }}
1044
- run: |
1045
- mkdir -p "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7"
1046
- choco install unzip -y
1047
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-11.7.99-archive.zip"
1048
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvcc/windows-x86_64/cuda_nvcc-windows-x86_64-11.7.99-archive.zip"
1049
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvrtc/windows-x86_64/cuda_nvrtc-windows-x86_64-11.7.99-archive.zip"
1050
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/libcublas/windows-x86_64/libcublas-windows-x86_64-11.7.4.6-archive.zip"
1051
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvtx/windows-x86_64/cuda_nvtx-windows-x86_64-11.7.91-archive.zip"
1052
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/visual_studio_integration/windows-x86_64/visual_studio_integration-windows-x86_64-11.7.91-archive.zip"
1053
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvprof/windows-x86_64/cuda_nvprof-windows-x86_64-11.7.101-archive.zip"
1054
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cccl/windows-x86_64/cuda_cccl-windows-x86_64-11.7.91-archive.zip"
1055
- unzip '*.zip' -d "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7"
1056
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_cudart-windows-x86_64-11.7.99-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
1057
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvcc-windows-x86_64-11.7.99-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
1058
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvrtc-windows-x86_64-11.7.99-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
1059
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\libcublas-windows-x86_64-11.7.4.6-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
1060
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvtx-windows-x86_64-11.7.91-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
1061
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\visual_studio_integration-windows-x86_64-11.7.91-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
1062
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvprof-windows-x86_64-11.7.101-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
1063
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_cccl-windows-x86_64-11.7.91-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
1064
- echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
1065
- echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
1066
- echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
1067
- echo "CUDA_PATH_V11_7=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
1068
-
1069
- - name: Install Cuda Toolkit 12.4
1070
- if: ${{ matrix.cuda == '12.4' }}
1071
- run: |
1072
- mkdir -p "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4"
1073
- choco install unzip -y
1074
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-12.4.127-archive.zip"
1075
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvcc/windows-x86_64/cuda_nvcc-windows-x86_64-12.4.131-archive.zip"
1076
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvrtc/windows-x86_64/cuda_nvrtc-windows-x86_64-12.4.127-archive.zip"
1077
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/libcublas/windows-x86_64/libcublas-windows-x86_64-12.4.5.8-archive.zip"
1078
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvtx/windows-x86_64/cuda_nvtx-windows-x86_64-12.4.127-archive.zip"
1079
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_profiler_api/windows-x86_64/cuda_profiler_api-windows-x86_64-12.4.127-archive.zip"
1080
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/visual_studio_integration/windows-x86_64/visual_studio_integration-windows-x86_64-12.4.127-archive.zip"
1081
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvprof/windows-x86_64/cuda_nvprof-windows-x86_64-12.4.127-archive.zip"
1082
- curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cccl/windows-x86_64/cuda_cccl-windows-x86_64-12.4.127-archive.zip"
1083
- unzip '*.zip' -d "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4"
1084
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_cudart-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
1085
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvcc-windows-x86_64-12.4.131-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
1086
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvrtc-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
1087
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\libcublas-windows-x86_64-12.4.5.8-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
1088
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvtx-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
1089
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_profiler_api-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
1090
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\visual_studio_integration-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
1091
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvprof-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
1092
- xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_cccl-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
1093
- echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
1094
- echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
1095
- echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
1096
- echo "CUDA_PATH_V12_4=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
861
+ - name: Install Cuda Toolkit
862
+ uses: ./.github/actions/windows-setup-cuda
863
+ with:
864
+ cuda_version: ${{ matrix.cuda }}
1097
865
 
1098
866
  - name: Install Ninja
1099
867
  id: install_ninja
@@ -1114,6 +882,8 @@ jobs:
1114
882
  cmake -S . -B build -G "Ninja Multi-Config" ^
1115
883
  -DLLAMA_BUILD_SERVER=ON ^
1116
884
  -DGGML_NATIVE=OFF ^
885
+ -DGGML_BACKEND_DL=ON ^
886
+ -DGGML_CPU_ALL_VARIANTS=ON ^
1117
887
  -DGGML_CUDA=ON ^
1118
888
  -DGGML_RPC=ON ^
1119
889
  -DCURL_LIBRARY="%CURL_PATH%/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="%CURL_PATH%/include"
@@ -1121,51 +891,6 @@ jobs:
1121
891
  cmake --build build --config Release -j %NINJA_JOBS% -t ggml
1122
892
  cmake --build build --config Release
1123
893
 
1124
- - name: Determine tag name
1125
- id: tag
1126
- shell: bash
1127
- run: |
1128
- BUILD_NUMBER="$(git rev-list --count HEAD)"
1129
- SHORT_HASH="$(git rev-parse --short=7 HEAD)"
1130
- if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
1131
- echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
1132
- else
1133
- SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
1134
- echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
1135
- fi
1136
-
1137
- - name: Pack artifacts
1138
- id: pack_artifacts
1139
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
1140
- env:
1141
- CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
1142
- run: |
1143
- cp $env:CURL_PATH\bin\libcurl-x64.dll .\build\bin\Release\libcurl-x64.dll
1144
- 7z a llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip .\build\bin\Release\*
1145
-
1146
- - name: Upload artifacts
1147
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
1148
- uses: actions/upload-artifact@v4
1149
- with:
1150
- path: llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip
1151
- name: llama-bin-win-cu${{ matrix.cuda }}-x64.zip
1152
-
1153
- - name: Copy and pack Cuda runtime
1154
- if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
1155
- run: |
1156
- echo "Cuda install location: ${{ env.CUDA_PATH }}"
1157
- $dst='.\build\bin\cudart\'
1158
- robocopy "${{env.CUDA_PATH}}\bin" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
1159
- robocopy "${{env.CUDA_PATH}}\lib" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
1160
- 7z a cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip $dst\*
1161
-
1162
- - name: Upload Cuda runtime
1163
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
1164
- uses: actions/upload-artifact@v4
1165
- with:
1166
- path: cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip
1167
- name: cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip
1168
-
1169
894
  windows-latest-cmake-sycl:
1170
895
  runs-on: windows-latest
1171
896
 
@@ -1181,14 +906,12 @@ jobs:
1181
906
  - name: Clone
1182
907
  id: checkout
1183
908
  uses: actions/checkout@v4
1184
- with:
1185
- fetch-depth: 0
1186
909
 
1187
910
  - name: ccache
1188
911
  uses: hendrikmuhs/ccache-action@v1.2.16
1189
912
  with:
1190
913
  key: windows-latest-cmake-sycl
1191
- variant: sccache
914
+ variant: ccache
1192
915
  evict-old-files: 1d
1193
916
 
1194
917
  - name: Install
@@ -1201,52 +924,6 @@ jobs:
1201
924
  id: cmake_build
1202
925
  run: examples/sycl/win-build-sycl.bat
1203
926
 
1204
- - name: Determine tag name
1205
- id: tag
1206
- shell: bash
1207
- run: |
1208
- BUILD_NUMBER="$(git rev-list --count HEAD)"
1209
- SHORT_HASH="$(git rev-parse --short=7 HEAD)"
1210
- if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
1211
- echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
1212
- else
1213
- SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
1214
- echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
1215
- fi
1216
-
1217
- - name: Build the release package
1218
- id: pack_artifacts
1219
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
1220
- run: |
1221
- echo "cp oneAPI running time dll files in ${{ env.ONEAPI_ROOT }} to ./build/bin"
1222
-
1223
- cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_sycl_blas.5.dll" ./build/bin
1224
- cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_core.2.dll" ./build/bin
1225
- cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_tbb_thread.2.dll" ./build/bin
1226
-
1227
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_adapter_level_zero.dll" ./build/bin
1228
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_adapter_opencl.dll" ./build/bin
1229
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_loader.dll" ./build/bin
1230
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_win_proxy_loader.dll" ./build/bin
1231
-
1232
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/sycl8.dll" ./build/bin
1233
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/svml_dispmd.dll" ./build/bin
1234
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libmmd.dll" ./build/bin
1235
- cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libiomp5md.dll" ./build/bin
1236
-
1237
- cp "${{ env.ONEAPI_ROOT }}/dnnl/latest/bin/dnnl.dll" ./build/bin
1238
- cp "${{ env.ONEAPI_ROOT }}/tbb/latest/bin/tbb12.dll" ./build/bin
1239
-
1240
- echo "cp oneAPI running time dll files to ./build/bin done"
1241
- 7z a llama-${{ steps.tag.outputs.name }}-bin-win-sycl-x64.zip ./build/bin/*
1242
-
1243
- - name: Upload the release package
1244
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
1245
- uses: actions/upload-artifact@v4
1246
- with:
1247
- path: llama-${{ steps.tag.outputs.name }}-bin-win-sycl-x64.zip
1248
- name: llama-bin-win-sycl-x64.zip
1249
-
1250
927
  windows-latest-cmake-hip:
1251
928
  if: ${{ github.event.inputs.create_release != 'true' }}
1252
929
  runs-on: windows-latest
@@ -1304,110 +981,12 @@ jobs:
1304
981
  -DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include"
1305
982
  cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
1306
983
 
1307
- # TODO: reuse windows-latest-cmake-hip instead of duplicating this job
1308
- windows-latest-cmake-hip-release:
1309
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
1310
- runs-on: windows-latest
1311
-
1312
- strategy:
1313
- matrix:
1314
- gpu_target: [gfx1100, gfx1101, gfx1030]
1315
-
1316
- steps:
1317
- - name: Clone
1318
- id: checkout
1319
- uses: actions/checkout@v4
1320
- with:
1321
- fetch-depth: 0
1322
-
1323
- - name: Clone rocWMMA repository
1324
- id: clone_rocwmma
1325
- run: |
1326
- git clone https://github.com/rocm/rocwmma --branch rocm-6.2.4 --depth 1
1327
-
1328
- - name: ccache
1329
- uses: hendrikmuhs/ccache-action@v1.2.16
1330
- with:
1331
- key: windows-latest-cmake-hip-release
1332
- evict-old-files: 1d
1333
-
1334
- - name: Install
1335
- id: depends
1336
- run: |
1337
- $ErrorActionPreference = "Stop"
1338
- write-host "Downloading AMD HIP SDK Installer"
1339
- Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe"
1340
- write-host "Installing AMD HIP SDK"
1341
- Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -Wait
1342
- write-host "Completed AMD HIP SDK installation"
1343
-
1344
- - name: Verify ROCm
1345
- id: verify
1346
- run: |
1347
- & 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' --version
1348
-
1349
- - name: libCURL
1350
- id: get_libcurl
1351
- uses: ./.github/actions/windows-setup-curl
1352
-
1353
- - name: Build
1354
- id: cmake_build
1355
- env:
1356
- CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
1357
- run: |
1358
- $env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
1359
- $env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
1360
- cmake -G "Unix Makefiles" -B build -S . `
1361
- -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" `
1362
- -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" `
1363
- -DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/rocwmma/library/include/" `
1364
- -DCMAKE_BUILD_TYPE=Release `
1365
- -DAMDGPU_TARGETS=${{ matrix.gpu_target }} `
1366
- -DGGML_HIP_ROCWMMA_FATTN=ON `
1367
- -DGGML_HIP=ON `
1368
- -DGGML_RPC=ON `
1369
- -DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include"
1370
- cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
1371
- md "build\bin\rocblas\library\"
1372
- cp "${env:HIP_PATH}\bin\hipblas.dll" "build\bin\"
1373
- cp "${env:HIP_PATH}\bin\rocblas.dll" "build\bin\"
1374
- cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\"
1375
-
1376
- - name: Determine tag name
1377
- id: tag
1378
- shell: bash
1379
- run: |
1380
- BUILD_NUMBER="$(git rev-list --count HEAD)"
1381
- SHORT_HASH="$(git rev-parse --short=7 HEAD)"
1382
- if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
1383
- echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
1384
- else
1385
- SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
1386
- echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
1387
- fi
1388
-
1389
- - name: Pack artifacts
1390
- id: pack_artifacts
1391
- env:
1392
- CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
1393
- run: |
1394
- cp $env:CURL_PATH\bin\libcurl-x64.dll .\build\bin\libcurl-x64.dll
1395
- 7z a llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip .\build\bin\*
1396
-
1397
- - name: Upload artifacts
1398
- uses: actions/upload-artifact@v4
1399
- with:
1400
- path: llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
1401
- name: llama-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
1402
-
1403
984
  ios-xcode-build:
1404
985
  runs-on: macos-latest
1405
986
 
1406
987
  steps:
1407
988
  - name: Checkout code
1408
989
  uses: actions/checkout@v4
1409
- with:
1410
- fetch-depth: 0
1411
990
 
1412
991
  - name: Build
1413
992
  id: cmake_build
@@ -1418,6 +997,7 @@ jobs:
1418
997
  -DGGML_METAL_EMBED_LIBRARY=ON \
1419
998
  -DLLAMA_CURL=OFF \
1420
999
  -DLLAMA_BUILD_EXAMPLES=OFF \
1000
+ -DLLAMA_BUILD_TOOLS=OFF \
1421
1001
  -DLLAMA_BUILD_TESTS=OFF \
1422
1002
  -DLLAMA_BUILD_SERVER=OFF \
1423
1003
  -DCMAKE_SYSTEM_NAME=iOS \
@@ -1433,32 +1013,6 @@ jobs:
1433
1013
  - name: Build Xcode project
1434
1014
  run: xcodebuild -project examples/llama.swiftui/llama.swiftui.xcodeproj -scheme llama.swiftui -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination 'generic/platform=iOS' FRAMEWORK_FOLDER_PATH=./build-ios build
1435
1015
 
1436
- - name: Determine tag name
1437
- id: tag
1438
- shell: bash
1439
- run: |
1440
- BUILD_NUMBER="$(git rev-list --count HEAD)"
1441
- SHORT_HASH="$(git rev-parse --short=7 HEAD)"
1442
- if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
1443
- echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
1444
- else
1445
- SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
1446
- echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
1447
- fi
1448
-
1449
- - name: Pack artifacts
1450
- id: pack_artifacts
1451
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
1452
- run: |
1453
- zip --symlinks -r llama-${{ steps.tag.outputs.name }}-xcframework.zip build-apple/llama.xcframework
1454
-
1455
- - name: Upload artifacts
1456
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
1457
- uses: actions/upload-artifact@v4
1458
- with:
1459
- path: llama-${{ steps.tag.outputs.name }}-xcframework.zip
1460
- name: llama-${{ steps.tag.outputs.name }}-xcframework
1461
-
1462
1016
  android-build:
1463
1017
  runs-on: ubuntu-latest
1464
1018
 
@@ -1486,283 +1040,8 @@ jobs:
1486
1040
  - name: Build
1487
1041
  run: |
1488
1042
  cd examples/llama.android
1489
-
1490
1043
  ./gradlew build --no-daemon
1491
1044
 
1492
- release:
1493
- if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
1494
-
1495
- runs-on: ubuntu-latest
1496
-
1497
- needs:
1498
- - ubuntu-cpu-cmake
1499
- - ubuntu-22-cmake-vulkan
1500
- - windows-latest-cmake
1501
- - windows-2019-cmake-cuda
1502
- - windows-latest-cmake-sycl
1503
- - windows-latest-cmake-hip-release
1504
- - macOS-latest-cmake-arm64
1505
- - macOS-latest-cmake-x64
1506
-
1507
- steps:
1508
- - name: Clone
1509
- id: checkout
1510
- uses: actions/checkout@v4
1511
- with:
1512
- fetch-depth: 0
1513
-
1514
- - name: ccache
1515
- uses: hendrikmuhs/ccache-action@v1.2.16
1516
- with:
1517
- key: release
1518
- evict-old-files: 1d
1519
-
1520
- - name: Determine tag name
1521
- id: tag
1522
- shell: bash
1523
- run: |
1524
- BUILD_NUMBER="$(git rev-list --count HEAD)"
1525
- SHORT_HASH="$(git rev-parse --short=7 HEAD)"
1526
- if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
1527
- echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
1528
- else
1529
- SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
1530
- echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
1531
- fi
1532
-
1533
- - name: Download artifacts
1534
- id: download-artifact
1535
- uses: actions/download-artifact@v4
1536
- with:
1537
- path: ./artifact
1538
-
1539
- - name: Move artifacts
1540
- id: move_artifacts
1541
- run: mkdir -p ./artifact/release && mv ./artifact/*/*.zip ./artifact/release
1542
-
1543
- - name: Create release
1544
- id: create_release
1545
- uses: ggml-org/action-create-release@v1
1546
- env:
1547
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1548
- with:
1549
- tag_name: ${{ steps.tag.outputs.name }}
1550
-
1551
- - name: Upload release
1552
- id: upload_release
1553
- uses: actions/github-script@v3
1554
- with:
1555
- github-token: ${{secrets.GITHUB_TOKEN}}
1556
- script: |
1557
- const path = require('path');
1558
- const fs = require('fs');
1559
- const release_id = '${{ steps.create_release.outputs.id }}';
1560
- for (let file of await fs.readdirSync('./artifact/release')) {
1561
- if (path.extname(file) === '.zip') {
1562
- console.log('uploadReleaseAsset', file);
1563
- await github.repos.uploadReleaseAsset({
1564
- owner: context.repo.owner,
1565
- repo: context.repo.repo,
1566
- release_id: release_id,
1567
- name: file,
1568
- data: await fs.readFileSync(`./artifact/release/${file}`)
1569
- });
1570
- }
1571
- }
1572
-
1573
- # ubuntu-latest-gcc:
1574
- # runs-on: ubuntu-latest
1575
- #
1576
- # strategy:
1577
- # matrix:
1578
- # build: [Debug, Release]
1579
- #
1580
- # steps:
1581
- # - name: Clone
1582
- # uses: actions/checkout@v4
1583
- #
1584
- # - name: Dependencies
1585
- # run: |
1586
- # sudo apt-get update
1587
- # sudo apt-get install build-essential
1588
- # sudo apt-get install cmake
1589
- #
1590
- # - name: Configure
1591
- # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
1592
- #
1593
- # - name: Build
1594
- # run: |
1595
- # make
1596
- #
1597
- # ubuntu-latest-clang:
1598
- # runs-on: ubuntu-latest
1599
- #
1600
- # strategy:
1601
- # matrix:
1602
- # build: [Debug, Release]
1603
- #
1604
- # steps:
1605
- # - name: Clone
1606
- # uses: actions/checkout@v4
1607
- #
1608
- # - name: Dependencies
1609
- # run: |
1610
- # sudo apt-get update
1611
- # sudo apt-get install build-essential
1612
- # sudo apt-get install cmake
1613
- #
1614
- # - name: Configure
1615
- # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
1616
- #
1617
- # - name: Build
1618
- # run: |
1619
- # make
1620
- #
1621
- # ubuntu-latest-gcc-sanitized:
1622
- # runs-on: ubuntu-latest
1623
- #
1624
- # strategy:
1625
- # matrix:
1626
- # sanitizer: [ADDRESS, THREAD, UNDEFINED]
1627
- #
1628
- # steps:
1629
- # - name: Clone
1630
- # uses: actions/checkout@v4
1631
- #
1632
- # - name: Dependencies
1633
- # run: |
1634
- # sudo apt-get update
1635
- # sudo apt-get install build-essential
1636
- # sudo apt-get install cmake
1637
- #
1638
- # - name: Configure
1639
- # run: cmake . -DCMAKE_BUILD_TYPE=Debug -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON
1640
- #
1641
- # - name: Build
1642
- # run: |
1643
- # make
1644
- #
1645
- # windows:
1646
- # runs-on: windows-latest
1647
- #
1648
- # strategy:
1649
- # matrix:
1650
- # build: [Release]
1651
- # arch: [Win32, x64]
1652
- # include:
1653
- # - arch: Win32
1654
- # s2arc: x86
1655
- # - arch: x64
1656
- # s2arc: x64
1657
- #
1658
- # steps:
1659
- # - name: Clone
1660
- # uses: actions/checkout@v4
1661
- #
1662
- # - name: Add msbuild to PATH
1663
- # uses: microsoft/setup-msbuild@v1
1664
- #
1665
- # - name: Configure
1666
- # run: >
1667
- # cmake -S . -B ./build -A ${{ matrix.arch }}
1668
- # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
1669
- #
1670
- # - name: Build
1671
- # run: |
1672
- # cd ./build
1673
- # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
1674
- #
1675
- # - name: Upload binaries
1676
- # uses: actions/upload-artifact@v4
1677
- # with:
1678
- # name: llama-bin-${{ matrix.arch }}
1679
- # path: build/bin/${{ matrix.build }}
1680
- #
1681
- # windows-blas:
1682
- # runs-on: windows-latest
1683
- #
1684
- # strategy:
1685
- # matrix:
1686
- # build: [Release]
1687
- # arch: [Win32, x64]
1688
- # blas: [ON]
1689
- # include:
1690
- # - arch: Win32
1691
- # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x86.zip
1692
- # s2arc: x86
1693
- # - arch: x64
1694
- # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x64.zip
1695
- # s2arc: x64
1696
- #
1697
- # steps:
1698
- # - name: Clone
1699
- # uses: actions/checkout@v4
1700
- #
1701
- # - name: Add msbuild to PATH
1702
- # uses: microsoft/setup-msbuild@v1
1703
- #
1704
- # - name: Fetch OpenBLAS
1705
- # if: matrix.blas == 'ON'
1706
- # run: |
1707
- # C:/msys64/usr/bin/wget.exe -qO blas.zip ${{ matrix.obzip }}
1708
- # 7z x blas.zip -oblas -y
1709
- # copy blas/include/cblas.h .
1710
- # copy blas/include/openblas_config.h .
1711
- # echo "blasdir=$env:GITHUB_WORKSPACE/blas" >> $env:GITHUB_ENV
1712
- #
1713
- # - name: Configure
1714
- # run: >
1715
- # cmake -S . -B ./build -A ${{ matrix.arch }}
1716
- # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
1717
- # -DLLAMA_SUPPORT_OPENBLAS=${{ matrix.blas }}
1718
- # -DCMAKE_LIBRARY_PATH="$env:blasdir/lib"
1719
- #
1720
- # - name: Build
1721
- # run: |
1722
- # cd ./build
1723
- # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
1724
- #
1725
- # - name: Copy libopenblas.dll
1726
- # if: matrix.blas == 'ON'
1727
- # run: copy "$env:blasdir/bin/libopenblas.dll" build/bin/${{ matrix.build }}
1728
- #
1729
- # - name: Upload binaries
1730
- # if: matrix.blas == 'ON'
1731
- # uses: actions/upload-artifact@v4
1732
- # with:
1733
- # name: llama-blas-bin-${{ matrix.arch }}
1734
- # path: build/bin/${{ matrix.build }}
1735
- #
1736
- # emscripten:
1737
- # runs-on: ubuntu-latest
1738
- #
1739
- # strategy:
1740
- # matrix:
1741
- # build: [Release]
1742
- #
1743
- # steps:
1744
- # - name: Clone
1745
- # uses: actions/checkout@v4
1746
- #
1747
- # - name: Dependencies
1748
- # run: |
1749
- # wget -q https://github.com/emscripten-core/emsdk/archive/master.tar.gz
1750
- # tar -xvf master.tar.gz
1751
- # emsdk-master/emsdk update
1752
- # emsdk-master/emsdk install latest
1753
- # emsdk-master/emsdk activate latest
1754
- #
1755
- # - name: Configure
1756
- # run: echo "tmp"
1757
- #
1758
- # - name: Build
1759
- # run: |
1760
- # pushd emsdk-master
1761
- # source ./emsdk_env.sh
1762
- # popd
1763
- # emcmake cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
1764
- # make
1765
-
1766
1045
  openEuler-latest-cmake-cann:
1767
1046
  if: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'Ascend NPU') }}
1768
1047
  defaults: