@fugood/llama.node 0.6.2 → 1.0.0-beta.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 (378) hide show
  1. package/CMakeLists.txt +40 -30
  2. package/README.md +4 -1
  3. package/lib/binding.js +41 -29
  4. package/lib/binding.ts +26 -25
  5. package/package.json +45 -10
  6. package/scripts/build.js +47 -0
  7. package/scripts/llama.cpp.patch +109 -0
  8. package/src/anyascii.c +22223 -0
  9. package/src/anyascii.h +42 -0
  10. package/src/tts_utils.cpp +20 -7
  11. package/src/tts_utils.h +2 -0
  12. package/bin/darwin/arm64/llama-node.node +0 -0
  13. package/bin/darwin/x64/llama-node.node +0 -0
  14. package/bin/linux/arm64/llama-node.node +0 -0
  15. package/bin/linux/x64/llama-node.node +0 -0
  16. package/bin/linux-cuda/arm64/llama-node.node +0 -0
  17. package/bin/linux-cuda/x64/llama-node.node +0 -0
  18. package/bin/linux-vulkan/arm64/llama-node.node +0 -0
  19. package/bin/linux-vulkan/x64/llama-node.node +0 -0
  20. package/bin/win32/x64/llama-node.node +0 -0
  21. package/bin/win32/x64/node.lib +0 -0
  22. package/bin/win32-vulkan/arm64/llama-node.node +0 -0
  23. package/bin/win32-vulkan/arm64/node.lib +0 -0
  24. package/bin/win32-vulkan/x64/llama-node.node +0 -0
  25. package/bin/win32-vulkan/x64/node.lib +0 -0
  26. package/patches/node-api-headers+1.1.0.patch +0 -26
  27. package/src/llama.cpp/.github/workflows/build-linux-cross.yml +0 -233
  28. package/src/llama.cpp/.github/workflows/build.yml +0 -1078
  29. package/src/llama.cpp/.github/workflows/close-issue.yml +0 -28
  30. package/src/llama.cpp/.github/workflows/docker.yml +0 -178
  31. package/src/llama.cpp/.github/workflows/editorconfig.yml +0 -29
  32. package/src/llama.cpp/.github/workflows/gguf-publish.yml +0 -44
  33. package/src/llama.cpp/.github/workflows/labeler.yml +0 -17
  34. package/src/llama.cpp/.github/workflows/python-check-requirements.yml +0 -33
  35. package/src/llama.cpp/.github/workflows/python-lint.yml +0 -30
  36. package/src/llama.cpp/.github/workflows/python-type-check.yml +0 -40
  37. package/src/llama.cpp/.github/workflows/release.yml +0 -739
  38. package/src/llama.cpp/.github/workflows/server.yml +0 -237
  39. package/src/llama.cpp/.github/workflows/winget.yml +0 -42
  40. package/src/llama.cpp/cmake/arm64-apple-clang.cmake +0 -16
  41. package/src/llama.cpp/cmake/arm64-windows-llvm.cmake +0 -16
  42. package/src/llama.cpp/cmake/build-info.cmake +0 -64
  43. package/src/llama.cpp/cmake/common.cmake +0 -35
  44. package/src/llama.cpp/cmake/git-vars.cmake +0 -22
  45. package/src/llama.cpp/cmake/x64-windows-llvm.cmake +0 -5
  46. package/src/llama.cpp/common/build-info.cpp.in +0 -4
  47. package/src/llama.cpp/docs/build.md +0 -561
  48. package/src/llama.cpp/examples/CMakeLists.txt +0 -43
  49. package/src/llama.cpp/examples/batched/CMakeLists.txt +0 -5
  50. package/src/llama.cpp/examples/batched/batched.cpp +0 -246
  51. package/src/llama.cpp/examples/chat-13B.bat +0 -57
  52. package/src/llama.cpp/examples/convert-llama2c-to-ggml/CMakeLists.txt +0 -5
  53. package/src/llama.cpp/examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp +0 -941
  54. package/src/llama.cpp/examples/deprecation-warning/deprecation-warning.cpp +0 -35
  55. package/src/llama.cpp/examples/embedding/CMakeLists.txt +0 -5
  56. package/src/llama.cpp/examples/embedding/embedding.cpp +0 -323
  57. package/src/llama.cpp/examples/eval-callback/CMakeLists.txt +0 -10
  58. package/src/llama.cpp/examples/eval-callback/eval-callback.cpp +0 -194
  59. package/src/llama.cpp/examples/gen-docs/CMakeLists.txt +0 -5
  60. package/src/llama.cpp/examples/gen-docs/gen-docs.cpp +0 -83
  61. package/src/llama.cpp/examples/gguf/CMakeLists.txt +0 -5
  62. package/src/llama.cpp/examples/gguf/gguf.cpp +0 -265
  63. package/src/llama.cpp/examples/gguf-hash/CMakeLists.txt +0 -22
  64. package/src/llama.cpp/examples/gguf-hash/deps/rotate-bits/rotate-bits.h +0 -46
  65. package/src/llama.cpp/examples/gguf-hash/deps/sha1/sha1.c +0 -295
  66. package/src/llama.cpp/examples/gguf-hash/deps/sha1/sha1.h +0 -52
  67. package/src/llama.cpp/examples/gguf-hash/deps/sha256/sha256.c +0 -221
  68. package/src/llama.cpp/examples/gguf-hash/deps/sha256/sha256.h +0 -24
  69. package/src/llama.cpp/examples/gguf-hash/deps/xxhash/xxhash.c +0 -42
  70. package/src/llama.cpp/examples/gguf-hash/deps/xxhash/xxhash.h +0 -7093
  71. package/src/llama.cpp/examples/gguf-hash/gguf-hash.cpp +0 -694
  72. package/src/llama.cpp/examples/gritlm/CMakeLists.txt +0 -5
  73. package/src/llama.cpp/examples/gritlm/gritlm.cpp +0 -229
  74. package/src/llama.cpp/examples/jeopardy/questions.txt +0 -100
  75. package/src/llama.cpp/examples/llama.android/app/build.gradle.kts +0 -65
  76. package/src/llama.cpp/examples/llama.android/build.gradle.kts +0 -6
  77. package/src/llama.cpp/examples/llama.android/llama/build.gradle.kts +0 -71
  78. package/src/llama.cpp/examples/llama.android/llama/src/main/cpp/CMakeLists.txt +0 -53
  79. package/src/llama.cpp/examples/llama.android/llama/src/main/cpp/llama-android.cpp +0 -452
  80. package/src/llama.cpp/examples/llama.android/settings.gradle.kts +0 -18
  81. package/src/llama.cpp/examples/lookahead/CMakeLists.txt +0 -5
  82. package/src/llama.cpp/examples/lookahead/lookahead.cpp +0 -472
  83. package/src/llama.cpp/examples/lookup/CMakeLists.txt +0 -23
  84. package/src/llama.cpp/examples/lookup/lookup-create.cpp +0 -40
  85. package/src/llama.cpp/examples/lookup/lookup-merge.cpp +0 -47
  86. package/src/llama.cpp/examples/lookup/lookup-stats.cpp +0 -157
  87. package/src/llama.cpp/examples/lookup/lookup.cpp +0 -242
  88. package/src/llama.cpp/examples/parallel/CMakeLists.txt +0 -5
  89. package/src/llama.cpp/examples/parallel/parallel.cpp +0 -492
  90. package/src/llama.cpp/examples/passkey/CMakeLists.txt +0 -5
  91. package/src/llama.cpp/examples/passkey/passkey.cpp +0 -277
  92. package/src/llama.cpp/examples/retrieval/CMakeLists.txt +0 -5
  93. package/src/llama.cpp/examples/retrieval/retrieval.cpp +0 -304
  94. package/src/llama.cpp/examples/save-load-state/CMakeLists.txt +0 -5
  95. package/src/llama.cpp/examples/save-load-state/save-load-state.cpp +0 -246
  96. package/src/llama.cpp/examples/simple/CMakeLists.txt +0 -5
  97. package/src/llama.cpp/examples/simple/simple.cpp +0 -206
  98. package/src/llama.cpp/examples/simple-chat/CMakeLists.txt +0 -5
  99. package/src/llama.cpp/examples/simple-chat/simple-chat.cpp +0 -206
  100. package/src/llama.cpp/examples/simple-cmake-pkg/CMakeLists.txt +0 -11
  101. package/src/llama.cpp/examples/speculative/CMakeLists.txt +0 -5
  102. package/src/llama.cpp/examples/speculative/speculative.cpp +0 -644
  103. package/src/llama.cpp/examples/speculative-simple/CMakeLists.txt +0 -5
  104. package/src/llama.cpp/examples/speculative-simple/speculative-simple.cpp +0 -261
  105. package/src/llama.cpp/examples/sycl/CMakeLists.txt +0 -9
  106. package/src/llama.cpp/examples/sycl/build.sh +0 -23
  107. package/src/llama.cpp/examples/sycl/ls-sycl-device.cpp +0 -13
  108. package/src/llama.cpp/examples/sycl/run-llama2.sh +0 -27
  109. package/src/llama.cpp/examples/sycl/run-llama3.sh +0 -28
  110. package/src/llama.cpp/examples/sycl/win-build-sycl.bat +0 -33
  111. package/src/llama.cpp/examples/sycl/win-run-llama2.bat +0 -9
  112. package/src/llama.cpp/examples/sycl/win-run-llama3.bat +0 -9
  113. package/src/llama.cpp/examples/training/CMakeLists.txt +0 -5
  114. package/src/llama.cpp/examples/training/finetune.cpp +0 -96
  115. package/src/llama.cpp/ggml/cmake/GitVars.cmake +0 -22
  116. package/src/llama.cpp/ggml/cmake/common.cmake +0 -26
  117. package/src/llama.cpp/ggml/src/ggml-alloc.c +0 -1042
  118. package/src/llama.cpp/ggml/src/ggml-backend-impl.h +0 -255
  119. package/src/llama.cpp/ggml/src/ggml-backend-reg.cpp +0 -586
  120. package/src/llama.cpp/ggml/src/ggml-backend.cpp +0 -2008
  121. package/src/llama.cpp/ggml/src/ggml-blas/CMakeLists.txt +0 -87
  122. package/src/llama.cpp/ggml/src/ggml-blas/ggml-blas.cpp +0 -517
  123. package/src/llama.cpp/ggml/src/ggml-cann/CMakeLists.txt +0 -74
  124. package/src/llama.cpp/ggml/src/ggml-cann/acl_tensor.cpp +0 -179
  125. package/src/llama.cpp/ggml/src/ggml-cann/acl_tensor.h +0 -258
  126. package/src/llama.cpp/ggml/src/ggml-cann/aclnn_ops.cpp +0 -2863
  127. package/src/llama.cpp/ggml/src/ggml-cann/aclnn_ops.h +0 -1110
  128. package/src/llama.cpp/ggml/src/ggml-cann/common.h +0 -420
  129. package/src/llama.cpp/ggml/src/ggml-cann/ggml-cann.cpp +0 -2570
  130. package/src/llama.cpp/ggml/src/ggml-common.h +0 -1857
  131. package/src/llama.cpp/ggml/src/ggml-cpu/cmake/FindSIMD.cmake +0 -100
  132. package/src/llama.cpp/ggml/src/ggml-cuda/CMakeLists.txt +0 -184
  133. package/src/llama.cpp/ggml/src/ggml-cuda/vendors/cuda.h +0 -15
  134. package/src/llama.cpp/ggml/src/ggml-cuda/vendors/hip.h +0 -243
  135. package/src/llama.cpp/ggml/src/ggml-cuda/vendors/musa.h +0 -140
  136. package/src/llama.cpp/ggml/src/ggml-hip/CMakeLists.txt +0 -131
  137. package/src/llama.cpp/ggml/src/ggml-impl.h +0 -601
  138. package/src/llama.cpp/ggml/src/ggml-kompute/CMakeLists.txt +0 -166
  139. package/src/llama.cpp/ggml/src/ggml-kompute/ggml-kompute.cpp +0 -2251
  140. package/src/llama.cpp/ggml/src/ggml-metal/CMakeLists.txt +0 -120
  141. package/src/llama.cpp/ggml/src/ggml-metal/ggml-metal-impl.h +0 -622
  142. package/src/llama.cpp/ggml/src/ggml-musa/CMakeLists.txt +0 -113
  143. package/src/llama.cpp/ggml/src/ggml-opencl/CMakeLists.txt +0 -96
  144. package/src/llama.cpp/ggml/src/ggml-opencl/ggml-opencl.cpp +0 -5124
  145. package/src/llama.cpp/ggml/src/ggml-opt.cpp +0 -1037
  146. package/src/llama.cpp/ggml/src/ggml-quants.c +0 -5232
  147. package/src/llama.cpp/ggml/src/ggml-quants.h +0 -100
  148. package/src/llama.cpp/ggml/src/ggml-rpc/CMakeLists.txt +0 -9
  149. package/src/llama.cpp/ggml/src/ggml-rpc/ggml-rpc.cpp +0 -1813
  150. package/src/llama.cpp/ggml/src/ggml-sycl/CMakeLists.txt +0 -189
  151. package/src/llama.cpp/ggml/src/ggml-sycl/backend.hpp +0 -37
  152. package/src/llama.cpp/ggml/src/ggml-sycl/binbcast.cpp +0 -239
  153. package/src/llama.cpp/ggml/src/ggml-sycl/binbcast.hpp +0 -39
  154. package/src/llama.cpp/ggml/src/ggml-sycl/common.cpp +0 -83
  155. package/src/llama.cpp/ggml/src/ggml-sycl/common.hpp +0 -493
  156. package/src/llama.cpp/ggml/src/ggml-sycl/concat.cpp +0 -197
  157. package/src/llama.cpp/ggml/src/ggml-sycl/concat.hpp +0 -20
  158. package/src/llama.cpp/ggml/src/ggml-sycl/conv.cpp +0 -100
  159. package/src/llama.cpp/ggml/src/ggml-sycl/conv.hpp +0 -20
  160. package/src/llama.cpp/ggml/src/ggml-sycl/convert.cpp +0 -623
  161. package/src/llama.cpp/ggml/src/ggml-sycl/convert.hpp +0 -34
  162. package/src/llama.cpp/ggml/src/ggml-sycl/cpy.cpp +0 -701
  163. package/src/llama.cpp/ggml/src/ggml-sycl/cpy.hpp +0 -11
  164. package/src/llama.cpp/ggml/src/ggml-sycl/dequantize.hpp +0 -791
  165. package/src/llama.cpp/ggml/src/ggml-sycl/dmmv.cpp +0 -1160
  166. package/src/llama.cpp/ggml/src/ggml-sycl/dmmv.hpp +0 -27
  167. package/src/llama.cpp/ggml/src/ggml-sycl/dpct/helper.hpp +0 -2957
  168. package/src/llama.cpp/ggml/src/ggml-sycl/element_wise.cpp +0 -1536
  169. package/src/llama.cpp/ggml/src/ggml-sycl/element_wise.hpp +0 -75
  170. package/src/llama.cpp/ggml/src/ggml-sycl/gemm.hpp +0 -99
  171. package/src/llama.cpp/ggml/src/ggml-sycl/getrows.cpp +0 -311
  172. package/src/llama.cpp/ggml/src/ggml-sycl/getrows.hpp +0 -20
  173. package/src/llama.cpp/ggml/src/ggml-sycl/ggml-sycl.cpp +0 -4443
  174. package/src/llama.cpp/ggml/src/ggml-sycl/gla.cpp +0 -105
  175. package/src/llama.cpp/ggml/src/ggml-sycl/gla.hpp +0 -8
  176. package/src/llama.cpp/ggml/src/ggml-sycl/im2col.cpp +0 -136
  177. package/src/llama.cpp/ggml/src/ggml-sycl/im2col.hpp +0 -21
  178. package/src/llama.cpp/ggml/src/ggml-sycl/mmq.cpp +0 -3030
  179. package/src/llama.cpp/ggml/src/ggml-sycl/mmq.hpp +0 -33
  180. package/src/llama.cpp/ggml/src/ggml-sycl/mmvq.cpp +0 -1108
  181. package/src/llama.cpp/ggml/src/ggml-sycl/mmvq.hpp +0 -27
  182. package/src/llama.cpp/ggml/src/ggml-sycl/norm.cpp +0 -474
  183. package/src/llama.cpp/ggml/src/ggml-sycl/norm.hpp +0 -26
  184. package/src/llama.cpp/ggml/src/ggml-sycl/outprod.cpp +0 -46
  185. package/src/llama.cpp/ggml/src/ggml-sycl/outprod.hpp +0 -10
  186. package/src/llama.cpp/ggml/src/ggml-sycl/presets.hpp +0 -74
  187. package/src/llama.cpp/ggml/src/ggml-sycl/quants.hpp +0 -83
  188. package/src/llama.cpp/ggml/src/ggml-sycl/rope.cpp +0 -362
  189. package/src/llama.cpp/ggml/src/ggml-sycl/rope.hpp +0 -20
  190. package/src/llama.cpp/ggml/src/ggml-sycl/softmax.cpp +0 -264
  191. package/src/llama.cpp/ggml/src/ggml-sycl/softmax.hpp +0 -20
  192. package/src/llama.cpp/ggml/src/ggml-sycl/sycl_hw.cpp +0 -13
  193. package/src/llama.cpp/ggml/src/ggml-sycl/sycl_hw.hpp +0 -23
  194. package/src/llama.cpp/ggml/src/ggml-sycl/tsembd.cpp +0 -73
  195. package/src/llama.cpp/ggml/src/ggml-sycl/tsembd.hpp +0 -20
  196. package/src/llama.cpp/ggml/src/ggml-sycl/vecdotq.hpp +0 -1215
  197. package/src/llama.cpp/ggml/src/ggml-sycl/wkv.cpp +0 -305
  198. package/src/llama.cpp/ggml/src/ggml-sycl/wkv.hpp +0 -10
  199. package/src/llama.cpp/ggml/src/ggml-threading.cpp +0 -12
  200. package/src/llama.cpp/ggml/src/ggml-threading.h +0 -14
  201. package/src/llama.cpp/ggml/src/ggml-vulkan/CMakeLists.txt +0 -196
  202. package/src/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp +0 -10699
  203. package/src/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/CMakeLists.txt +0 -39
  204. package/src/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp +0 -751
  205. package/src/llama.cpp/ggml/src/ggml.c +0 -6550
  206. package/src/llama.cpp/ggml/src/gguf.cpp +0 -1330
  207. package/src/llama.cpp/models/.editorconfig +0 -1
  208. package/src/llama.cpp/models/ggml-vocab-aquila.gguf +0 -0
  209. package/src/llama.cpp/models/ggml-vocab-baichuan.gguf +0 -0
  210. package/src/llama.cpp/models/ggml-vocab-bert-bge.gguf +0 -0
  211. package/src/llama.cpp/models/ggml-vocab-bert-bge.gguf.inp +0 -112
  212. package/src/llama.cpp/models/ggml-vocab-bert-bge.gguf.out +0 -46
  213. package/src/llama.cpp/models/ggml-vocab-chameleon.gguf.inp +0 -112
  214. package/src/llama.cpp/models/ggml-vocab-chameleon.gguf.out +0 -46
  215. package/src/llama.cpp/models/ggml-vocab-command-r.gguf +0 -0
  216. package/src/llama.cpp/models/ggml-vocab-command-r.gguf.inp +0 -112
  217. package/src/llama.cpp/models/ggml-vocab-command-r.gguf.out +0 -46
  218. package/src/llama.cpp/models/ggml-vocab-deepseek-coder.gguf +0 -0
  219. package/src/llama.cpp/models/ggml-vocab-deepseek-coder.gguf.inp +0 -112
  220. package/src/llama.cpp/models/ggml-vocab-deepseek-coder.gguf.out +0 -46
  221. package/src/llama.cpp/models/ggml-vocab-deepseek-llm.gguf +0 -0
  222. package/src/llama.cpp/models/ggml-vocab-deepseek-llm.gguf.inp +0 -112
  223. package/src/llama.cpp/models/ggml-vocab-deepseek-llm.gguf.out +0 -46
  224. package/src/llama.cpp/models/ggml-vocab-deepseek-r1-qwen.gguf.inp +0 -112
  225. package/src/llama.cpp/models/ggml-vocab-deepseek-r1-qwen.gguf.out +0 -46
  226. package/src/llama.cpp/models/ggml-vocab-falcon.gguf +0 -0
  227. package/src/llama.cpp/models/ggml-vocab-falcon.gguf.inp +0 -112
  228. package/src/llama.cpp/models/ggml-vocab-falcon.gguf.out +0 -46
  229. package/src/llama.cpp/models/ggml-vocab-gpt-2.gguf +0 -0
  230. package/src/llama.cpp/models/ggml-vocab-gpt-2.gguf.inp +0 -112
  231. package/src/llama.cpp/models/ggml-vocab-gpt-2.gguf.out +0 -46
  232. package/src/llama.cpp/models/ggml-vocab-gpt-4o.gguf.inp +0 -112
  233. package/src/llama.cpp/models/ggml-vocab-gpt-4o.gguf.out +0 -46
  234. package/src/llama.cpp/models/ggml-vocab-gpt-neox.gguf +0 -0
  235. package/src/llama.cpp/models/ggml-vocab-llama-bpe.gguf +0 -0
  236. package/src/llama.cpp/models/ggml-vocab-llama-bpe.gguf.inp +0 -112
  237. package/src/llama.cpp/models/ggml-vocab-llama-bpe.gguf.out +0 -46
  238. package/src/llama.cpp/models/ggml-vocab-llama-spm.gguf +0 -0
  239. package/src/llama.cpp/models/ggml-vocab-llama-spm.gguf.inp +0 -112
  240. package/src/llama.cpp/models/ggml-vocab-llama-spm.gguf.out +0 -46
  241. package/src/llama.cpp/models/ggml-vocab-llama4.gguf.inp +0 -112
  242. package/src/llama.cpp/models/ggml-vocab-llama4.gguf.out +0 -46
  243. package/src/llama.cpp/models/ggml-vocab-mpt.gguf +0 -0
  244. package/src/llama.cpp/models/ggml-vocab-mpt.gguf.inp +0 -112
  245. package/src/llama.cpp/models/ggml-vocab-mpt.gguf.out +0 -46
  246. package/src/llama.cpp/models/ggml-vocab-phi-3.gguf +0 -0
  247. package/src/llama.cpp/models/ggml-vocab-phi-3.gguf.inp +0 -112
  248. package/src/llama.cpp/models/ggml-vocab-phi-3.gguf.out +0 -46
  249. package/src/llama.cpp/models/ggml-vocab-pixtral.gguf.inp +0 -112
  250. package/src/llama.cpp/models/ggml-vocab-pixtral.gguf.out +0 -46
  251. package/src/llama.cpp/models/ggml-vocab-qwen2.gguf +0 -0
  252. package/src/llama.cpp/models/ggml-vocab-qwen2.gguf.inp +0 -112
  253. package/src/llama.cpp/models/ggml-vocab-qwen2.gguf.out +0 -46
  254. package/src/llama.cpp/models/ggml-vocab-refact.gguf +0 -0
  255. package/src/llama.cpp/models/ggml-vocab-refact.gguf.inp +0 -112
  256. package/src/llama.cpp/models/ggml-vocab-refact.gguf.out +0 -46
  257. package/src/llama.cpp/models/ggml-vocab-roberta-bpe.gguf.inp +0 -112
  258. package/src/llama.cpp/models/ggml-vocab-roberta-bpe.gguf.out +0 -46
  259. package/src/llama.cpp/models/ggml-vocab-starcoder.gguf +0 -0
  260. package/src/llama.cpp/models/ggml-vocab-starcoder.gguf.inp +0 -112
  261. package/src/llama.cpp/models/ggml-vocab-starcoder.gguf.out +0 -46
  262. package/src/llama.cpp/pocs/CMakeLists.txt +0 -14
  263. package/src/llama.cpp/pocs/vdot/CMakeLists.txt +0 -9
  264. package/src/llama.cpp/pocs/vdot/q8dot.cpp +0 -173
  265. package/src/llama.cpp/pocs/vdot/vdot.cpp +0 -311
  266. package/src/llama.cpp/prompts/LLM-questions.txt +0 -49
  267. package/src/llama.cpp/prompts/alpaca.txt +0 -1
  268. package/src/llama.cpp/prompts/assistant.txt +0 -31
  269. package/src/llama.cpp/prompts/chat-with-baichuan.txt +0 -4
  270. package/src/llama.cpp/prompts/chat-with-bob.txt +0 -7
  271. package/src/llama.cpp/prompts/chat-with-qwen.txt +0 -1
  272. package/src/llama.cpp/prompts/chat-with-vicuna-v0.txt +0 -7
  273. package/src/llama.cpp/prompts/chat-with-vicuna-v1.txt +0 -7
  274. package/src/llama.cpp/prompts/chat.txt +0 -28
  275. package/src/llama.cpp/prompts/dan-modified.txt +0 -1
  276. package/src/llama.cpp/prompts/dan.txt +0 -1
  277. package/src/llama.cpp/prompts/mnemonics.txt +0 -93
  278. package/src/llama.cpp/prompts/parallel-questions.txt +0 -43
  279. package/src/llama.cpp/prompts/reason-act.txt +0 -18
  280. package/src/llama.cpp/requirements/requirements-all.txt +0 -15
  281. package/src/llama.cpp/requirements/requirements-compare-llama-bench.txt +0 -2
  282. package/src/llama.cpp/requirements/requirements-convert_hf_to_gguf.txt +0 -7
  283. package/src/llama.cpp/requirements/requirements-convert_hf_to_gguf_update.txt +0 -7
  284. package/src/llama.cpp/requirements/requirements-convert_legacy_llama.txt +0 -5
  285. package/src/llama.cpp/requirements/requirements-convert_llama_ggml_to_gguf.txt +0 -1
  286. package/src/llama.cpp/requirements/requirements-convert_lora_to_gguf.txt +0 -4
  287. package/src/llama.cpp/requirements/requirements-gguf_editor_gui.txt +0 -3
  288. package/src/llama.cpp/requirements/requirements-pydantic.txt +0 -3
  289. package/src/llama.cpp/requirements/requirements-test-tokenizer-random.txt +0 -1
  290. package/src/llama.cpp/requirements/requirements-tool_bench.txt +0 -12
  291. package/src/llama.cpp/requirements.txt +0 -13
  292. package/src/llama.cpp/scripts/build-info.sh +0 -30
  293. package/src/llama.cpp/scripts/install-oneapi.bat +0 -19
  294. package/src/llama.cpp/scripts/xxd.cmake +0 -16
  295. package/src/llama.cpp/tests/CMakeLists.txt +0 -177
  296. package/src/llama.cpp/tests/get-model.cpp +0 -21
  297. package/src/llama.cpp/tests/get-model.h +0 -2
  298. package/src/llama.cpp/tests/test-arg-parser.cpp +0 -178
  299. package/src/llama.cpp/tests/test-autorelease.cpp +0 -24
  300. package/src/llama.cpp/tests/test-backend-ops.cpp +0 -4793
  301. package/src/llama.cpp/tests/test-barrier.cpp +0 -94
  302. package/src/llama.cpp/tests/test-c.c +0 -7
  303. package/src/llama.cpp/tests/test-chat-template.cpp +0 -417
  304. package/src/llama.cpp/tests/test-chat.cpp +0 -985
  305. package/src/llama.cpp/tests/test-double-float.cpp +0 -57
  306. package/src/llama.cpp/tests/test-gbnf-validator.cpp +0 -109
  307. package/src/llama.cpp/tests/test-gguf.cpp +0 -1338
  308. package/src/llama.cpp/tests/test-grammar-integration.cpp +0 -1308
  309. package/src/llama.cpp/tests/test-grammar-llguidance.cpp +0 -1201
  310. package/src/llama.cpp/tests/test-grammar-parser.cpp +0 -519
  311. package/src/llama.cpp/tests/test-json-schema-to-grammar.cpp +0 -1304
  312. package/src/llama.cpp/tests/test-llama-grammar.cpp +0 -408
  313. package/src/llama.cpp/tests/test-log.cpp +0 -39
  314. package/src/llama.cpp/tests/test-model-load-cancel.cpp +0 -27
  315. package/src/llama.cpp/tests/test-mtmd-c-api.c +0 -63
  316. package/src/llama.cpp/tests/test-opt.cpp +0 -904
  317. package/src/llama.cpp/tests/test-quantize-fns.cpp +0 -186
  318. package/src/llama.cpp/tests/test-quantize-perf.cpp +0 -365
  319. package/src/llama.cpp/tests/test-quantize-stats.cpp +0 -424
  320. package/src/llama.cpp/tests/test-regex-partial.cpp +0 -288
  321. package/src/llama.cpp/tests/test-rope.cpp +0 -262
  322. package/src/llama.cpp/tests/test-sampling.cpp +0 -399
  323. package/src/llama.cpp/tests/test-tokenizer-0.cpp +0 -312
  324. package/src/llama.cpp/tests/test-tokenizer-1-bpe.cpp +0 -155
  325. package/src/llama.cpp/tests/test-tokenizer-1-spm.cpp +0 -125
  326. package/src/llama.cpp/tools/CMakeLists.txt +0 -39
  327. package/src/llama.cpp/tools/batched-bench/CMakeLists.txt +0 -5
  328. package/src/llama.cpp/tools/batched-bench/batched-bench.cpp +0 -204
  329. package/src/llama.cpp/tools/cvector-generator/CMakeLists.txt +0 -5
  330. package/src/llama.cpp/tools/cvector-generator/completions.txt +0 -582
  331. package/src/llama.cpp/tools/cvector-generator/cvector-generator.cpp +0 -508
  332. package/src/llama.cpp/tools/cvector-generator/mean.hpp +0 -48
  333. package/src/llama.cpp/tools/cvector-generator/negative.txt +0 -4
  334. package/src/llama.cpp/tools/cvector-generator/pca.hpp +0 -315
  335. package/src/llama.cpp/tools/cvector-generator/positive.txt +0 -4
  336. package/src/llama.cpp/tools/export-lora/CMakeLists.txt +0 -5
  337. package/src/llama.cpp/tools/export-lora/export-lora.cpp +0 -434
  338. package/src/llama.cpp/tools/gguf-split/CMakeLists.txt +0 -5
  339. package/src/llama.cpp/tools/gguf-split/gguf-split.cpp +0 -583
  340. package/src/llama.cpp/tools/imatrix/CMakeLists.txt +0 -5
  341. package/src/llama.cpp/tools/imatrix/imatrix.cpp +0 -667
  342. package/src/llama.cpp/tools/llama-bench/CMakeLists.txt +0 -5
  343. package/src/llama.cpp/tools/llama-bench/llama-bench.cpp +0 -2024
  344. package/src/llama.cpp/tools/main/CMakeLists.txt +0 -5
  345. package/src/llama.cpp/tools/main/main.cpp +0 -977
  346. package/src/llama.cpp/tools/mtmd/CMakeLists.txt +0 -58
  347. package/src/llama.cpp/tools/mtmd/clip-impl.h +0 -462
  348. package/src/llama.cpp/tools/mtmd/clip.cpp +0 -4024
  349. package/src/llama.cpp/tools/mtmd/clip.h +0 -101
  350. package/src/llama.cpp/tools/mtmd/deprecation-warning.cpp +0 -22
  351. package/src/llama.cpp/tools/mtmd/miniaudio.h +0 -93468
  352. package/src/llama.cpp/tools/mtmd/mtmd-audio.cpp +0 -855
  353. package/src/llama.cpp/tools/mtmd/mtmd-audio.h +0 -62
  354. package/src/llama.cpp/tools/mtmd/mtmd-cli.cpp +0 -377
  355. package/src/llama.cpp/tools/mtmd/mtmd-helper.cpp +0 -297
  356. package/src/llama.cpp/tools/mtmd/mtmd.cpp +0 -942
  357. package/src/llama.cpp/tools/mtmd/mtmd.h +0 -362
  358. package/src/llama.cpp/tools/mtmd/requirements.txt +0 -5
  359. package/src/llama.cpp/tools/perplexity/CMakeLists.txt +0 -5
  360. package/src/llama.cpp/tools/perplexity/perplexity.cpp +0 -2063
  361. package/src/llama.cpp/tools/quantize/CMakeLists.txt +0 -6
  362. package/src/llama.cpp/tools/quantize/quantize.cpp +0 -519
  363. package/src/llama.cpp/tools/rpc/CMakeLists.txt +0 -4
  364. package/src/llama.cpp/tools/rpc/rpc-server.cpp +0 -322
  365. package/src/llama.cpp/tools/run/CMakeLists.txt +0 -16
  366. package/src/llama.cpp/tools/run/linenoise.cpp/linenoise.cpp +0 -1995
  367. package/src/llama.cpp/tools/run/linenoise.cpp/linenoise.h +0 -137
  368. package/src/llama.cpp/tools/run/run.cpp +0 -1261
  369. package/src/llama.cpp/tools/server/CMakeLists.txt +0 -51
  370. package/src/llama.cpp/tools/server/bench/requirements.txt +0 -2
  371. package/src/llama.cpp/tools/server/httplib.h +0 -10506
  372. package/src/llama.cpp/tools/server/server.cpp +0 -4966
  373. package/src/llama.cpp/tools/server/tests/requirements.txt +0 -8
  374. package/src/llama.cpp/tools/server/utils.hpp +0 -1337
  375. package/src/llama.cpp/tools/tokenize/CMakeLists.txt +0 -5
  376. package/src/llama.cpp/tools/tokenize/tokenize.cpp +0 -416
  377. package/src/llama.cpp/tools/tts/CMakeLists.txt +0 -5
  378. package/src/llama.cpp/tools/tts/tts.cpp +0 -1092
