@fugood/llama.node 0.3.16 → 0.4.0

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 (281) hide show
  1. package/CMakeLists.txt +6 -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 +44 -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 +374 -19
  24. package/src/LlamaCompletionWorker.h +31 -10
  25. package/src/LlamaContext.cpp +216 -7
  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 +233 -0
  29. package/src/llama.cpp/.github/workflows/build.yml +89 -767
  30. package/src/llama.cpp/.github/workflows/docker.yml +9 -6
  31. package/src/llama.cpp/.github/workflows/release.yml +716 -0
  32. package/src/llama.cpp/.github/workflows/server.yml +19 -23
  33. package/src/llama.cpp/CMakeLists.txt +11 -1
  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 +35 -4
  37. package/src/llama.cpp/common/arg.cpp +844 -121
  38. package/src/llama.cpp/common/arg.h +9 -0
  39. package/src/llama.cpp/common/chat.cpp +129 -107
  40. package/src/llama.cpp/common/chat.h +2 -0
  41. package/src/llama.cpp/common/common.cpp +64 -518
  42. package/src/llama.cpp/common/common.h +35 -45
  43. package/src/llama.cpp/common/json-schema-to-grammar.cpp +3 -0
  44. package/src/llama.cpp/common/llguidance.cpp +31 -47
  45. package/src/llama.cpp/common/minja/chat-template.hpp +23 -11
  46. package/src/llama.cpp/common/minja/minja.hpp +186 -127
  47. package/src/llama.cpp/common/regex-partial.cpp +204 -0
  48. package/src/llama.cpp/common/regex-partial.h +56 -0
  49. package/src/llama.cpp/common/sampling.cpp +60 -50
  50. package/src/llama.cpp/docs/build.md +122 -7
  51. package/src/llama.cpp/examples/CMakeLists.txt +2 -32
  52. package/src/llama.cpp/examples/batched/batched.cpp +1 -1
  53. package/src/llama.cpp/examples/embedding/embedding.cpp +9 -12
  54. package/src/llama.cpp/examples/gritlm/gritlm.cpp +1 -1
  55. package/src/llama.cpp/examples/llama.android/llama/build.gradle.kts +1 -0
  56. package/src/llama.cpp/examples/parallel/parallel.cpp +89 -15
  57. package/src/llama.cpp/examples/passkey/passkey.cpp +1 -1
  58. package/src/llama.cpp/examples/speculative/speculative.cpp +1 -1
  59. package/src/llama.cpp/examples/speculative-simple/speculative-simple.cpp +1 -1
  60. package/src/llama.cpp/examples/sycl/build.sh +2 -2
  61. package/src/llama.cpp/examples/sycl/win-build-sycl.bat +2 -2
  62. package/src/llama.cpp/examples/training/CMakeLists.txt +5 -0
  63. package/src/llama.cpp/examples/training/finetune.cpp +96 -0
  64. package/src/llama.cpp/ggml/CMakeLists.txt +35 -2
  65. package/src/llama.cpp/ggml/cmake/GitVars.cmake +22 -0
  66. package/src/llama.cpp/ggml/include/ggml-backend.h +4 -4
  67. package/src/llama.cpp/ggml/include/ggml-cpp.h +1 -1
  68. package/src/llama.cpp/ggml/include/ggml-cpu.h +5 -0
  69. package/src/llama.cpp/ggml/include/ggml-opt.h +47 -28
  70. package/src/llama.cpp/ggml/include/ggml-rpc.h +6 -1
  71. package/src/llama.cpp/ggml/include/ggml.h +76 -106
  72. package/src/llama.cpp/ggml/src/CMakeLists.txt +11 -8
  73. package/src/llama.cpp/ggml/src/ggml-alloc.c +4 -1
  74. package/src/llama.cpp/ggml/src/ggml-backend.cpp +9 -5
  75. package/src/llama.cpp/ggml/src/ggml-cann/CMakeLists.txt +0 -2
  76. package/src/llama.cpp/ggml/src/ggml-cann/acl_tensor.cpp +8 -4
  77. package/src/llama.cpp/ggml/src/ggml-cann/acl_tensor.h +5 -5
  78. package/src/llama.cpp/ggml/src/ggml-cann/aclnn_ops.cpp +692 -1534
  79. package/src/llama.cpp/ggml/src/ggml-cann/aclnn_ops.h +613 -122
  80. package/src/llama.cpp/ggml/src/ggml-cann/common.h +135 -1
  81. package/src/llama.cpp/ggml/src/ggml-cann/ggml-cann.cpp +507 -137
  82. package/src/llama.cpp/ggml/src/ggml-common.h +12 -6
  83. package/src/llama.cpp/ggml/src/ggml-cpu/CMakeLists.txt +66 -33
  84. package/src/llama.cpp/ggml/src/ggml-cpu/binary-ops.cpp +158 -0
  85. package/src/llama.cpp/ggml/src/ggml-cpu/binary-ops.h +16 -0
  86. package/src/llama.cpp/ggml/src/ggml-cpu/common.h +72 -0
  87. package/src/llama.cpp/ggml/src/ggml-cpu/cpu-feats-x86.cpp +1 -1
  88. package/src/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp +896 -194
  89. package/src/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-impl.h +2 -21
  90. package/src/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c +1060 -410
  91. package/src/llama.cpp/ggml/src/ggml-cpu/ggml-cpu.c +1008 -13533
  92. package/src/llama.cpp/ggml/src/ggml-cpu/ggml-cpu.cpp +31 -16
  93. package/src/llama.cpp/ggml/src/ggml-cpu/kleidiai/kernels.cpp +90 -12
  94. package/src/llama.cpp/ggml/src/ggml-cpu/kleidiai/kernels.h +47 -13
  95. package/src/llama.cpp/ggml/src/ggml-cpu/kleidiai/kleidiai.cpp +266 -72
  96. package/src/llama.cpp/ggml/src/ggml-cpu/llamafile/sgemm.cpp +1034 -88
  97. package/src/llama.cpp/ggml/src/ggml-cpu/ops.cpp +8796 -0
  98. package/src/llama.cpp/ggml/src/ggml-cpu/ops.h +110 -0
  99. package/src/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h +892 -0
  100. package/src/llama.cpp/ggml/src/ggml-cpu/unary-ops.cpp +186 -0
  101. package/src/llama.cpp/ggml/src/ggml-cpu/unary-ops.h +28 -0
  102. package/src/llama.cpp/ggml/src/ggml-cpu/vec.cpp +252 -0
  103. package/src/llama.cpp/ggml/src/ggml-cpu/vec.h +802 -0
  104. package/src/llama.cpp/ggml/src/ggml-cuda/CMakeLists.txt +23 -4
  105. package/src/llama.cpp/ggml/src/ggml-cuda/vendors/hip.h +7 -0
  106. package/src/llama.cpp/ggml/src/ggml-cuda/vendors/musa.h +1 -0
  107. package/src/llama.cpp/ggml/src/ggml-hip/CMakeLists.txt +0 -4
  108. package/src/llama.cpp/ggml/src/ggml-impl.h +52 -18
  109. package/src/llama.cpp/ggml/src/ggml-metal/ggml-metal-impl.h +106 -14
  110. package/src/llama.cpp/ggml/src/ggml-opencl/CMakeLists.txt +67 -119
  111. package/src/llama.cpp/ggml/src/ggml-opencl/ggml-opencl.cpp +1023 -262
  112. package/src/llama.cpp/ggml/src/ggml-opt.cpp +368 -190
  113. package/src/llama.cpp/ggml/src/ggml-quants.c +0 -6
  114. package/src/llama.cpp/ggml/src/ggml-rpc/ggml-rpc.cpp +307 -40
  115. package/src/llama.cpp/ggml/src/ggml-sycl/CMakeLists.txt +125 -45
  116. package/src/llama.cpp/ggml/src/ggml-sycl/backend.hpp +10 -8
  117. package/src/llama.cpp/ggml/src/ggml-sycl/binbcast.cpp +239 -0
  118. package/src/llama.cpp/ggml/src/ggml-sycl/binbcast.hpp +39 -0
  119. package/src/llama.cpp/ggml/src/ggml-sycl/common.cpp +0 -35
  120. package/src/llama.cpp/ggml/src/ggml-sycl/common.hpp +9 -307
  121. package/src/llama.cpp/ggml/src/ggml-sycl/convert.cpp +72 -25
  122. package/src/llama.cpp/ggml/src/ggml-sycl/convert.hpp +14 -7
  123. package/src/llama.cpp/ggml/src/ggml-sycl/dequantize.hpp +59 -21
  124. package/src/llama.cpp/ggml/src/ggml-sycl/dmmv.cpp +7 -1
  125. package/src/llama.cpp/ggml/src/ggml-sycl/dpct/helper.hpp +79 -90
  126. package/src/llama.cpp/ggml/src/ggml-sycl/element_wise.cpp +944 -438
  127. package/src/llama.cpp/ggml/src/ggml-sycl/element_wise.hpp +22 -23
  128. package/src/llama.cpp/ggml/src/ggml-sycl/gemm.hpp +37 -8
  129. package/src/llama.cpp/ggml/src/ggml-sycl/getrows.cpp +24 -20
  130. package/src/llama.cpp/ggml/src/ggml-sycl/getrows.hpp +1 -4
  131. package/src/llama.cpp/ggml/src/ggml-sycl/ggml-sycl.cpp +507 -411
  132. package/src/llama.cpp/ggml/src/ggml-sycl/im2col.cpp +84 -74
  133. package/src/llama.cpp/ggml/src/ggml-sycl/im2col.hpp +1 -3
  134. package/src/llama.cpp/ggml/src/ggml-sycl/mmvq.cpp +185 -89
  135. package/src/llama.cpp/ggml/src/ggml-sycl/norm.cpp +37 -49
  136. package/src/llama.cpp/ggml/src/ggml-sycl/norm.hpp +7 -22
  137. package/src/llama.cpp/ggml/src/ggml-sycl/outprod.cpp +4 -14
  138. package/src/llama.cpp/ggml/src/ggml-sycl/quants.hpp +83 -0
  139. package/src/llama.cpp/ggml/src/ggml-sycl/rope.cpp +204 -118
  140. package/src/llama.cpp/ggml/src/ggml-sycl/rope.hpp +1 -3
  141. package/src/llama.cpp/ggml/src/ggml-sycl/vecdotq.hpp +128 -53
  142. package/src/llama.cpp/ggml/src/ggml-vulkan/CMakeLists.txt +83 -49
  143. package/src/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp +1278 -282
  144. package/src/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/CMakeLists.txt +32 -0
  145. package/src/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp +133 -30
  146. package/src/llama.cpp/ggml/src/ggml.c +170 -265
  147. package/src/llama.cpp/ggml/src/gguf.cpp +34 -33
  148. package/src/llama.cpp/include/llama.h +82 -22
  149. package/src/llama.cpp/models/ggml-vocab-llama4.gguf.inp +112 -0
  150. package/src/llama.cpp/models/ggml-vocab-llama4.gguf.out +46 -0
  151. package/src/llama.cpp/models/ggml-vocab-pixtral.gguf.inp +112 -0
  152. package/src/llama.cpp/models/ggml-vocab-pixtral.gguf.out +46 -0
  153. package/src/llama.cpp/requirements/requirements-all.txt +5 -3
  154. package/src/llama.cpp/requirements/requirements-gguf_editor_gui.txt +3 -0
  155. package/src/llama.cpp/scripts/xxd.cmake +1 -1
  156. package/src/llama.cpp/src/CMakeLists.txt +4 -2
  157. package/src/llama.cpp/src/llama-adapter.cpp +43 -1
  158. package/src/llama.cpp/src/llama-arch.cpp +163 -17
  159. package/src/llama.cpp/src/llama-arch.h +16 -0
  160. package/src/llama.cpp/src/llama-batch.cpp +5 -1
  161. package/src/llama.cpp/src/llama-batch.h +2 -1
  162. package/src/llama.cpp/src/llama-chat.cpp +91 -16
  163. package/src/llama.cpp/src/llama-chat.h +7 -2
  164. package/src/llama.cpp/src/llama-context.cpp +479 -575
  165. package/src/llama.cpp/src/llama-context.h +44 -33
  166. package/src/llama.cpp/src/llama-cparams.h +1 -0
  167. package/src/llama.cpp/src/llama-graph.cpp +209 -157
  168. package/src/llama.cpp/src/llama-graph.h +38 -14
  169. package/src/llama.cpp/src/llama-hparams.h +13 -0
  170. package/src/llama.cpp/src/llama-kv-cache.cpp +1604 -543
  171. package/src/llama.cpp/src/llama-kv-cache.h +283 -171
  172. package/src/llama.cpp/src/llama-memory.h +12 -2
  173. package/src/llama.cpp/src/llama-mmap.cpp +1 -1
  174. package/src/llama.cpp/src/llama-model-loader.cpp +34 -20
  175. package/src/llama.cpp/src/llama-model-loader.h +5 -3
  176. package/src/llama.cpp/src/llama-model-saver.cpp +281 -0
  177. package/src/llama.cpp/src/llama-model-saver.h +37 -0
  178. package/src/llama.cpp/src/llama-model.cpp +1803 -330
  179. package/src/llama.cpp/src/llama-model.h +21 -2
  180. package/src/llama.cpp/src/llama-quant.cpp +33 -10
  181. package/src/llama.cpp/src/llama-sampling.cpp +25 -7
  182. package/src/llama.cpp/src/llama-vocab.cpp +86 -10
  183. package/src/llama.cpp/src/llama-vocab.h +6 -0
  184. package/src/llama.cpp/src/llama.cpp +15 -1
  185. package/src/llama.cpp/tests/CMakeLists.txt +52 -31
  186. package/src/llama.cpp/tests/test-arg-parser.cpp +51 -4
  187. package/src/llama.cpp/tests/test-backend-ops.cpp +189 -90
  188. package/src/llama.cpp/tests/test-chat-template.cpp +26 -6
  189. package/src/llama.cpp/tests/test-chat.cpp +15 -3
  190. package/src/llama.cpp/{examples/gbnf-validator/gbnf-validator.cpp → tests/test-gbnf-validator.cpp} +2 -2
  191. package/src/llama.cpp/tests/test-grammar-integration.cpp +3 -2
  192. package/src/llama.cpp/tests/test-grammar-llguidance.cpp +63 -2
  193. package/src/llama.cpp/tests/test-grammar-parser.cpp +3 -1
  194. package/src/llama.cpp/tests/test-json-schema-to-grammar.cpp +17 -1
  195. package/src/llama.cpp/tests/test-llama-grammar.cpp +2 -1
  196. package/src/llama.cpp/tests/test-mtmd-c-api.c +63 -0
  197. package/src/llama.cpp/tests/test-opt.cpp +33 -21
  198. package/src/llama.cpp/{examples/quantize-stats/quantize-stats.cpp → tests/test-quantize-stats.cpp} +3 -1
  199. package/src/llama.cpp/tests/test-regex-partial.cpp +288 -0
  200. package/src/llama.cpp/tests/test-sampling.cpp +1 -1
  201. package/src/llama.cpp/tests/test-tokenizer-1-bpe.cpp +2 -1
  202. package/src/llama.cpp/tests/test-tokenizer-1-spm.cpp +2 -1
  203. package/src/llama.cpp/tools/CMakeLists.txt +39 -0
  204. package/src/llama.cpp/{examples → tools}/batched-bench/batched-bench.cpp +3 -3
  205. package/src/llama.cpp/{examples → tools}/export-lora/export-lora.cpp +1 -1
  206. package/src/llama.cpp/{examples → tools}/gguf-split/gguf-split.cpp +15 -16
  207. package/src/llama.cpp/{examples → tools}/imatrix/imatrix.cpp +11 -9
  208. package/src/llama.cpp/{examples → tools}/llama-bench/llama-bench.cpp +623 -274
  209. package/src/llama.cpp/{examples → tools}/main/main.cpp +22 -14
  210. package/src/llama.cpp/tools/mtmd/CMakeLists.txt +47 -0
  211. package/src/llama.cpp/tools/mtmd/clip-impl.h +365 -0
  212. package/src/llama.cpp/tools/mtmd/clip.cpp +3646 -0
  213. package/src/llama.cpp/tools/mtmd/clip.h +99 -0
  214. package/src/llama.cpp/tools/mtmd/deprecation-warning.cpp +22 -0
  215. package/src/llama.cpp/tools/mtmd/mtmd-cli.cpp +370 -0
  216. package/src/llama.cpp/tools/mtmd/mtmd-helper.cpp +310 -0
  217. package/src/llama.cpp/tools/mtmd/mtmd.cpp +678 -0
  218. package/src/llama.cpp/tools/mtmd/mtmd.h +331 -0
  219. package/src/llama.cpp/{examples → tools}/perplexity/perplexity.cpp +21 -5
  220. package/src/llama.cpp/{examples → tools}/quantize/quantize.cpp +53 -3
  221. package/src/llama.cpp/tools/rpc/CMakeLists.txt +4 -0
  222. package/src/llama.cpp/tools/rpc/rpc-server.cpp +322 -0
  223. package/src/llama.cpp/tools/run/CMakeLists.txt +16 -0
  224. package/src/llama.cpp/{examples → tools}/run/run.cpp +30 -30
  225. package/src/llama.cpp/{examples → tools}/server/CMakeLists.txt +2 -1
  226. package/src/llama.cpp/{examples → tools}/server/httplib.h +313 -247
  227. package/src/llama.cpp/{examples → tools}/server/server.cpp +529 -215
  228. package/src/llama.cpp/{examples → tools}/server/utils.hpp +427 -6
  229. package/src/llama.cpp/{examples → tools}/tts/tts.cpp +6 -9
  230. package/src/llama.cpp/cmake/arm64-windows-msvc.cmake +0 -6
  231. package/src/llama.cpp/examples/gbnf-validator/CMakeLists.txt +0 -5
  232. package/src/llama.cpp/examples/infill/CMakeLists.txt +0 -5
  233. package/src/llama.cpp/examples/infill/infill.cpp +0 -590
  234. package/src/llama.cpp/examples/llava/CMakeLists.txt +0 -66
  235. package/src/llama.cpp/examples/llava/android/build_64.sh +0 -8
  236. package/src/llama.cpp/examples/llava/clip-quantize-cli.cpp +0 -59
  237. package/src/llama.cpp/examples/llava/clip.cpp +0 -3206
  238. package/src/llama.cpp/examples/llava/clip.h +0 -118
  239. package/src/llama.cpp/examples/llava/gemma3-cli.cpp +0 -341
  240. package/src/llama.cpp/examples/llava/llava-cli.cpp +0 -332
  241. package/src/llama.cpp/examples/llava/llava.cpp +0 -574
  242. package/src/llama.cpp/examples/llava/llava.h +0 -49
  243. package/src/llama.cpp/examples/llava/minicpmv-cli.cpp +0 -354
  244. package/src/llama.cpp/examples/llava/qwen2vl-cli.cpp +0 -584
  245. package/src/llama.cpp/examples/quantize-stats/CMakeLists.txt +0 -6
  246. package/src/llama.cpp/examples/rpc/CMakeLists.txt +0 -2
  247. package/src/llama.cpp/examples/rpc/rpc-server.cpp +0 -171
  248. package/src/llama.cpp/examples/run/CMakeLists.txt +0 -5
  249. package/src/llama.cpp/ggml/src/ggml-cann/kernels/CMakeLists.txt +0 -30
  250. package/src/llama.cpp/ggml/src/ggml-cann/kernels/ascendc_kernels.h +0 -19
  251. package/src/llama.cpp/ggml/src/ggml-cann/kernels/dup.cpp +0 -234
  252. package/src/llama.cpp/ggml/src/ggml-cann/kernels/get_row_f16.cpp +0 -197
  253. package/src/llama.cpp/ggml/src/ggml-cann/kernels/get_row_f32.cpp +0 -190
  254. package/src/llama.cpp/ggml/src/ggml-cann/kernels/get_row_q4_0.cpp +0 -204
  255. package/src/llama.cpp/ggml/src/ggml-cann/kernels/get_row_q8_0.cpp +0 -191
  256. package/src/llama.cpp/ggml/src/ggml-cann/kernels/quantize_f16_q8_0.cpp +0 -218
  257. package/src/llama.cpp/ggml/src/ggml-cann/kernels/quantize_f32_q8_0.cpp +0 -216
  258. package/src/llama.cpp/ggml/src/ggml-cann/kernels/quantize_float_to_q4_0.cpp +0 -295
  259. /package/src/llama.cpp/{examples → tools}/batched-bench/CMakeLists.txt +0 -0
  260. /package/src/llama.cpp/{examples → tools}/cvector-generator/CMakeLists.txt +0 -0
  261. /package/src/llama.cpp/{examples → tools}/cvector-generator/completions.txt +0 -0
  262. /package/src/llama.cpp/{examples → tools}/cvector-generator/cvector-generator.cpp +0 -0
  263. /package/src/llama.cpp/{examples → tools}/cvector-generator/mean.hpp +0 -0
  264. /package/src/llama.cpp/{examples → tools}/cvector-generator/negative.txt +0 -0
  265. /package/src/llama.cpp/{examples → tools}/cvector-generator/pca.hpp +0 -0
  266. /package/src/llama.cpp/{examples → tools}/cvector-generator/positive.txt +0 -0
  267. /package/src/llama.cpp/{examples → tools}/export-lora/CMakeLists.txt +0 -0
  268. /package/src/llama.cpp/{examples → tools}/gguf-split/CMakeLists.txt +0 -0
  269. /package/src/llama.cpp/{examples → tools}/imatrix/CMakeLists.txt +0 -0
  270. /package/src/llama.cpp/{examples → tools}/llama-bench/CMakeLists.txt +0 -0
  271. /package/src/llama.cpp/{examples → tools}/main/CMakeLists.txt +0 -0
  272. /package/src/llama.cpp/{examples/llava → tools/mtmd}/requirements.txt +0 -0
  273. /package/src/llama.cpp/{examples → tools}/perplexity/CMakeLists.txt +0 -0
  274. /package/src/llama.cpp/{examples → tools}/quantize/CMakeLists.txt +0 -0
  275. /package/src/llama.cpp/{examples → tools}/run/linenoise.cpp/linenoise.cpp +0 -0
  276. /package/src/llama.cpp/{examples → tools}/run/linenoise.cpp/linenoise.h +0 -0
  277. /package/src/llama.cpp/{examples → tools}/server/bench/requirements.txt +0 -0
  278. /package/src/llama.cpp/{examples → tools}/server/tests/requirements.txt +0 -0
  279. /package/src/llama.cpp/{examples → tools}/tokenize/CMakeLists.txt +0 -0
  280. /package/src/llama.cpp/{examples → tools}/tokenize/tokenize.cpp +0 -0
  281. /package/src/llama.cpp/{examples → tools}/tts/CMakeLists.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  //
2
2
  // MIT license
3
- // Copyright (C) 2024 Intel Corporation
3
+ // Copyright (C) 2025 Intel Corporation
4
4
  // SPDX-License-Identifier: MIT
5
5
  //
6
6
 
@@ -14,8 +14,11 @@
14
14
  #define GGML_SYCL_VECDOTQ_HPP
15
15
 
16
16
  #include "dpct/helper.hpp"
17
+ #include "ggml.h"
18
+ #include "quants.hpp"
17
19
 
18
- typedef float (*vec_dot_q_sycl_t)(const void * __restrict__ vbq, const block_q8_1 * __restrict__ bq8_1, const int & iqs);
20
+ typedef float (*vec_dot_q_sycl_t)(const void * __restrict__ vbq, const block_q8_1 * __restrict__ bq8_1,
21
+ const int & iqs);
19
22
 
20
23
  static __dpct_inline__ int get_int_from_int8(const int8_t* x8, const int& i32) {
21
24
  const uint16_t* x16 =
@@ -252,13 +255,121 @@ vec_dot_q6_K_q8_1_impl_mmvq(const int &vl, const int &vh,
252
255
  // VDR = vec dot ratio, how many contiguous integers each thread processes when the vec dot kernel is called
253
256
  // MMVQ = mul_mat_vec_q, MMQ = mul_mat_q
254
257
 
258
+ template <ggml_type T> struct reorder_vec_dot_q_sycl {
259
+ static_assert(T != T, "ggml_type for reorder vecdot not implemented");
260
+ };
261
+
262
+ template <> struct reorder_vec_dot_q_sycl<GGML_TYPE_Q4_0> {
263
+ static constexpr ggml_type gtype = GGML_TYPE_Q4_0;
264
+
265
+ using q4_0_block = ggml_sycl_reordered::block_q_t<GGML_TYPE_Q4_0>;
266
+ using q4_0_traits = typename q4_0_block::traits;
267
+
268
+ __dpct_inline__ float vec_dot_q4_0_q8_1_impl(const int * v, const int * u, const float & d4, const sycl::half2 & ds8) {
269
+ int sumi = 0;
270
+
271
+ #pragma unroll
272
+ for (size_t i = 0; i < q4_0_traits::vdr_mmvq; ++i) {
273
+ const int vi0 = (v[i] >> 0) & 0x0F0F0F0F;
274
+ const int vi1 = (v[i] >> 4) & 0x0F0F0F0F;
275
+
276
+ // SIMD dot product of quantized values
277
+ sumi = dpct::dp4a(vi0, u[2 * i + 0], sumi);
278
+ sumi = dpct::dp4a(vi1, u[2 * i + 1], sumi);
279
+ }
280
+
281
+ const sycl::float2 ds8f = ds8.convert<float, sycl::rounding_mode::automatic>();
282
+
283
+ // second part effectively subtracts 8 from each quant value
284
+ return d4 * (sumi * ds8f.x() - (8 * q4_0_traits::vdr_mmvq / q4_0_traits::qi) * ds8f.y());
285
+ }
286
+
287
+ __dpct_inline__ float operator()(const void * __restrict__ vbq, const int ibx_offset, const int d_offset,
288
+ const block_q8_1 * __restrict__ bq8_1, const int & iqs, int /* nblocks */) {
289
+ const uint8_t * bq4_0 = static_cast<const uint8_t *>(vbq) + ibx_offset;
290
+ const ggml_half d = *(reinterpret_cast<const ggml_half *>(static_cast<const uint8_t *>(vbq) + d_offset));
291
+ int v[q4_0_traits::vdr_mmvq];
292
+ int u[2 * q4_0_traits::vdr_mmvq];
293
+
294
+ #pragma unroll
295
+
296
+ for (size_t i = 0; i < q4_0_traits::vdr_mmvq; ++i) {
297
+ v[i] = get_int_from_uint8(bq4_0, iqs + i);
298
+ u[2 * i + 0] = get_int_from_int8_aligned(bq8_1->qs, iqs + i);
299
+ u[2 * i + 1] = get_int_from_int8_aligned(bq8_1->qs, iqs + i + q4_0_traits::qi);
300
+ }
301
+
302
+ return vec_dot_q4_0_q8_1_impl(v, u, d, bq8_1->ds);
303
+ };
304
+ };
305
+
306
+ static inline float vec_dot_q4_K_q8_1_common(const int * __restrict__ q4, const uint16_t * __restrict__ scales,
307
+ const ggml_half2 & dm, const block_q8_1 * __restrict__ bq8_1,
308
+ const int & iqs) {
309
+ int v[2];
310
+ int u[2 * QR4_K];
311
+ float d8[QR4_K];
312
+
313
+ v[0] = q4[0];
314
+ v[1] = q4[4];
315
+
316
+ uint16_t aux[2];
317
+ const int j = (QR4_K * ((iqs / 2) / (QI8_1 / 2))) / 2;
318
+ if (j < 2) {
319
+ aux[0] = scales[j + 0] & 0x3f3f;
320
+ aux[1] = scales[j + 2] & 0x3f3f;
321
+ } else {
322
+ aux[0] = ((scales[j + 2] >> 0) & 0x0f0f) | ((scales[j - 2] & 0xc0c0) >> 2);
323
+ aux[1] = ((scales[j + 2] >> 4) & 0x0f0f) | ((scales[j - 0] & 0xc0c0) >> 2);
324
+ }
325
+
326
+ const uint8_t * sc = (const uint8_t *) aux;
327
+ const uint8_t * m = sc + 2;
328
+
329
+ const int bq8_offset = QR4_K * ((iqs / 2) / (QI8_1 / 2));
330
+
331
+ for (int i = 0; i < QR4_K; ++i) {
332
+ const block_q8_1 * bq8i = bq8_1 + bq8_offset + i;
333
+ d8[i] = bq8i->ds[0];
334
+
335
+ const int * q8 = (const int *) bq8i->qs + ((iqs / 2) % 4);
336
+ u[2 * i + 0] = q8[0];
337
+ u[2 * i + 1] = q8[4];
338
+ }
339
+
340
+ return vec_dot_q4_K_q8_1_impl_vmmq(v, u, sc, m, dm, d8);
341
+ }
342
+
343
+ template <> struct reorder_vec_dot_q_sycl<GGML_TYPE_Q4_K> {
344
+ static constexpr ggml_type gtype = GGML_TYPE_Q4_K;
345
+
346
+ using q4_k_block = ggml_sycl_reordered::block_q_t<GGML_TYPE_Q4_K>;
347
+ using q4_k_traits = typename q4_k_block::traits;
348
+
349
+ float operator()(const void * __restrict__ vbq, const int ibx_offset, const int d_offset,
350
+ const block_q8_1 * __restrict__ bq8_1, const int & iqs, int nblocks) {
351
+ const int ib = ibx_offset / (QK_K / 2);
352
+
353
+ const uint8_t * base = static_cast<const uint8_t *>(vbq);
354
+ const uint8_t * qs = base + ibx_offset;
355
+ const int total_qs_bytes = nblocks * (QK_K / 2);
356
+ const uint8_t * scs = base + total_qs_bytes + ib * K_SCALE_SIZE;
357
+ const ggml_half2 * dms = reinterpret_cast<const ggml_half2 *>(base + d_offset);
358
+
359
+ const int bq8_offset = QR4_K * ((iqs / 2) / (QI8_1 / 2));
360
+ const int * q4 = (const int *) (qs + 16 * bq8_offset + 4 * ((iqs / 2) % 4));
361
+ const uint16_t * scales = (const uint16_t *) scs;
362
+
363
+ return vec_dot_q4_K_q8_1_common(q4, scales, *dms, bq8_1, iqs);
364
+ }
365
+ };
366
+
255
367
  #define VDR_Q4_0_Q8_1_MMVQ 2
256
368
  #define VDR_Q4_0_Q8_1_MMQ 4
257
369
 
258
370
  template <int vdr>
259
- static __dpct_inline__ float vec_dot_q4_0_q8_1_impl(const int *v, const int *u,
260
- const float &d4,
261
- const sycl::half2 &ds8) {
371
+ static __dpct_inline__ float vec_dot_q4_0_q8_1_impl(const int * v, const int * u, const float & d4,
372
+ const sycl::half2 & ds8) {
262
373
  int sumi = 0;
263
374
  #pragma unroll
264
375
  for (int i = 0; i < vdr; ++i) {
@@ -270,8 +381,7 @@ static __dpct_inline__ float vec_dot_q4_0_q8_1_impl(const int *v, const int *u,
270
381
  sumi = dpct::dp4a(vi1, u[2 * i + 1], sumi);
271
382
  }
272
383
 
273
- const sycl::float2 ds8f =
274
- ds8.convert<float, sycl::rounding_mode::automatic>();
384
+ const sycl::float2 ds8f = ds8.convert<float, sycl::rounding_mode::automatic>();
275
385
 
276
386
  // second part effectively subtracts 8 from each quant value
277
387
  return d4 * (sumi * ds8f.x() - (8 * vdr / QI4_0) * ds8f.y());
@@ -456,13 +566,13 @@ vec_dot_q4_0_q8_1(const void *__restrict__ vbq,
456
566
  const block_q4_0 * bq4_0 = (const block_q4_0 *) vbq;
457
567
 
458
568
  int v[VDR_Q4_0_Q8_1_MMVQ];
459
- int u[2*VDR_Q4_0_Q8_1_MMVQ];
569
+ int u[2 * VDR_Q4_0_Q8_1_MMVQ];
460
570
 
461
571
  #pragma unroll
462
572
  for (int i = 0; i < VDR_Q4_0_Q8_1_MMVQ; ++i) {
463
- v[i] = get_int_from_uint8(bq4_0->qs, iqs + i);
464
- u[2*i+0] = get_int_from_int8_aligned(bq8_1->qs, iqs + i);
465
- u[2*i+1] = get_int_from_int8_aligned(bq8_1->qs, iqs + i + QI4_0);
573
+ v[i] = get_int_from_uint8(bq4_0->qs, iqs + i);
574
+ u[2 * i + 0] = get_int_from_int8_aligned(bq8_1->qs, iqs + i);
575
+ u[2 * i + 1] = get_int_from_int8_aligned(bq8_1->qs, iqs + i + QI4_0);
466
576
  }
467
577
 
468
578
  return vec_dot_q4_0_q8_1_impl<VDR_Q4_0_Q8_1_MMVQ>(v, u, bq4_0->d, bq8_1->ds);
@@ -600,52 +710,17 @@ vec_dot_q3_K_q8_1(const void *__restrict__ vbq,
600
710
  return vec_dot_q3_K_q8_1_impl_mmvq(vl, vh, u, bq3_K->scales, scale_offset, d, d8);
601
711
  }
602
712
 
603
- static __dpct_inline__ float
604
- vec_dot_q4_K_q8_1(const void *__restrict__ vbq,
605
- const block_q8_1 *__restrict__ bq8_1, const int &iqs) {
606
-
713
+ static __dpct_inline__ float vec_dot_q4_K_q8_1(const void * __restrict__ vbq, const block_q8_1 * __restrict__ bq8_1,
714
+ const int & iqs) {
607
715
  #ifndef GGML_QKK_64
608
- const block_q4_K * bq4_K = (const block_q4_K *) vbq;
609
-
610
- int v[2];
611
- int u[2*QR4_K];
612
- float d8[QR4_K];
613
-
614
- // iqs is in 0,2..30. bq8_offset = iqs/4 -> bq8_offset = 0, 2, 4, 6
615
- const int bq8_offset = QR4_K * ((iqs/2) / (QI8_1/2));
616
716
 
617
- // iqs = 0....3 -> bq8_offset = 0, want q4_offset = 0, 4, 8, 12
618
- // iqs = 4....7 -> bq8_offset = 2, want q4_offset = 32, 36, 40, 44
619
- // iqs = 8...11 -> bq8_offset = 4, want q4_offset = 64, 68, 72, 76
620
- // iqs = 12..15 -> bq8_offset = 6, want q4_offset = 96, 100, 104, 108
621
-
622
- const int * q4 = (const int *)(bq4_K->qs + 16 * bq8_offset + 4 * ((iqs/2)%4));
623
- v[0] = q4[0];
624
- v[1] = q4[4];
625
-
626
- const uint16_t * scales = (const uint16_t *)bq4_K->scales;
627
- uint16_t aux[2];
628
- const int j = bq8_offset/2;
629
- if (j < 2) {
630
- aux[0] = scales[j+0] & 0x3f3f;
631
- aux[1] = scales[j+2] & 0x3f3f;
632
- } else {
633
- aux[0] = ((scales[j+2] >> 0) & 0x0f0f) | ((scales[j-2] & 0xc0c0) >> 2);
634
- aux[1] = ((scales[j+2] >> 4) & 0x0f0f) | ((scales[j-0] & 0xc0c0) >> 2);
635
- }
636
- const uint8_t * sc = (const uint8_t *)aux;
637
- const uint8_t * m = sc + 2;
638
-
639
- for (int i = 0; i < QR4_K; ++i) {
640
- const block_q8_1 * bq8i = bq8_1 + bq8_offset + i;
641
- d8[i] = bq8i->ds[0];
717
+ const block_q4_K * bq4_K = (const block_q4_K *) vbq;
642
718
 
643
- const int * q8 = (const int *)bq8i->qs + ((iqs/2)%4);
644
- u[2*i+0] = q8[0];
645
- u[2*i+1] = q8[4];
646
- }
719
+ const int bq8_offset = QR4_K * ((iqs / 2) / (QI8_1 / 2));
720
+ const int * q4 = (const int *) (bq4_K->qs + 16 * bq8_offset + 4 * ((iqs / 2) % 4));
721
+ const uint16_t * scales = (const uint16_t *) bq4_K->scales;
647
722
 
648
- return vec_dot_q4_K_q8_1_impl_vmmq(v, u, sc, m, bq4_K->dm, d8);
723
+ return vec_dot_q4_K_q8_1_common(q4, scales, bq4_K->dm, bq8_1, iqs);
649
724
 
650
725
  #else
651
726
 
@@ -15,6 +15,32 @@ function(detect_host_compiler)
15
15
  set(HOST_CXX_COMPILER "${HOST_CXX_COMPILER}" PARENT_SCOPE)
16
16
  endfunction()
17
17
 
18
+ # Function to test shader extension support
19
+ # Parameters:
20
+ # EXTENSION_NAME - Name of the extension to test (e.g., "GL_EXT_integer_dot_product")
21
+ # TEST_SHADER_FILE - Path to the test shader file
22
+ # RESULT_VARIABLE - Name of the variable to set (ON/OFF) based on test result
23
+ function(test_shader_extension_support EXTENSION_NAME TEST_SHADER_FILE RESULT_VARIABLE)
24
+ execute_process(
25
+ COMMAND ${Vulkan_GLSLC_EXECUTABLE} -o - -fshader-stage=compute --target-env=vulkan1.3 "${TEST_SHADER_FILE}"
26
+ OUTPUT_VARIABLE glslc_output
27
+ ERROR_VARIABLE glslc_error
28
+ )
29
+
30
+ if (${glslc_error} MATCHES ".*extension not supported: ${EXTENSION_NAME}.*")
31
+ message(STATUS "${EXTENSION_NAME} not supported by glslc")
32
+ set(${RESULT_VARIABLE} OFF PARENT_SCOPE)
33
+ else()
34
+ message(STATUS "${EXTENSION_NAME} supported by glslc")
35
+ set(${RESULT_VARIABLE} ON PARENT_SCOPE)
36
+ add_compile_definitions(${RESULT_VARIABLE})
37
+
38
+ # Ensure the extension support is forwarded to vulkan-shaders-gen
39
+ list(APPEND VULKAN_SHADER_GEN_CMAKE_ARGS -D${RESULT_VARIABLE}=ON)
40
+ set(VULKAN_SHADER_GEN_CMAKE_ARGS "${VULKAN_SHADER_GEN_CMAKE_ARGS}" PARENT_SCOPE)
41
+ endif()
42
+ endfunction()
43
+
18
44
  if (Vulkan_FOUND)
19
45
  message(STATUS "Vulkan found")
20
46
 
@@ -23,33 +49,40 @@ if (Vulkan_FOUND)
23
49
  ../../include/ggml-vulkan.h
24
50
  )
25
51
 
26
- # Compile a test shader to determine whether GL_KHR_cooperative_matrix is supported.
27
- # If it's not, there will be an error to stderr.
28
- # If it's supported, set a define to indicate that we should compile those shaders
29
- execute_process(COMMAND ${Vulkan_GLSLC_EXECUTABLE} -o - -fshader-stage=compute --target-env=vulkan1.3 "${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders/test_coopmat_support.comp"
30
- OUTPUT_VARIABLE glslc_output
31
- ERROR_VARIABLE glslc_error)
52
+ set(VULKAN_SHADER_GEN_CMAKE_ARGS
53
+ -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}
54
+ -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
55
+ )
32
56
 
33
- if (${glslc_error} MATCHES ".*extension not supported: GL_KHR_cooperative_matrix.*")
34
- message(STATUS "GL_KHR_cooperative_matrix not supported by glslc")
35
- else()
36
- message(STATUS "GL_KHR_cooperative_matrix supported by glslc")
37
- add_compile_definitions(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT)
57
+ set(VULKAN_SHADER_GEN_CMAKE_BUILD_ARGS "")
58
+ if (CMAKE_BUILD_TYPE AND CMAKE_BUILD_TYPE MATCHES "Debug|Release|MinSizeRel|RelWithDebInfo")
59
+ list(APPEND VULKAN_SHADER_GEN_CMAKE_BUILD_ARGS --config=${CMAKE_BUILD_TYPE})
38
60
  endif()
39
61
 
40
- # Compile a test shader to determine whether GL_NV_cooperative_matrix2 is supported.
41
- # If it's not, there will be an error to stderr.
42
- # If it's supported, set a define to indicate that we should compile those shaders
43
- execute_process(COMMAND ${Vulkan_GLSLC_EXECUTABLE} -o - -fshader-stage=compute --target-env=vulkan1.3 "${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders/test_coopmat2_support.comp"
44
- OUTPUT_VARIABLE glslc_output
45
- ERROR_VARIABLE glslc_error)
62
+ # Test all shader extensions
63
+ test_shader_extension_support(
64
+ "GL_KHR_cooperative_matrix"
65
+ "${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders/test_coopmat_support.comp"
66
+ "GGML_VULKAN_COOPMAT_GLSLC_SUPPORT"
67
+ )
46
68
 
47
- if (${glslc_error} MATCHES ".*extension not supported: GL_NV_cooperative_matrix2.*")
48
- message(STATUS "GL_NV_cooperative_matrix2 not supported by glslc")
49
- else()
50
- message(STATUS "GL_NV_cooperative_matrix2 supported by glslc")
51
- add_compile_definitions(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
52
- endif()
69
+ test_shader_extension_support(
70
+ "GL_NV_cooperative_matrix2"
71
+ "${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders/test_coopmat2_support.comp"
72
+ "GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT"
73
+ )
74
+
75
+ test_shader_extension_support(
76
+ "GL_EXT_integer_dot_product"
77
+ "${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders/test_integer_dot_support.comp"
78
+ "GGML_VULKAN_INTEGER_DOT_GLSLC_SUPPORT"
79
+ )
80
+
81
+ test_shader_extension_support(
82
+ "GL_EXT_bfloat16"
83
+ "${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders/test_bfloat16_support.comp"
84
+ "GGML_VULKAN_BFLOAT16_GLSLC_SUPPORT"
85
+ )
53
86
 
54
87
  target_link_libraries(ggml-vulkan PRIVATE Vulkan::Vulkan)
55
88
  target_include_directories(ggml-vulkan PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
@@ -88,16 +121,8 @@ if (Vulkan_FOUND)
88
121
  add_compile_definitions(GGML_VULKAN_RUN_TESTS)
89
122
  endif()
90
123
 
91
- if (NOT CMAKE_CROSSCOMPILING)
92
- add_subdirectory(vulkan-shaders)
93
- if (MSVC)
94
- foreach(CONFIG ${CMAKE_CONFIGURATION_TYPES})
95
- string(TOUPPER ${CONFIG} CONFIG)
96
- set_target_properties(vulkan-shaders-gen PROPERTIES
97
- RUNTIME_OUTPUT_DIRECTORY_${CONFIG} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
98
- endforeach()
99
- endif()
100
- else()
124
+ # Set up toolchain for host compilation whether cross-compiling or not
125
+ if (CMAKE_CROSSCOMPILING)
101
126
  if (GGML_VULKAN_SHADERS_GEN_TOOLCHAIN)
102
127
  set(HOST_CMAKE_TOOLCHAIN_FILE ${GGML_VULKAN_SHADERS_GEN_TOOLCHAIN})
103
128
  else()
@@ -110,21 +135,31 @@ if (Vulkan_FOUND)
110
135
  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/host-toolchain.cmake.in ${CMAKE_BINARY_DIR}/host-toolchain.cmake @ONLY)
111
136
  set(HOST_CMAKE_TOOLCHAIN_FILE ${CMAKE_BINARY_DIR}/host-toolchain.cmake)
112
137
  endif()
113
- message(STATUS "vulkan-shaders-gen toolchain file: ${HOST_CMAKE_TOOLCHAIN_FILE}")
138
+ else()
139
+ # For non-cross-compiling, use empty toolchain (use host compiler)
140
+ set(HOST_CMAKE_TOOLCHAIN_FILE "")
141
+ endif()
142
+
143
+ # Always use ExternalProject_Add approach
144
+ include(ExternalProject)
114
145
 
115
- include(ExternalProject)
116
- # Native build through ExternalProject_Add
117
- ExternalProject_Add(
118
- vulkan-shaders-gen
119
- SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders
120
- CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${HOST_CMAKE_TOOLCHAIN_FILE}
121
- -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}
122
- BUILD_COMMAND ${CMAKE_COMMAND} --build .
123
- INSTALL_COMMAND ${CMAKE_COMMAND} --install .
124
- INSTALL_DIR ${CMAKE_BINARY_DIR}
125
- )
126
- ExternalProject_Add_StepTargets(vulkan-shaders-gen build install)
146
+ # Add toolchain file if cross-compiling
147
+ if (CMAKE_CROSSCOMPILING)
148
+ list(APPEND VULKAN_SHADER_GEN_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${HOST_CMAKE_TOOLCHAIN_FILE})
149
+ message(STATUS "vulkan-shaders-gen toolchain file: ${HOST_CMAKE_TOOLCHAIN_FILE}")
127
150
  endif()
151
+
152
+ # Native build through ExternalProject_Add
153
+ ExternalProject_Add(
154
+ vulkan-shaders-gen
155
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders
156
+ CMAKE_ARGS ${VULKAN_SHADER_GEN_CMAKE_ARGS}
157
+ BUILD_COMMAND ${CMAKE_COMMAND} --build . ${VULKAN_SHADER_GEN_CMAKE_BUILD_ARGS}
158
+ INSTALL_COMMAND ${CMAKE_COMMAND} --install .
159
+ INSTALL_DIR ${CMAKE_BINARY_DIR}
160
+ )
161
+ ExternalProject_Add_StepTargets(vulkan-shaders-gen build install)
162
+
128
163
  set (_ggml_vk_host_suffix $<IF:$<STREQUAL:${CMAKE_HOST_SYSTEM_NAME},Windows>,.exe,>)
129
164
  set (_ggml_vk_genshaders_cmd ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/vulkan-shaders-gen${_ggml_vk_host_suffix})
130
165
  set (_ggml_vk_header ${CMAKE_CURRENT_BINARY_DIR}/ggml-vulkan-shaders.hpp)
@@ -135,9 +170,8 @@ if (Vulkan_FOUND)
135
170
  file(GLOB _ggml_vk_shader_deps "${_ggml_vk_input_dir}/*.comp")
136
171
  set (_ggml_vk_shader_deps ${_ggml_vk_shader_deps} vulkan-shaders-gen)
137
172
 
138
- if (CMAKE_CROSSCOMPILING)
139
- set(_ggml_vk_shader_deps ${_ggml_vk_shader_deps} vulkan-shaders-gen-build vulkan-shaders-gen-install)
140
- endif()
173
+ # Add build and install dependencies for all builds
174
+ set(_ggml_vk_shader_deps ${_ggml_vk_shader_deps} vulkan-shaders-gen-build vulkan-shaders-gen-install)
141
175
 
142
176
  add_custom_command(
143
177
  OUTPUT ${_ggml_vk_header}