@@ -1,1078 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- workflow_dispatch: # allows manual triggering
5
- push:
6
- branches:
7
- - master
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']
9
- pull_request:
10
- types: [opened, synchronize, reopened]
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']
12
-
13
- concurrency:
14
- group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
15
- cancel-in-progress: true
16
-
17
- env:
18
- GGML_NLOOP: 3
19
- GGML_N_THREADS: 1
20
- LLAMA_LOG_COLORS: 1
21
- LLAMA_LOG_PREFIX: 1
22
- LLAMA_LOG_TIMESTAMPS: 1
23
-
24
- jobs:
25
- macOS-latest-cmake-arm64:
26
- runs-on: macos-14
27
-
28
- steps:
29
- - name: Clone
30
- id: checkout
31
- uses: actions/checkout@v4
32
-
33
- - name: ccache
34
- uses: hendrikmuhs/ccache-action@v1.2.16
35
- with:
36
- key: macOS-latest-cmake-arm64
37
- evict-old-files: 1d
38
-
39
- - name: Dependencies
40
- id: depends
41
- continue-on-error: true
42
- run: |
43
- brew update
44
- brew install curl
45
-
46
- - name: Build
47
- id: cmake_build
48
- run: |
49
- sysctl -a
50
- cmake -B build \
51
- -DCMAKE_BUILD_RPATH="@loader_path" \
52
- -DLLAMA_FATAL_WARNINGS=ON \
53
- -DGGML_METAL_USE_BF16=ON \
54
- -DGGML_METAL_EMBED_LIBRARY=ON \
55
- -DGGML_RPC=ON
56
- cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
57
-
58
- - name: Test
59
- id: cmake_test
60
- run: |
61
- cd build
62
- ctest -L 'main|curl' --verbose --timeout 900
63
-
64
- macOS-latest-cmake-x64:
65
- runs-on: macos-13
66
-
67
- steps:
68
- - name: Clone
69
- id: checkout
70
- uses: actions/checkout@v4
71
-
72
- - name: ccache
73
- uses: hendrikmuhs/ccache-action@v1.2.16
74
- with:
75
- key: macOS-latest-cmake-x64
76
- evict-old-files: 1d
77
-
78
- - name: Dependencies
79
- id: depends
80
- continue-on-error: true
81
- run: |
82
- brew update
83
- brew install curl
84
-
85
- - name: Build
86
- id: cmake_build
87
- run: |
88
- sysctl -a
89
- # Metal is disabled due to intermittent failures with Github runners not having a GPU:
90
- # https://github.com/ggml-org/llama.cpp/actions/runs/8635935781/job/23674807267#step:5:2313
91
- cmake -B build \
92
- -DCMAKE_BUILD_RPATH="@loader_path" \
93
- -DLLAMA_FATAL_WARNINGS=ON \
94
- -DGGML_METAL=OFF \
95
- -DGGML_RPC=ON
96
- cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
97
-
98
- - name: Test
99
- id: cmake_test
100
- run: |
101
- cd build
102
- ctest -L main --verbose --timeout 900
103
-
104
- ubuntu-cpu-cmake:
105
- strategy:
106
- matrix:
107
- include:
108
- - build: 'x64'
109
- os: ubuntu-22.04
110
- - build: 'arm64'
111
- os: ubuntu-22.04-arm
112
-
113
- runs-on: ${{ matrix.os }}
114
-
115
- steps:
116
- - name: Clone
117
- id: checkout
118
- uses: actions/checkout@v4
119
-
120
- - name: ccache
121
- uses: hendrikmuhs/ccache-action@v1.2.16
122
- with:
123
- key: ubuntu-cpu-cmake
124
- evict-old-files: 1d
125
-
126
- - name: Dependencies
127
- id: depends
128
- run: |
129
- sudo apt-get update
130
- sudo apt-get install build-essential libcurl4-openssl-dev
131
-
132
- - name: Build
133
- id: cmake_build
134
- run: |
135
- cmake -B build \
136
- -DLLAMA_FATAL_WARNINGS=ON \
137
- -DGGML_RPC=ON
138
- cmake --build build --config Release -j $(nproc)
139
-
140
- - name: Test
141
- id: cmake_test
142
- run: |
143
- cd build
144
- ctest -L 'main|curl' --verbose --timeout 900
145
-
146
- - name: Test llama2c conversion
147
- id: llama2c_test
148
- run: |
149
- cd build
150
- echo "Fetch tokenizer"
151
- wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/tok512.bin
152
- echo "Fetch llama2c model"
153
- wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/stories260K.bin
154
- ./bin/llama-convert-llama2c-to-ggml --copy-vocab-from-model ./tok512.bin --llama2c-model stories260K.bin --llama2c-output-model stories260K.gguf
155
- ./bin/llama-cli -m stories260K.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
156
-
157
- ubuntu-latest-cmake-sanitizer:
158
- runs-on: ubuntu-latest
159
-
160
- continue-on-error: true
161
-
162
- strategy:
163
- matrix:
164
- sanitizer: [ADDRESS, THREAD, UNDEFINED]
165
- build_type: [Debug]
166
-
167
- steps:
168
- - name: Clone
169
- id: checkout
170
- uses: actions/checkout@v4
171
-
172
- - name: ccache
173
- uses: hendrikmuhs/ccache-action@v1.2.16
174
- with:
175
- key: ubuntu-latest-cmake-sanitizer-${{ matrix.sanitizer }}
176
- evict-old-files: 1d
177
-
178
- - name: Dependencies
179
- id: depends
180
- run: |
181
- sudo apt-get update
182
- sudo apt-get install build-essential libcurl4-openssl-dev
183
-
184
- - name: Build
185
- id: cmake_build
186
- if: ${{ matrix.sanitizer != 'THREAD' }}
187
- run: |
188
- cmake -B build \
189
- -DLLAMA_FATAL_WARNINGS=ON \
190
- -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
191
- -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
192
- cmake --build build --config ${{ matrix.build_type }} -j $(nproc)
193
-
194
- - name: Build (no OpenMP)
195
- id: cmake_build_no_openmp
196
- if: ${{ matrix.sanitizer == 'THREAD' }}
197
- run: |
198
- cmake -B build \
199
- -DLLAMA_FATAL_WARNINGS=ON \
200
- -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
201
- -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
202
- -DGGML_OPENMP=OFF
203
- cmake --build build --config ${{ matrix.build_type }} -j $(nproc)
204
-
205
- - name: Test
206
- id: cmake_test
207
- run: |
208
- cd build
209
- ctest -L main --verbose --timeout 900
210
-
211
- ubuntu-latest-llguidance:
212
- runs-on: ubuntu-latest
213
-
214
- steps:
215
- - name: Clone
216
- id: checkout
217
- uses: actions/checkout@v4
218
-
219
- - name: Dependencies
220
- id: depends
221
- run: |
222
- sudo apt-get update
223
- sudo apt-get install build-essential libcurl4-openssl-dev
224
-
225
- - name: Build
226
- id: cmake_build
227
- run: |
228
- mkdir build
229
- cd build
230
- cmake .. \
231
- -DLLAMA_FATAL_WARNINGS=ON \
232
- -DLLAMA_LLGUIDANCE=ON
233
- cmake --build . --config Release -j $(nproc)
234
-
235
- - name: Test
236
- id: cmake_test
237
- run: |
238
- cd build
239
- ctest -L main --verbose --timeout 900
240
-
241
- ubuntu-latest-cmake-rpc:
242
- runs-on: ubuntu-latest
243
-
244
- continue-on-error: true
245
-
246
- steps:
247
- - name: Clone
248
- id: checkout
249
- uses: actions/checkout@v4
250
-
251
- - name: ccache
252
- uses: hendrikmuhs/ccache-action@v1.2.16
253
- with:
254
- key: ubuntu-latest-cmake-rpc
255
- evict-old-files: 1d
256
-
257
- - name: Dependencies
258
- id: depends
259
- run: |
260
- sudo apt-get update
261
- sudo apt-get install build-essential libcurl4-openssl-dev
262
-
263
- - name: Build
264
- id: cmake_build
265
- run: |
266
- cmake -B build \
267
- -DGGML_RPC=ON
268
- cmake --build build --config Release -j $(nproc)
269
-
270
- - name: Test
271
- id: cmake_test
272
- run: |
273
- cd build
274
- ctest -L main --verbose
275
-
276
- ubuntu-22-cmake-vulkan:
277
- runs-on: ubuntu-22.04
278
-
279
- steps:
280
- - name: Clone
281
- id: checkout
282
- uses: actions/checkout@v4
283
-
284
- - name: ccache
285
- uses: hendrikmuhs/ccache-action@v1.2.16
286
- with:
287
- key: ubuntu-22-cmake-vulkan
288
- evict-old-files: 1d
289
-
290
- - name: Dependencies
291
- id: depends
292
- run: |
293
- wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
294
- sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
295
- sudo apt-get update -y
296
- sudo apt-get install -y build-essential mesa-vulkan-drivers vulkan-sdk libcurl4-openssl-dev
297
-
298
- - name: Build
299
- id: cmake_build
300
- run: |
301
- cmake -B build \
302
- -DGGML_VULKAN=ON
303
- cmake --build build --config Release -j $(nproc)
304
-
305
- - name: Test
306
- id: cmake_test
307
- run: |
308
- cd build
309
- # This is using llvmpipe and runs slower than other backends
310
- ctest -L main --verbose --timeout 3600
311
-
312
- ubuntu-22-cmake-hip:
313
- runs-on: ubuntu-22.04
314
- container: rocm/dev-ubuntu-22.04:6.0.2
315
-
316
- steps:
317
- - name: Clone
318
- id: checkout
319
- uses: actions/checkout@v4
320
-
321
- - name: Dependencies
322
- id: depends
323
- run: |
324
- sudo apt-get update
325
- sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev libcurl4-openssl-dev
326
-
327
- - name: ccache
328
- uses: hendrikmuhs/ccache-action@v1.2.16
329
- with:
330
- key: ubuntu-22-cmake-hip
331
- evict-old-files: 1d
332
-
333
- - name: Build with native CMake HIP support
334
- id: cmake_build
335
- run: |
336
- cmake -B build -S . \
337
- -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
338
- -DGGML_HIP_ROCWMMA_FATTN=ON \
339
- -DGGML_HIP=ON
340
- cmake --build build --config Release -j $(nproc)
341
-
342
- - name: Build with legacy HIP support
343
- id: cmake_build_legacy_hip
344
- run: |
345
- cmake -B build2 -S . \
346
- -DCMAKE_C_COMPILER=hipcc \
347
- -DCMAKE_CXX_COMPILER=hipcc \
348
- -DGGML_HIP_ROCWMMA_FATTN=ON \
349
- -DGGML_HIP=ON
350
- cmake --build build2 --config Release -j $(nproc)
351
-
352
- ubuntu-22-cmake-musa:
353
- runs-on: ubuntu-22.04
354
- container: mthreads/musa:rc4.0.1-mudnn-devel-ubuntu22.04
355
-
356
- steps:
357
- - name: Clone
358
- id: checkout
359
- uses: actions/checkout@v4
360
-
361
- - name: Dependencies
362
- id: depends
363
- run: |
364
- apt-get update
365
- apt-get install -y build-essential git cmake libcurl4-openssl-dev
366
-
367
- - name: ccache
368
- uses: hendrikmuhs/ccache-action@v1.2.16
369
- with:
370
- key: ubuntu-22-cmake-musa
371
- evict-old-files: 1d
372
-
373
- - name: Build with native CMake MUSA support
374
- id: cmake_build
375
- run: |
376
- cmake -B build -S . \
377
- -DGGML_MUSA=ON
378
- cmake --build build --config Release -j $(nproc)
379
-
380
- ubuntu-22-cmake-sycl:
381
- runs-on: ubuntu-22.04
382
-
383
- continue-on-error: true
384
-
385
- steps:
386
- - uses: actions/checkout@v4
387
-
388
- - name: add oneAPI to apt
389
- shell: bash
390
- run: |
391
- cd /tmp
392
- wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
393
- sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
394
- rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
395
- sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
396
-
397
- - name: install oneAPI dpcpp compiler
398
- shell: bash
399
- run: |
400
- sudo apt update
401
- sudo apt install intel-oneapi-compiler-dpcpp-cpp libcurl4-openssl-dev
402
-
403
- - name: install oneAPI MKL library
404
- shell: bash
405
- run: |
406
- sudo apt install intel-oneapi-mkl-devel
407
-
408
- - name: Clone
409
- id: checkout
410
- uses: actions/checkout@v4
411
-
412
- - name: ccache
413
- uses: hendrikmuhs/ccache-action@v1.2.16
414
- with:
415
- key: ubuntu-22-cmake-sycl
416
- evict-old-files: 1d
417
-
418
- - name: Build
419
- id: cmake_build
420
- run: |
421
- source /opt/intel/oneapi/setvars.sh
422
- cmake -B build \
423
- -DGGML_SYCL=ON \
424
- -DCMAKE_C_COMPILER=icx \
425
- -DCMAKE_CXX_COMPILER=icpx
426
- cmake --build build --config Release -j $(nproc)
427
-
428
- ubuntu-22-cmake-sycl-fp16:
429
- runs-on: ubuntu-22.04
430
-
431
- continue-on-error: true
432
-
433
- steps:
434
- - uses: actions/checkout@v4
435
-
436
- - name: add oneAPI to apt
437
- shell: bash
438
- run: |
439
- cd /tmp
440
- wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
441
- sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
442
- rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
443
- sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
444
-
445
- - name: install oneAPI dpcpp compiler
446
- shell: bash
447
- run: |
448
- sudo apt update
449
- sudo apt install intel-oneapi-compiler-dpcpp-cpp libcurl4-openssl-dev
450
-
451
- - name: install oneAPI MKL library
452
- shell: bash
453
- run: |
454
- sudo apt install intel-oneapi-mkl-devel
455
-
456
- - name: Clone
457
- id: checkout
458
- uses: actions/checkout@v4
459
-
460
- - name: ccache
461
- uses: hendrikmuhs/ccache-action@v1.2.16
462
- with:
463
- key: ubuntu-22-cmake-sycl-fp16
464
- evict-old-files: 1d
465
-
466
- - name: Build
467
- id: cmake_build
468
- run: |
469
- source /opt/intel/oneapi/setvars.sh
470
- cmake -B build \
471
- -DGGML_SYCL=ON \
472
- -DCMAKE_C_COMPILER=icx \
473
- -DCMAKE_CXX_COMPILER=icpx \
474
- -DGGML_SYCL_F16=ON
475
- cmake --build build --config Release -j $(nproc)
476
-
477
- build-linux-cross:
478
- uses: ./.github/workflows/build-linux-cross.yml
479
-
480
- macOS-latest-cmake-ios:
481
- runs-on: macos-latest
482
-
483
- steps:
484
- - name: Clone
485
- id: checkout
486
- uses: actions/checkout@v4
487
-
488
- - name: ccache
489
- uses: hendrikmuhs/ccache-action@v1.2.16
490
- with:
491
- key: macOS-latest-cmake-ios
492
- evict-old-files: 1d
493
-
494
- - name: Dependencies
495
- id: depends
496
- continue-on-error: true
497
- run: |
498
- brew update
499
-
500
- - name: Build
501
- id: cmake_build
502
- run: |
503
- sysctl -a
504
- cmake -B build -G Xcode \
505
- -DGGML_METAL_USE_BF16=ON \
506
- -DGGML_METAL_EMBED_LIBRARY=ON \
507
- -DLLAMA_BUILD_COMMON=OFF \
508
- -DLLAMA_BUILD_EXAMPLES=OFF \
509
- -DLLAMA_BUILD_TOOLS=OFF \
510
- -DLLAMA_BUILD_TESTS=OFF \
511
- -DLLAMA_BUILD_SERVER=OFF \
512
- -DCMAKE_SYSTEM_NAME=iOS \
513
- -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
514
- -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
515
- cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
516
-
517
- macOS-latest-cmake-tvos:
518
- runs-on: macos-latest
519
-
520
- steps:
521
- - name: Clone
522
- id: checkout
523
- uses: actions/checkout@v4
524
-
525
- - name: ccache
526
- uses: hendrikmuhs/ccache-action@v1.2.16
527
- with:
528
- key: macOS-latest-cmake-tvos
529
- evict-old-files: 1d
530
-
531
- - name: Dependencies
532
- id: depends
533
- continue-on-error: true
534
- run: |
535
- brew update
536
-
537
- - name: Build
538
- id: cmake_build
539
- run: |
540
- sysctl -a
541
- cmake -B build -G Xcode \
542
- -DGGML_METAL_USE_BF16=ON \
543
- -DGGML_METAL_EMBED_LIBRARY=ON \
544
- -DLLAMA_BUILD_COMMON=OFF \
545
- -DLLAMA_BUILD_EXAMPLES=OFF \
546
- -DLLAMA_BUILD_TOOLS=OFF \
547
- -DLLAMA_BUILD_TESTS=OFF \
548
- -DLLAMA_BUILD_SERVER=OFF \
549
- -DCMAKE_SYSTEM_NAME=tvOS \
550
- -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
551
- -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
552
- cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
553
-
554
- macOS-latest-cmake-visionos:
555
- runs-on: macos-latest
556
-
557
- steps:
558
- - name: Clone
559
- id: checkout
560
- uses: actions/checkout@v4
561
-
562
- - name: Dependencies
563
- id: depends
564
- continue-on-error: true
565
- run: |
566
- brew update
567
-
568
- - name: Build
569
- id: cmake_build
570
- run: |
571
- sysctl -a
572
- cmake -B build -G Xcode \
573
- -DGGML_METAL_USE_BF16=ON \
574
- -DGGML_METAL_EMBED_LIBRARY=ON \
575
- -DLLAMA_BUILD_COMMON=OFF \
576
- -DLLAMA_BUILD_EXAMPLES=OFF \
577
- -DLLAMA_BUILD_TOOLS=OFF \
578
- -DLLAMA_BUILD_TESTS=OFF \
579
- -DLLAMA_BUILD_SERVER=OFF \
580
- -DCMAKE_SYSTEM_NAME=visionOS \
581
- -DCMAKE_OSX_DEPLOYMENT_TARGET=1.0 \
582
- -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
583
- cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
584
-
585
- macOS-latest-swift:
586
- runs-on: macos-latest
587
-
588
- strategy:
589
- matrix:
590
- destination: ['generic/platform=macOS', 'generic/platform=iOS', 'generic/platform=tvOS']
591
-
592
- steps:
593
- - name: Clone
594
- id: checkout
595
- uses: actions/checkout@v4
596
-
597
- - name: ccache
598
- uses: hendrikmuhs/ccache-action@v1.2.16
599
- with:
600
- key: macOS-latest-swift
601
- evict-old-files: 1d
602
-
603
- - name: Dependencies
604
- id: depends
605
- continue-on-error: true
606
- run: |
607
- brew update
608
-
609
- - name: Build llama.cpp with CMake
610
- id: cmake_build
611
- run: |
612
- sysctl -a
613
- cmake -B build -G Xcode \
614
- -DGGML_METAL_USE_BF16=ON \
615
- -DGGML_METAL_EMBED_LIBRARY=ON \
616
- -DLLAMA_CURL=OFF \
617
- -DLLAMA_BUILD_EXAMPLES=OFF \
618
- -DLLAMA_BUILD_TOOLS=OFF \
619
- -DLLAMA_BUILD_TESTS=OFF \
620
- -DLLAMA_BUILD_SERVER=OFF \
621
- -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
622
- cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
623
-
624
- - name: xcodebuild for swift package
625
- id: xcodebuild
626
- run: |
627
- ./build-xcframework.sh
628
-
629
- windows-msys2:
630
- runs-on: windows-latest
631
-
632
- strategy:
633
- fail-fast: false
634
- matrix:
635
- include:
636
- - { sys: UCRT64, env: ucrt-x86_64, build: Release }
637
- - { sys: CLANG64, env: clang-x86_64, build: Release }
638
-
639
- steps:
640
- - name: Clone
641
- uses: actions/checkout@v4
642
-
643
- - name: ccache
644
- uses: hendrikmuhs/ccache-action@v1.2.16
645
- with:
646
- key: windows-msys2
647
- variant: ccache
648
- evict-old-files: 1d
649
-
650
- - name: Setup ${{ matrix.sys }}
651
- uses: msys2/setup-msys2@v2
652
- with:
653
- update: true
654
- msystem: ${{matrix.sys}}
655
- install: >-
656
- base-devel
657
- git
658
- mingw-w64-${{matrix.env}}-toolchain
659
- mingw-w64-${{matrix.env}}-cmake
660
- mingw-w64-${{matrix.env}}-openblas
661
-
662
- - name: Build using CMake
663
- shell: msys2 {0}
664
- run: |
665
- cmake -B build
666
- cmake --build build --config ${{ matrix.build }} -j $(nproc)
667
-
668
- - name: Clean after building using CMake
669
- shell: msys2 {0}
670
- run: |
671
- rm -rf build
672
-
673
- - name: Build using CMake w/ OpenBLAS
674
- shell: msys2 {0}
675
- run: |
676
- cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS
677
- cmake --build build --config ${{ matrix.build }} -j $(nproc)
678
-
679
- windows-latest-cmake:
680
- runs-on: windows-latest
681
-
682
- env:
683
- OPENBLAS_VERSION: 0.3.23
684
- SDE_VERSION: 9.33.0-2024-01-07
685
- VULKAN_VERSION: 1.4.309.0
686
-
687
- strategy:
688
- matrix:
689
- include:
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'
692
- - build: 'openblas-x64'
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"'
694
- - build: 'vulkan-x64'
695
- defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_VULKAN=ON'
696
- - build: 'llvm-arm64'
697
- defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON'
698
- - build: 'llvm-arm64-opencl-adreno'
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'
702
-
703
- steps:
704
- - name: Clone
705
- id: checkout
706
- uses: actions/checkout@v4
707
-
708
- - name: ccache
709
- uses: hendrikmuhs/ccache-action@v1.2.16
710
- with:
711
- key: windows-latest-cmake-${{ matrix.build }}
712
- variant: ccache
713
- evict-old-files: 1d
714
-
715
- - name: Clone Kompute submodule
716
- id: clone_kompute
717
- if: ${{ matrix.build == 'kompute-x64' }}
718
- run: |
719
- git submodule update --init ggml/src/ggml-kompute/kompute
720
-
721
- - name: Download OpenBLAS
722
- id: get_openblas
723
- if: ${{ matrix.build == 'openblas-x64' }}
724
- run: |
725
- curl.exe -o $env:RUNNER_TEMP/openblas.zip -L "https://github.com/xianyi/OpenBLAS/releases/download/v${env:OPENBLAS_VERSION}/OpenBLAS-${env:OPENBLAS_VERSION}-x64.zip"
726
- curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L "https://github.com/xianyi/OpenBLAS/raw/v${env:OPENBLAS_VERSION}/LICENSE"
727
- mkdir $env:RUNNER_TEMP/openblas
728
- tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas
729
- $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
730
- $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
731
- $lib = $(join-path $msvc 'bin\Hostx64\x64\lib.exe')
732
- & $lib /machine:x64 "/def:${env:RUNNER_TEMP}/openblas/lib/libopenblas.def" "/out:${env:RUNNER_TEMP}/openblas/lib/openblas.lib" /name:openblas.dll
733
-
734
- - name: Install Vulkan SDK
735
- id: get_vulkan
736
- if: ${{ matrix.build == 'kompute-x64' || matrix.build == 'vulkan-x64' }}
737
- run: |
738
- curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/VulkanSDK-${env:VULKAN_VERSION}-Installer.exe"
739
- & "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
740
- Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}"
741
- Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"
742
-
743
- - name: Install Ninja
744
- id: install_ninja
745
- run: |
746
- choco install ninja
747
-
748
- - name: Install OpenCL Headers and Libs
749
- id: install_opencl
750
- if: ${{ matrix.build == 'llvm-arm64-opencl-adreno' }}
751
- run: |
752
- git clone https://github.com/KhronosGroup/OpenCL-Headers
753
- cd OpenCL-Headers
754
- cmake -B build `
755
- -DBUILD_TESTING=OFF `
756
- -DOPENCL_HEADERS_BUILD_TESTING=OFF `
757
- -DOPENCL_HEADERS_BUILD_CXX_TESTS=OFF `
758
- -DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release"
759
- cmake --build build --target install
760
- git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader
761
- cd OpenCL-ICD-Loader
762
- cmake -B build-arm64-release `
763
- -A arm64 `
764
- -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" `
765
- -DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release"
766
- cmake --build build-arm64-release --target install --config release
767
-
768
- - name: libCURL
769
- id: get_libcurl
770
- uses: ./.github/actions/windows-setup-curl
771
-
772
- - name: Build
773
- id: cmake_build
774
- env:
775
- CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
776
- run: |
777
- cmake -S . -B build ${{ matrix.defines }} `
778
- -DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include"
779
- cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS}
780
-
781
- - name: Add libopenblas.dll
782
- id: add_libopenblas_dll
783
- if: ${{ matrix.build == 'openblas-x64' }}
784
- run: |
785
- cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release/openblas.dll
786
- cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release/OpenBLAS-${env:OPENBLAS_VERSION}.txt
787
-
788
- - name: Test
789
- id: cmake_test
790
- if: ${{ matrix.build != 'llvm-arm64' && matrix.build != 'llvm-arm64-opencl-adreno' }}
791
- run: |
792
- cd build
793
- ctest -L main -C Release --verbose --timeout 900
794
-
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
808
-
809
- ubuntu-latest-cmake-cuda:
810
- runs-on: ubuntu-latest
811
- container: nvidia/cuda:12.6.2-devel-ubuntu24.04
812
-
813
- steps:
814
- - name: Clone
815
- id: checkout
816
- uses: actions/checkout@v4
817
-
818
- - name: Install dependencies
819
- env:
820
- DEBIAN_FRONTEND: noninteractive
821
- run: |
822
- apt update
823
- apt install -y cmake build-essential ninja-build libgomp1 git libcurl4-openssl-dev
824
-
825
- - name: ccache
826
- uses: hendrikmuhs/ccache-action@v1.2.16
827
- with:
828
- key: ubuntu-latest-cmake-cuda
829
- evict-old-files: 1d
830
-
831
- - name: Build with CMake
832
- run: |
833
- cmake -S . -B build -G Ninja \
834
- -DCMAKE_BUILD_TYPE=Release \
835
- -DCMAKE_CUDA_ARCHITECTURES=89-real \
836
- -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined \
837
- -DLLAMA_FATAL_WARNINGS=ON \
838
- -DGGML_NATIVE=OFF \
839
- -DGGML_CUDA=ON
840
- cmake --build build
841
-
842
- windows-2019-cmake-cuda:
843
- runs-on: windows-2019
844
-
845
- strategy:
846
- matrix:
847
- cuda: ['12.4', '11.7']
848
-
849
- steps:
850
- - name: Clone
851
- id: checkout
852
- uses: actions/checkout@v4
853
-
854
- - name: Install ccache
855
- uses: hendrikmuhs/ccache-action@v1.2.16
856
- with:
857
- key: windows-cuda-${{ matrix.cuda }}
858
- variant: ccache
859
- evict-old-files: 1d
860
-
861
- - name: Install Cuda Toolkit
862
- uses: ./.github/actions/windows-setup-cuda
863
- with:
864
- cuda_version: ${{ matrix.cuda }}
865
-
866
- - name: Install Ninja
867
- id: install_ninja
868
- run: |
869
- choco install ninja
870
-
871
- - name: libCURL
872
- id: get_libcurl
873
- uses: ./.github/actions/windows-setup-curl
874
-
875
- - name: Build
876
- id: cmake_build
877
- shell: cmd
878
- env:
879
- CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
880
- run: |
881
- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
882
- cmake -S . -B build -G "Ninja Multi-Config" ^
883
- -DLLAMA_BUILD_SERVER=ON ^
884
- -DGGML_NATIVE=OFF ^
885
- -DGGML_BACKEND_DL=ON ^
886
- -DGGML_CPU_ALL_VARIANTS=ON ^
887
- -DGGML_CUDA=ON ^
888
- -DGGML_RPC=ON ^
889
- -DCURL_LIBRARY="%CURL_PATH%/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="%CURL_PATH%/include"
890
- set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1
891
- cmake --build build --config Release -j %NINJA_JOBS% -t ggml
892
- cmake --build build --config Release
893
-
894
- windows-latest-cmake-sycl:
895
- runs-on: windows-latest
896
-
897
- defaults:
898
- run:
899
- shell: bash
900
-
901
- env:
902
- WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/7cd9bba0-7aab-4e30-b3ae-2221006a4a05/intel-oneapi-base-toolkit-2025.1.1.34_offline.exe
903
- WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.dnnl:intel.oneapi.win.tbb.devel
904
- ONEAPI_ROOT: "C:/Program Files (x86)/Intel/oneAPI"
905
- steps:
906
- - name: Clone
907
- id: checkout
908
- uses: actions/checkout@v4
909
-
910
- - name: ccache
911
- uses: hendrikmuhs/ccache-action@v1.2.16
912
- with:
913
- key: windows-latest-cmake-sycl
914
- variant: ccache
915
- evict-old-files: 1d
916
-
917
- - name: Install
918
- run: |
919
- scripts/install-oneapi.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL
920
-
921
- # TODO: add libcurl support ; we will also need to modify win-build-sycl.bat to accept user-specified args
922
-
923
- - name: Build
924
- id: cmake_build
925
- run: examples/sycl/win-build-sycl.bat
926
-
927
- windows-latest-cmake-hip:
928
- if: ${{ github.event.inputs.create_release != 'true' }}
929
- runs-on: windows-latest
930
-
931
- steps:
932
- - name: Clone
933
- id: checkout
934
- uses: actions/checkout@v4
935
-
936
- - name: Clone rocWMMA repository
937
- id: clone_rocwmma
938
- run: |
939
- git clone https://github.com/rocm/rocwmma --branch rocm-6.2.4 --depth 1
940
-
941
- - name: Install
942
- id: depends
943
- run: |
944
- $ErrorActionPreference = "Stop"
945
- write-host "Downloading AMD HIP SDK Installer"
946
- 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"
947
- write-host "Installing AMD HIP SDK"
948
- Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -Wait
949
- write-host "Completed AMD HIP SDK installation"
950
-
951
- - name: Verify ROCm
952
- id: verify
953
- run: |
954
- & 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' --version
955
-
956
- - name: Install ccache
957
- uses: hendrikmuhs/ccache-action@v1.2.16
958
- with:
959
- key: ${{ github.job }}
960
- evict-old-files: 1d
961
-
962
- - name: libCURL
963
- id: get_libcurl
964
- uses: ./.github/actions/windows-setup-curl
965
-
966
- - name: Build
967
- id: cmake_build
968
- env:
969
- CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
970
- run: |
971
- $env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
972
- $env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
973
- cmake -G "Unix Makefiles" -B build -S . `
974
- -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" `
975
- -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" `
976
- -DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/rocwmma/library/include/" `
977
- -DCMAKE_BUILD_TYPE=Release `
978
- -DGGML_HIP=ON `
979
- -DGGML_HIP_ROCWMMA_FATTN=ON `
980
- -DGGML_RPC=ON `
981
- -DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include"
982
- cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
983
-
984
- ios-xcode-build:
985
- runs-on: macos-latest
986
-
987
- steps:
988
- - name: Checkout code
989
- uses: actions/checkout@v4
990
-
991
- - name: Build
992
- id: cmake_build
993
- run: |
994
- sysctl -a
995
- cmake -B build -G Xcode \
996
- -DGGML_METAL_USE_BF16=ON \
997
- -DGGML_METAL_EMBED_LIBRARY=ON \
998
- -DLLAMA_CURL=OFF \
999
- -DLLAMA_BUILD_EXAMPLES=OFF \
1000
- -DLLAMA_BUILD_TOOLS=OFF \
1001
- -DLLAMA_BUILD_TESTS=OFF \
1002
- -DLLAMA_BUILD_SERVER=OFF \
1003
- -DCMAKE_SYSTEM_NAME=iOS \
1004
- -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
1005
- -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
1006
- cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
1007
-
1008
- - name: xcodebuild for swift package
1009
- id: xcodebuild
1010
- run: |
1011
- ./build-xcframework.sh
1012
-
1013
- - name: Build Xcode project
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
1015
-
1016
- android-build:
1017
- runs-on: ubuntu-latest
1018
-
1019
- steps:
1020
- - name: Clone
1021
- uses: actions/checkout@v4
1022
-
1023
- - name: ccache
1024
- uses: hendrikmuhs/ccache-action@v1.2.16
1025
- with:
1026
- key: android-build
1027
- evict-old-files: 1d
1028
-
1029
- - name: Set up JDK
1030
- uses: actions/setup-java@v3
1031
- with:
1032
- java-version: 17
1033
- distribution: zulu
1034
-
1035
- - name: Setup Android SDK
1036
- uses: android-actions/setup-android@v3
1037
- with:
1038
- log-accepted-android-sdk-licenses: false
1039
-
1040
- - name: Build
1041
- run: |
1042
- cd examples/llama.android
1043
- ./gradlew build --no-daemon
1044
-
1045
- openEuler-latest-cmake-cann:
1046
- if: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'Ascend NPU') }}
1047
- defaults:
1048
- run:
1049
- shell: bash -el {0}
1050
- strategy:
1051
- matrix:
1052
- arch: [x86, aarch64]
1053
- cann:
1054
- - '8.1.RC1.alpha001-910b-openeuler22.03-py3.10'
1055
- device:
1056
- - 'ascend910b3'
1057
- build:
1058
- - 'Release'
1059
- runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
1060
- container: ascendai/cann:${{ matrix.cann }}
1061
- steps:
1062
- - name: Checkout
1063
- uses: actions/checkout@v4
1064
-
1065
- - name: Dependencies
1066
- run: |
1067
- yum update -y
1068
- yum install -y git gcc gcc-c++ make cmake libcurl-devel
1069
-
1070
- - name: Build
1071
- run: |
1072
- export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH}
1073
-
1074
- cmake -S . -B build \
1075
- -DCMAKE_BUILD_TYPE=${{ matrix.build }} \
1076
- -DGGML_CANN=on \
1077
- -DSOC_TYPE=${{ matrix.device }}
1078
- cmake --build build -j $(nproc)