@fugood/llama.node 0.6.3 → 1.0.0-beta.2

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 (377) 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 +40 -7
  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/src/llama.cpp/.github/workflows/build-linux-cross.yml +0 -233
  27. package/src/llama.cpp/.github/workflows/build.yml +0 -1078
  28. package/src/llama.cpp/.github/workflows/close-issue.yml +0 -28
  29. package/src/llama.cpp/.github/workflows/docker.yml +0 -178
  30. package/src/llama.cpp/.github/workflows/editorconfig.yml +0 -29
  31. package/src/llama.cpp/.github/workflows/gguf-publish.yml +0 -44
  32. package/src/llama.cpp/.github/workflows/labeler.yml +0 -17
  33. package/src/llama.cpp/.github/workflows/python-check-requirements.yml +0 -33
  34. package/src/llama.cpp/.github/workflows/python-lint.yml +0 -30
  35. package/src/llama.cpp/.github/workflows/python-type-check.yml +0 -40
  36. package/src/llama.cpp/.github/workflows/release.yml +0 -739
  37. package/src/llama.cpp/.github/workflows/server.yml +0 -237
  38. package/src/llama.cpp/.github/workflows/winget.yml +0 -42
  39. package/src/llama.cpp/cmake/arm64-apple-clang.cmake +0 -16
  40. package/src/llama.cpp/cmake/arm64-windows-llvm.cmake +0 -16
  41. package/src/llama.cpp/cmake/build-info.cmake +0 -64
  42. package/src/llama.cpp/cmake/common.cmake +0 -35
  43. package/src/llama.cpp/cmake/git-vars.cmake +0 -22
  44. package/src/llama.cpp/cmake/x64-windows-llvm.cmake +0 -5
  45. package/src/llama.cpp/common/build-info.cpp.in +0 -4
  46. package/src/llama.cpp/docs/build.md +0 -561
  47. package/src/llama.cpp/examples/CMakeLists.txt +0 -43
  48. package/src/llama.cpp/examples/batched/CMakeLists.txt +0 -5
  49. package/src/llama.cpp/examples/batched/batched.cpp +0 -246
  50. package/src/llama.cpp/examples/chat-13B.bat +0 -57
  51. package/src/llama.cpp/examples/convert-llama2c-to-ggml/CMakeLists.txt +0 -5
  52. package/src/llama.cpp/examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp +0 -941
  53. package/src/llama.cpp/examples/deprecation-warning/deprecation-warning.cpp +0 -35
  54. package/src/llama.cpp/examples/embedding/CMakeLists.txt +0 -5
  55. package/src/llama.cpp/examples/embedding/embedding.cpp +0 -323
  56. package/src/llama.cpp/examples/eval-callback/CMakeLists.txt +0 -10
  57. package/src/llama.cpp/examples/eval-callback/eval-callback.cpp +0 -194
  58. package/src/llama.cpp/examples/gen-docs/CMakeLists.txt +0 -5
  59. package/src/llama.cpp/examples/gen-docs/gen-docs.cpp +0 -83
  60. package/src/llama.cpp/examples/gguf/CMakeLists.txt +0 -5
  61. package/src/llama.cpp/examples/gguf/gguf.cpp +0 -265
  62. package/src/llama.cpp/examples/gguf-hash/CMakeLists.txt +0 -22
  63. package/src/llama.cpp/examples/gguf-hash/deps/rotate-bits/rotate-bits.h +0 -46
  64. package/src/llama.cpp/examples/gguf-hash/deps/sha1/sha1.c +0 -295
  65. package/src/llama.cpp/examples/gguf-hash/deps/sha1/sha1.h +0 -52
  66. package/src/llama.cpp/examples/gguf-hash/deps/sha256/sha256.c +0 -221
  67. package/src/llama.cpp/examples/gguf-hash/deps/sha256/sha256.h +0 -24
  68. package/src/llama.cpp/examples/gguf-hash/deps/xxhash/xxhash.c +0 -42
  69. package/src/llama.cpp/examples/gguf-hash/deps/xxhash/xxhash.h +0 -7093
  70. package/src/llama.cpp/examples/gguf-hash/gguf-hash.cpp +0 -694
  71. package/src/llama.cpp/examples/gritlm/CMakeLists.txt +0 -5
  72. package/src/llama.cpp/examples/gritlm/gritlm.cpp +0 -229
  73. package/src/llama.cpp/examples/jeopardy/questions.txt +0 -100
  74. package/src/llama.cpp/examples/llama.android/app/build.gradle.kts +0 -65
  75. package/src/llama.cpp/examples/llama.android/build.gradle.kts +0 -6
  76. package/src/llama.cpp/examples/llama.android/llama/build.gradle.kts +0 -71
  77. package/src/llama.cpp/examples/llama.android/llama/src/main/cpp/CMakeLists.txt +0 -53
  78. package/src/llama.cpp/examples/llama.android/llama/src/main/cpp/llama-android.cpp +0 -452
  79. package/src/llama.cpp/examples/llama.android/settings.gradle.kts +0 -18
  80. package/src/llama.cpp/examples/lookahead/CMakeLists.txt +0 -5
  81. package/src/llama.cpp/examples/lookahead/lookahead.cpp +0 -472
  82. package/src/llama.cpp/examples/lookup/CMakeLists.txt +0 -23
  83. package/src/llama.cpp/examples/lookup/lookup-create.cpp +0 -40
  84. package/src/llama.cpp/examples/lookup/lookup-merge.cpp +0 -47
  85. package/src/llama.cpp/examples/lookup/lookup-stats.cpp +0 -157
  86. package/src/llama.cpp/examples/lookup/lookup.cpp +0 -242
  87. package/src/llama.cpp/examples/parallel/CMakeLists.txt +0 -5
  88. package/src/llama.cpp/examples/parallel/parallel.cpp +0 -492
  89. package/src/llama.cpp/examples/passkey/CMakeLists.txt +0 -5
  90. package/src/llama.cpp/examples/passkey/passkey.cpp +0 -277
  91. package/src/llama.cpp/examples/retrieval/CMakeLists.txt +0 -5
  92. package/src/llama.cpp/examples/retrieval/retrieval.cpp +0 -304
  93. package/src/llama.cpp/examples/save-load-state/CMakeLists.txt +0 -5
  94. package/src/llama.cpp/examples/save-load-state/save-load-state.cpp +0 -246
  95. package/src/llama.cpp/examples/simple/CMakeLists.txt +0 -5
  96. package/src/llama.cpp/examples/simple/simple.cpp +0 -206
  97. package/src/llama.cpp/examples/simple-chat/CMakeLists.txt +0 -5
  98. package/src/llama.cpp/examples/simple-chat/simple-chat.cpp +0 -206
  99. package/src/llama.cpp/examples/simple-cmake-pkg/CMakeLists.txt +0 -11
  100. package/src/llama.cpp/examples/speculative/CMakeLists.txt +0 -5
  101. package/src/llama.cpp/examples/speculative/speculative.cpp +0 -644
  102. package/src/llama.cpp/examples/speculative-simple/CMakeLists.txt +0 -5
  103. package/src/llama.cpp/examples/speculative-simple/speculative-simple.cpp +0 -261
  104. package/src/llama.cpp/examples/sycl/CMakeLists.txt +0 -9
  105. package/src/llama.cpp/examples/sycl/build.sh +0 -23
  106. package/src/llama.cpp/examples/sycl/ls-sycl-device.cpp +0 -13
  107. package/src/llama.cpp/examples/sycl/run-llama2.sh +0 -27
  108. package/src/llama.cpp/examples/sycl/run-llama3.sh +0 -28
  109. package/src/llama.cpp/examples/sycl/win-build-sycl.bat +0 -33
  110. package/src/llama.cpp/examples/sycl/win-run-llama2.bat +0 -9
  111. package/src/llama.cpp/examples/sycl/win-run-llama3.bat +0 -9
  112. package/src/llama.cpp/examples/training/CMakeLists.txt +0 -5
  113. package/src/llama.cpp/examples/training/finetune.cpp +0 -96
  114. package/src/llama.cpp/ggml/cmake/GitVars.cmake +0 -22
  115. package/src/llama.cpp/ggml/cmake/common.cmake +0 -26
  116. package/src/llama.cpp/ggml/src/ggml-alloc.c +0 -1042
  117. package/src/llama.cpp/ggml/src/ggml-backend-impl.h +0 -255
  118. package/src/llama.cpp/ggml/src/ggml-backend-reg.cpp +0 -586
  119. package/src/llama.cpp/ggml/src/ggml-backend.cpp +0 -2008
  120. package/src/llama.cpp/ggml/src/ggml-blas/CMakeLists.txt +0 -87
  121. package/src/llama.cpp/ggml/src/ggml-blas/ggml-blas.cpp +0 -517
  122. package/src/llama.cpp/ggml/src/ggml-cann/CMakeLists.txt +0 -74
  123. package/src/llama.cpp/ggml/src/ggml-cann/acl_tensor.cpp +0 -179
  124. package/src/llama.cpp/ggml/src/ggml-cann/acl_tensor.h +0 -258
  125. package/src/llama.cpp/ggml/src/ggml-cann/aclnn_ops.cpp +0 -2863
  126. package/src/llama.cpp/ggml/src/ggml-cann/aclnn_ops.h +0 -1110
  127. package/src/llama.cpp/ggml/src/ggml-cann/common.h +0 -420
  128. package/src/llama.cpp/ggml/src/ggml-cann/ggml-cann.cpp +0 -2570
  129. package/src/llama.cpp/ggml/src/ggml-common.h +0 -1857
  130. package/src/llama.cpp/ggml/src/ggml-cpu/cmake/FindSIMD.cmake +0 -100
  131. package/src/llama.cpp/ggml/src/ggml-cuda/CMakeLists.txt +0 -184
  132. package/src/llama.cpp/ggml/src/ggml-cuda/vendors/cuda.h +0 -15
  133. package/src/llama.cpp/ggml/src/ggml-cuda/vendors/hip.h +0 -243
  134. package/src/llama.cpp/ggml/src/ggml-cuda/vendors/musa.h +0 -140
  135. package/src/llama.cpp/ggml/src/ggml-hip/CMakeLists.txt +0 -131
  136. package/src/llama.cpp/ggml/src/ggml-impl.h +0 -601
  137. package/src/llama.cpp/ggml/src/ggml-kompute/CMakeLists.txt +0 -166
  138. package/src/llama.cpp/ggml/src/ggml-kompute/ggml-kompute.cpp +0 -2251
  139. package/src/llama.cpp/ggml/src/ggml-metal/CMakeLists.txt +0 -120
  140. package/src/llama.cpp/ggml/src/ggml-metal/ggml-metal-impl.h +0 -622
  141. package/src/llama.cpp/ggml/src/ggml-musa/CMakeLists.txt +0 -113
  142. package/src/llama.cpp/ggml/src/ggml-opencl/CMakeLists.txt +0 -96
  143. package/src/llama.cpp/ggml/src/ggml-opencl/ggml-opencl.cpp +0 -5124
  144. package/src/llama.cpp/ggml/src/ggml-opt.cpp +0 -1037
  145. package/src/llama.cpp/ggml/src/ggml-quants.c +0 -5232
  146. package/src/llama.cpp/ggml/src/ggml-quants.h +0 -100
  147. package/src/llama.cpp/ggml/src/ggml-rpc/CMakeLists.txt +0 -9
  148. package/src/llama.cpp/ggml/src/ggml-rpc/ggml-rpc.cpp +0 -1813
  149. package/src/llama.cpp/ggml/src/ggml-sycl/CMakeLists.txt +0 -189
  150. package/src/llama.cpp/ggml/src/ggml-sycl/backend.hpp +0 -37
  151. package/src/llama.cpp/ggml/src/ggml-sycl/binbcast.cpp +0 -239
  152. package/src/llama.cpp/ggml/src/ggml-sycl/binbcast.hpp +0 -39
  153. package/src/llama.cpp/ggml/src/ggml-sycl/common.cpp +0 -83
  154. package/src/llama.cpp/ggml/src/ggml-sycl/common.hpp +0 -493
  155. package/src/llama.cpp/ggml/src/ggml-sycl/concat.cpp +0 -197
  156. package/src/llama.cpp/ggml/src/ggml-sycl/concat.hpp +0 -20
  157. package/src/llama.cpp/ggml/src/ggml-sycl/conv.cpp +0 -100
  158. package/src/llama.cpp/ggml/src/ggml-sycl/conv.hpp +0 -20
  159. package/src/llama.cpp/ggml/src/ggml-sycl/convert.cpp +0 -623
  160. package/src/llama.cpp/ggml/src/ggml-sycl/convert.hpp +0 -34
  161. package/src/llama.cpp/ggml/src/ggml-sycl/cpy.cpp +0 -701
  162. package/src/llama.cpp/ggml/src/ggml-sycl/cpy.hpp +0 -11
  163. package/src/llama.cpp/ggml/src/ggml-sycl/dequantize.hpp +0 -791
  164. package/src/llama.cpp/ggml/src/ggml-sycl/dmmv.cpp +0 -1160
  165. package/src/llama.cpp/ggml/src/ggml-sycl/dmmv.hpp +0 -27
  166. package/src/llama.cpp/ggml/src/ggml-sycl/dpct/helper.hpp +0 -2957
  167. package/src/llama.cpp/ggml/src/ggml-sycl/element_wise.cpp +0 -1536
  168. package/src/llama.cpp/ggml/src/ggml-sycl/element_wise.hpp +0 -75
  169. package/src/llama.cpp/ggml/src/ggml-sycl/gemm.hpp +0 -99
  170. package/src/llama.cpp/ggml/src/ggml-sycl/getrows.cpp +0 -311
  171. package/src/llama.cpp/ggml/src/ggml-sycl/getrows.hpp +0 -20
  172. package/src/llama.cpp/ggml/src/ggml-sycl/ggml-sycl.cpp +0 -4443
  173. package/src/llama.cpp/ggml/src/ggml-sycl/gla.cpp +0 -105
  174. package/src/llama.cpp/ggml/src/ggml-sycl/gla.hpp +0 -8
  175. package/src/llama.cpp/ggml/src/ggml-sycl/im2col.cpp +0 -136
  176. package/src/llama.cpp/ggml/src/ggml-sycl/im2col.hpp +0 -21
  177. package/src/llama.cpp/ggml/src/ggml-sycl/mmq.cpp +0 -3030
  178. package/src/llama.cpp/ggml/src/ggml-sycl/mmq.hpp +0 -33
  179. package/src/llama.cpp/ggml/src/ggml-sycl/mmvq.cpp +0 -1108
  180. package/src/llama.cpp/ggml/src/ggml-sycl/mmvq.hpp +0 -27
  181. package/src/llama.cpp/ggml/src/ggml-sycl/norm.cpp +0 -474
  182. package/src/llama.cpp/ggml/src/ggml-sycl/norm.hpp +0 -26
  183. package/src/llama.cpp/ggml/src/ggml-sycl/outprod.cpp +0 -46
  184. package/src/llama.cpp/ggml/src/ggml-sycl/outprod.hpp +0 -10
  185. package/src/llama.cpp/ggml/src/ggml-sycl/presets.hpp +0 -74
  186. package/src/llama.cpp/ggml/src/ggml-sycl/quants.hpp +0 -83
  187. package/src/llama.cpp/ggml/src/ggml-sycl/rope.cpp +0 -362
  188. package/src/llama.cpp/ggml/src/ggml-sycl/rope.hpp +0 -20
  189. package/src/llama.cpp/ggml/src/ggml-sycl/softmax.cpp +0 -264
  190. package/src/llama.cpp/ggml/src/ggml-sycl/softmax.hpp +0 -20
  191. package/src/llama.cpp/ggml/src/ggml-sycl/sycl_hw.cpp +0 -13
  192. package/src/llama.cpp/ggml/src/ggml-sycl/sycl_hw.hpp +0 -23
  193. package/src/llama.cpp/ggml/src/ggml-sycl/tsembd.cpp +0 -73
  194. package/src/llama.cpp/ggml/src/ggml-sycl/tsembd.hpp +0 -20
  195. package/src/llama.cpp/ggml/src/ggml-sycl/vecdotq.hpp +0 -1215
  196. package/src/llama.cpp/ggml/src/ggml-sycl/wkv.cpp +0 -305
  197. package/src/llama.cpp/ggml/src/ggml-sycl/wkv.hpp +0 -10
  198. package/src/llama.cpp/ggml/src/ggml-threading.cpp +0 -12
  199. package/src/llama.cpp/ggml/src/ggml-threading.h +0 -14
  200. package/src/llama.cpp/ggml/src/ggml-vulkan/CMakeLists.txt +0 -196
  201. package/src/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp +0 -10699
  202. package/src/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/CMakeLists.txt +0 -39
  203. package/src/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp +0 -751
  204. package/src/llama.cpp/ggml/src/ggml.c +0 -6550
  205. package/src/llama.cpp/ggml/src/gguf.cpp +0 -1330
  206. package/src/llama.cpp/models/.editorconfig +0 -1
  207. package/src/llama.cpp/models/ggml-vocab-aquila.gguf +0 -0
  208. package/src/llama.cpp/models/ggml-vocab-baichuan.gguf +0 -0
  209. package/src/llama.cpp/models/ggml-vocab-bert-bge.gguf +0 -0
  210. package/src/llama.cpp/models/ggml-vocab-bert-bge.gguf.inp +0 -112
  211. package/src/llama.cpp/models/ggml-vocab-bert-bge.gguf.out +0 -46
  212. package/src/llama.cpp/models/ggml-vocab-chameleon.gguf.inp +0 -112
  213. package/src/llama.cpp/models/ggml-vocab-chameleon.gguf.out +0 -46
  214. package/src/llama.cpp/models/ggml-vocab-command-r.gguf +0 -0
  215. package/src/llama.cpp/models/ggml-vocab-command-r.gguf.inp +0 -112
  216. package/src/llama.cpp/models/ggml-vocab-command-r.gguf.out +0 -46
  217. package/src/llama.cpp/models/ggml-vocab-deepseek-coder.gguf +0 -0
  218. package/src/llama.cpp/models/ggml-vocab-deepseek-coder.gguf.inp +0 -112
  219. package/src/llama.cpp/models/ggml-vocab-deepseek-coder.gguf.out +0 -46
  220. package/src/llama.cpp/models/ggml-vocab-deepseek-llm.gguf +0 -0
  221. package/src/llama.cpp/models/ggml-vocab-deepseek-llm.gguf.inp +0 -112
  222. package/src/llama.cpp/models/ggml-vocab-deepseek-llm.gguf.out +0 -46
  223. package/src/llama.cpp/models/ggml-vocab-deepseek-r1-qwen.gguf.inp +0 -112
  224. package/src/llama.cpp/models/ggml-vocab-deepseek-r1-qwen.gguf.out +0 -46
  225. package/src/llama.cpp/models/ggml-vocab-falcon.gguf +0 -0
  226. package/src/llama.cpp/models/ggml-vocab-falcon.gguf.inp +0 -112
  227. package/src/llama.cpp/models/ggml-vocab-falcon.gguf.out +0 -46
  228. package/src/llama.cpp/models/ggml-vocab-gpt-2.gguf +0 -0
  229. package/src/llama.cpp/models/ggml-vocab-gpt-2.gguf.inp +0 -112
  230. package/src/llama.cpp/models/ggml-vocab-gpt-2.gguf.out +0 -46
  231. package/src/llama.cpp/models/ggml-vocab-gpt-4o.gguf.inp +0 -112
  232. package/src/llama.cpp/models/ggml-vocab-gpt-4o.gguf.out +0 -46
  233. package/src/llama.cpp/models/ggml-vocab-gpt-neox.gguf +0 -0
  234. package/src/llama.cpp/models/ggml-vocab-llama-bpe.gguf +0 -0
  235. package/src/llama.cpp/models/ggml-vocab-llama-bpe.gguf.inp +0 -112
  236. package/src/llama.cpp/models/ggml-vocab-llama-bpe.gguf.out +0 -46
  237. package/src/llama.cpp/models/ggml-vocab-llama-spm.gguf +0 -0
  238. package/src/llama.cpp/models/ggml-vocab-llama-spm.gguf.inp +0 -112
  239. package/src/llama.cpp/models/ggml-vocab-llama-spm.gguf.out +0 -46
  240. package/src/llama.cpp/models/ggml-vocab-llama4.gguf.inp +0 -112
  241. package/src/llama.cpp/models/ggml-vocab-llama4.gguf.out +0 -46
  242. package/src/llama.cpp/models/ggml-vocab-mpt.gguf +0 -0
  243. package/src/llama.cpp/models/ggml-vocab-mpt.gguf.inp +0 -112
  244. package/src/llama.cpp/models/ggml-vocab-mpt.gguf.out +0 -46
  245. package/src/llama.cpp/models/ggml-vocab-phi-3.gguf +0 -0
  246. package/src/llama.cpp/models/ggml-vocab-phi-3.gguf.inp +0 -112
  247. package/src/llama.cpp/models/ggml-vocab-phi-3.gguf.out +0 -46
  248. package/src/llama.cpp/models/ggml-vocab-pixtral.gguf.inp +0 -112
  249. package/src/llama.cpp/models/ggml-vocab-pixtral.gguf.out +0 -46
  250. package/src/llama.cpp/models/ggml-vocab-qwen2.gguf +0 -0
  251. package/src/llama.cpp/models/ggml-vocab-qwen2.gguf.inp +0 -112
  252. package/src/llama.cpp/models/ggml-vocab-qwen2.gguf.out +0 -46
  253. package/src/llama.cpp/models/ggml-vocab-refact.gguf +0 -0
  254. package/src/llama.cpp/models/ggml-vocab-refact.gguf.inp +0 -112
  255. package/src/llama.cpp/models/ggml-vocab-refact.gguf.out +0 -46
  256. package/src/llama.cpp/models/ggml-vocab-roberta-bpe.gguf.inp +0 -112
  257. package/src/llama.cpp/models/ggml-vocab-roberta-bpe.gguf.out +0 -46
  258. package/src/llama.cpp/models/ggml-vocab-starcoder.gguf +0 -0
  259. package/src/llama.cpp/models/ggml-vocab-starcoder.gguf.inp +0 -112
  260. package/src/llama.cpp/models/ggml-vocab-starcoder.gguf.out +0 -46
  261. package/src/llama.cpp/pocs/CMakeLists.txt +0 -14
  262. package/src/llama.cpp/pocs/vdot/CMakeLists.txt +0 -9
  263. package/src/llama.cpp/pocs/vdot/q8dot.cpp +0 -173
  264. package/src/llama.cpp/pocs/vdot/vdot.cpp +0 -311
  265. package/src/llama.cpp/prompts/LLM-questions.txt +0 -49
  266. package/src/llama.cpp/prompts/alpaca.txt +0 -1
  267. package/src/llama.cpp/prompts/assistant.txt +0 -31
  268. package/src/llama.cpp/prompts/chat-with-baichuan.txt +0 -4
  269. package/src/llama.cpp/prompts/chat-with-bob.txt +0 -7
  270. package/src/llama.cpp/prompts/chat-with-qwen.txt +0 -1
  271. package/src/llama.cpp/prompts/chat-with-vicuna-v0.txt +0 -7
  272. package/src/llama.cpp/prompts/chat-with-vicuna-v1.txt +0 -7
  273. package/src/llama.cpp/prompts/chat.txt +0 -28
  274. package/src/llama.cpp/prompts/dan-modified.txt +0 -1
  275. package/src/llama.cpp/prompts/dan.txt +0 -1
  276. package/src/llama.cpp/prompts/mnemonics.txt +0 -93
  277. package/src/llama.cpp/prompts/parallel-questions.txt +0 -43
  278. package/src/llama.cpp/prompts/reason-act.txt +0 -18
  279. package/src/llama.cpp/requirements/requirements-all.txt +0 -15
  280. package/src/llama.cpp/requirements/requirements-compare-llama-bench.txt +0 -2
  281. package/src/llama.cpp/requirements/requirements-convert_hf_to_gguf.txt +0 -7
  282. package/src/llama.cpp/requirements/requirements-convert_hf_to_gguf_update.txt +0 -7
  283. package/src/llama.cpp/requirements/requirements-convert_legacy_llama.txt +0 -5
  284. package/src/llama.cpp/requirements/requirements-convert_llama_ggml_to_gguf.txt +0 -1
  285. package/src/llama.cpp/requirements/requirements-convert_lora_to_gguf.txt +0 -4
  286. package/src/llama.cpp/requirements/requirements-gguf_editor_gui.txt +0 -3
  287. package/src/llama.cpp/requirements/requirements-pydantic.txt +0 -3
  288. package/src/llama.cpp/requirements/requirements-test-tokenizer-random.txt +0 -1
  289. package/src/llama.cpp/requirements/requirements-tool_bench.txt +0 -12
  290. package/src/llama.cpp/requirements.txt +0 -13
  291. package/src/llama.cpp/scripts/build-info.sh +0 -30
  292. package/src/llama.cpp/scripts/install-oneapi.bat +0 -19
  293. package/src/llama.cpp/scripts/xxd.cmake +0 -16
  294. package/src/llama.cpp/tests/CMakeLists.txt +0 -177
  295. package/src/llama.cpp/tests/get-model.cpp +0 -21
  296. package/src/llama.cpp/tests/get-model.h +0 -2
  297. package/src/llama.cpp/tests/test-arg-parser.cpp +0 -178
  298. package/src/llama.cpp/tests/test-autorelease.cpp +0 -24
  299. package/src/llama.cpp/tests/test-backend-ops.cpp +0 -4793
  300. package/src/llama.cpp/tests/test-barrier.cpp +0 -94
  301. package/src/llama.cpp/tests/test-c.c +0 -7
  302. package/src/llama.cpp/tests/test-chat-template.cpp +0 -417
  303. package/src/llama.cpp/tests/test-chat.cpp +0 -985
  304. package/src/llama.cpp/tests/test-double-float.cpp +0 -57
  305. package/src/llama.cpp/tests/test-gbnf-validator.cpp +0 -109
  306. package/src/llama.cpp/tests/test-gguf.cpp +0 -1338
  307. package/src/llama.cpp/tests/test-grammar-integration.cpp +0 -1308
  308. package/src/llama.cpp/tests/test-grammar-llguidance.cpp +0 -1201
  309. package/src/llama.cpp/tests/test-grammar-parser.cpp +0 -519
  310. package/src/llama.cpp/tests/test-json-schema-to-grammar.cpp +0 -1304
  311. package/src/llama.cpp/tests/test-llama-grammar.cpp +0 -408
  312. package/src/llama.cpp/tests/test-log.cpp +0 -39
  313. package/src/llama.cpp/tests/test-model-load-cancel.cpp +0 -27
  314. package/src/llama.cpp/tests/test-mtmd-c-api.c +0 -63
  315. package/src/llama.cpp/tests/test-opt.cpp +0 -904
  316. package/src/llama.cpp/tests/test-quantize-fns.cpp +0 -186
  317. package/src/llama.cpp/tests/test-quantize-perf.cpp +0 -365
  318. package/src/llama.cpp/tests/test-quantize-stats.cpp +0 -424
  319. package/src/llama.cpp/tests/test-regex-partial.cpp +0 -288
  320. package/src/llama.cpp/tests/test-rope.cpp +0 -262
  321. package/src/llama.cpp/tests/test-sampling.cpp +0 -399
  322. package/src/llama.cpp/tests/test-tokenizer-0.cpp +0 -312
  323. package/src/llama.cpp/tests/test-tokenizer-1-bpe.cpp +0 -155
  324. package/src/llama.cpp/tests/test-tokenizer-1-spm.cpp +0 -125
  325. package/src/llama.cpp/tools/CMakeLists.txt +0 -39
  326. package/src/llama.cpp/tools/batched-bench/CMakeLists.txt +0 -5
  327. package/src/llama.cpp/tools/batched-bench/batched-bench.cpp +0 -204
  328. package/src/llama.cpp/tools/cvector-generator/CMakeLists.txt +0 -5
  329. package/src/llama.cpp/tools/cvector-generator/completions.txt +0 -582
  330. package/src/llama.cpp/tools/cvector-generator/cvector-generator.cpp +0 -508
  331. package/src/llama.cpp/tools/cvector-generator/mean.hpp +0 -48
  332. package/src/llama.cpp/tools/cvector-generator/negative.txt +0 -4
  333. package/src/llama.cpp/tools/cvector-generator/pca.hpp +0 -315
  334. package/src/llama.cpp/tools/cvector-generator/positive.txt +0 -4
  335. package/src/llama.cpp/tools/export-lora/CMakeLists.txt +0 -5
  336. package/src/llama.cpp/tools/export-lora/export-lora.cpp +0 -434
  337. package/src/llama.cpp/tools/gguf-split/CMakeLists.txt +0 -5
  338. package/src/llama.cpp/tools/gguf-split/gguf-split.cpp +0 -583
  339. package/src/llama.cpp/tools/imatrix/CMakeLists.txt +0 -5
  340. package/src/llama.cpp/tools/imatrix/imatrix.cpp +0 -667
  341. package/src/llama.cpp/tools/llama-bench/CMakeLists.txt +0 -5
  342. package/src/llama.cpp/tools/llama-bench/llama-bench.cpp +0 -2024
  343. package/src/llama.cpp/tools/main/CMakeLists.txt +0 -5
  344. package/src/llama.cpp/tools/main/main.cpp +0 -977
  345. package/src/llama.cpp/tools/mtmd/CMakeLists.txt +0 -58
  346. package/src/llama.cpp/tools/mtmd/clip-impl.h +0 -462
  347. package/src/llama.cpp/tools/mtmd/clip.cpp +0 -4024
  348. package/src/llama.cpp/tools/mtmd/clip.h +0 -101
  349. package/src/llama.cpp/tools/mtmd/deprecation-warning.cpp +0 -22
  350. package/src/llama.cpp/tools/mtmd/miniaudio.h +0 -93468
  351. package/src/llama.cpp/tools/mtmd/mtmd-audio.cpp +0 -855
  352. package/src/llama.cpp/tools/mtmd/mtmd-audio.h +0 -62
  353. package/src/llama.cpp/tools/mtmd/mtmd-cli.cpp +0 -377
  354. package/src/llama.cpp/tools/mtmd/mtmd-helper.cpp +0 -297
  355. package/src/llama.cpp/tools/mtmd/mtmd.cpp +0 -942
  356. package/src/llama.cpp/tools/mtmd/mtmd.h +0 -362
  357. package/src/llama.cpp/tools/mtmd/requirements.txt +0 -5
  358. package/src/llama.cpp/tools/perplexity/CMakeLists.txt +0 -5
  359. package/src/llama.cpp/tools/perplexity/perplexity.cpp +0 -2063
  360. package/src/llama.cpp/tools/quantize/CMakeLists.txt +0 -6
  361. package/src/llama.cpp/tools/quantize/quantize.cpp +0 -519
  362. package/src/llama.cpp/tools/rpc/CMakeLists.txt +0 -4
  363. package/src/llama.cpp/tools/rpc/rpc-server.cpp +0 -322
  364. package/src/llama.cpp/tools/run/CMakeLists.txt +0 -16
  365. package/src/llama.cpp/tools/run/linenoise.cpp/linenoise.cpp +0 -1995
  366. package/src/llama.cpp/tools/run/linenoise.cpp/linenoise.h +0 -137
  367. package/src/llama.cpp/tools/run/run.cpp +0 -1261
  368. package/src/llama.cpp/tools/server/CMakeLists.txt +0 -51
  369. package/src/llama.cpp/tools/server/bench/requirements.txt +0 -2
  370. package/src/llama.cpp/tools/server/httplib.h +0 -10506
  371. package/src/llama.cpp/tools/server/server.cpp +0 -4966
  372. package/src/llama.cpp/tools/server/tests/requirements.txt +0 -8
  373. package/src/llama.cpp/tools/server/utils.hpp +0 -1337
  374. package/src/llama.cpp/tools/tokenize/CMakeLists.txt +0 -5
  375. package/src/llama.cpp/tools/tokenize/tokenize.cpp +0 -416
  376. package/src/llama.cpp/tools/tts/CMakeLists.txt +0 -5
  377. package/src/llama.cpp/tools/tts/tts.cpp +0 -1092
@@ -1,701 +0,0 @@
1
- #include "cpy.hpp"
2
-
3
- #include <float.h>
4
-
5
- #include "dequantize.hpp"
6
-
7
- static __dpct_inline__ int best_index_int8(int n, const int8_t * val, float x) {
8
- if (x <= val[0]) {
9
- return 0;
10
- }
11
- if (x >= val[n - 1]) {
12
- return n - 1;
13
- }
14
- int ml = 0, mu = n - 1;
15
- while (mu - ml > 1) {
16
- int mav = (ml + mu) / 2;
17
- if (x < val[mav]) {
18
- mu = mav;
19
- } else {
20
- ml = mav;
21
- }
22
- }
23
- return x - val[mu - 1] < val[mu] - x ? mu - 1 : mu;
24
- }
25
-
26
- static void cpy_1_f32_f32(const char * cxi, char * cdsti) {
27
- const float * xi = (const float *) cxi;
28
- float * dsti = (float *) cdsti;
29
-
30
- *dsti = *xi;
31
- }
32
-
33
- static void cpy_1_f32_f16(const char * cxi, char * cdsti) {
34
- const float * xi = (const float *) cxi;
35
- sycl::half * dsti = (sycl::half *) cdsti;
36
-
37
- *dsti = sycl::vec<float, 1>(*xi).convert<sycl::half, sycl::rounding_mode::automatic>()[0];
38
- }
39
-
40
- static void cpy_1_f16_f16(const char * cxi, char * cdsti) {
41
- const sycl::half * xi = (const sycl::half *) cxi;
42
- sycl::half * dsti = (sycl::half *) cdsti;
43
-
44
- *dsti = *xi;
45
- }
46
-
47
- static void cpy_1_f16_f32(const char * cxi, char * cdsti) {
48
- const sycl::half * xi = (const sycl::half *) cxi;
49
- float * dsti = (float *) cdsti;
50
-
51
- *dsti = *xi;
52
- }
53
-
54
- static void cpy_1_i16_i16(const char * cxi, char * cdsti) {
55
- const int16_t * xi = (const int16_t *) cxi;
56
- int16_t * dsti = (int16_t *) cdsti;
57
-
58
- *dsti = *xi;
59
- }
60
-
61
- static void cpy_1_i32_i32(const char * cxi, char * cdsti) {
62
- const int32_t * xi = (const int32_t *) cxi;
63
- int32_t * dsti = (int32_t *) cdsti;
64
-
65
- *dsti = *xi;
66
- }
67
-
68
- template <cpy_kernel_t cpy_1>
69
- static void cpy_f32_f16(const char * cx, char * cdst, const int ne, const int ne00, const int ne01, const int ne02,
70
- const int nb00, const int nb01, const int nb02, const int nb03, const int ne10, const int ne11,
71
- const int ne12, const int nb10, const int nb11, const int nb12, const int nb13,
72
- const sycl::nd_item<3> & item_ct1) {
73
- const int i = item_ct1.get_local_range(2) * item_ct1.get_group(2) + item_ct1.get_local_id(2);
74
-
75
- if (i >= ne) {
76
- return;
77
- }
78
-
79
- // determine indices i02/i12, i01/i11, i00/i10 as a function of index i of flattened tensor
80
- // then combine those indices with the corresponding byte offsets to get the total offsets
81
- const int i03 = i / (ne00 * ne01 * ne02);
82
- const int i02 = (i - i03 * ne00 * ne01 * ne02) / (ne00 * ne01);
83
- const int i01 = (i - i03 * ne00 * ne01 * ne02 - i02 * ne01 * ne00) / ne00;
84
- const int i00 = i - i03 * ne00 * ne01 * ne02 - i02 * ne01 * ne00 - i01 * ne00;
85
- const int x_offset = i00 * nb00 + i01 * nb01 + i02 * nb02 + i03 * nb03;
86
-
87
- const int i13 = i / (ne10 * ne11 * ne12);
88
- const int i12 = (i - i13 * ne10 * ne11 * ne12) / (ne10 * ne11);
89
- const int i11 = (i - i13 * ne10 * ne11 * ne12 - i12 * ne10 * ne11) / ne10;
90
- const int i10 = i - i13 * ne10 * ne11 * ne12 - i12 * ne10 * ne11 - i11 * ne10;
91
- const int dst_offset = i10 * nb10 + i11 * nb11 + i12 * nb12 + i13 * nb13;
92
-
93
- cpy_1(cx + x_offset, cdst + dst_offset);
94
- }
95
-
96
- static void cpy_blck_f32_q8_0(const char * cxi, char * cdsti) {
97
- const float * xi = (const float *) cxi;
98
- block_q8_0 * dsti = (block_q8_0 *) cdsti;
99
-
100
- float amax = 0.0f; // absolute max
101
-
102
- for (int j = 0; j < QK8_0; j++) {
103
- const float v = xi[j];
104
- amax = sycl::fmax(amax, sycl::fabs((float) v));
105
- }
106
-
107
- const float d = amax / ((1 << 7) - 1);
108
- const float id = d ? 1.0f / d : 0.0f;
109
-
110
- dsti->d = d;
111
-
112
- for (int j = 0; j < QK8_0; ++j) {
113
- const float x0 = xi[j] * id;
114
-
115
- dsti->qs[j] = sycl::round((float) x0);
116
- }
117
- }
118
-
119
- static void cpy_blck_q8_0_f32(const char * cxi, char * cdsti) {
120
- float * cdstf = (float *) (cdsti);
121
-
122
- for (int j = 0; j < QK8_0; j += 2) {
123
- dfloat2 dq;
124
- dequantize_q8_0(cxi, 0, j, dq);
125
- *(cdstf + j) = dq.x();
126
- *(cdstf + j + 1) = dq.y();
127
- }
128
- }
129
-
130
- static void cpy_blck_f32_q4_0(const char * cxi, char * cdsti) {
131
- const float * xi = (const float *) cxi;
132
- block_q4_0 * dsti = (block_q4_0 *) cdsti;
133
-
134
- float amax = 0.0f;
135
- float vmax = 0.0f;
136
-
137
- for (int j = 0; j < QK4_0; ++j) {
138
- const float v = xi[j];
139
- if (amax < sycl::fabs((float) v)) {
140
- amax = sycl::fabs((float) v);
141
- vmax = v;
142
- }
143
- }
144
-
145
- const float d = vmax / -8;
146
- const float id = d ? 1.0f / d : 0.0f;
147
-
148
- dsti->d = d;
149
-
150
- for (int j = 0; j < QK4_0 / 2; ++j) {
151
- const float x0 = xi[0 + j] * id;
152
- const float x1 = xi[QK4_0 / 2 + j] * id;
153
-
154
- const uint8_t xi0 = dpct::min(15, (int8_t) (x0 + 8.5f));
155
- const uint8_t xi1 = dpct::min(15, (int8_t) (x1 + 8.5f));
156
-
157
- dsti->qs[j] = xi0;
158
- dsti->qs[j] |= xi1 << 4;
159
- }
160
- }
161
-
162
- static void cpy_blck_f32_q4_1(const char * cxi, char * cdsti) {
163
- const float * xi = (const float *) cxi;
164
- block_q4_1 * dsti = (block_q4_1 *) cdsti;
165
-
166
- float vmin = FLT_MAX;
167
- float vmax = -FLT_MAX;
168
-
169
- for (int j = 0; j < QK4_1; ++j) {
170
- const float v = xi[j];
171
-
172
- if (v < vmin) {
173
- vmin = v;
174
- }
175
- if (v > vmax) {
176
- vmax = v;
177
- }
178
- }
179
-
180
- const float d = (vmax - vmin) / ((1 << 4) - 1);
181
- const float id = d ? 1.0f / d : 0.0f;
182
-
183
- dsti->dm.x() = d;
184
- dsti->dm.y() = vmin;
185
-
186
- for (int j = 0; j < QK4_1 / 2; ++j) {
187
- const float x0 = (xi[0 + j] - vmin) * id;
188
- const float x1 = (xi[QK4_1 / 2 + j] - vmin) * id;
189
-
190
- const uint8_t xi0 = dpct::min(15, (int8_t) (x0 + 0.5f));
191
- const uint8_t xi1 = dpct::min(15, (int8_t) (x1 + 0.5f));
192
-
193
- dsti->qs[j] = xi0;
194
- dsti->qs[j] |= xi1 << 4;
195
- }
196
- }
197
-
198
- static void cpy_blck_f32_q5_0(const char * cxi, char * cdsti) {
199
- const float * xi = (const float *) cxi;
200
- block_q5_0 * dsti = (block_q5_0 *) cdsti;
201
-
202
- float amax = 0.0f;
203
- float vmax = 0.0f;
204
-
205
- for (int j = 0; j < QK5_0; ++j) {
206
- const float v = xi[j];
207
- if (amax < sycl::fabs((float) v)) {
208
- amax = sycl::fabs((float) v);
209
- vmax = v;
210
- }
211
- }
212
-
213
- const float d = vmax / -16;
214
- const float id = d ? 1.0f / d : 0.0f;
215
-
216
- dsti->d = d;
217
-
218
- uint32_t qh = 0;
219
- for (int j = 0; j < QK5_0 / 2; ++j) {
220
- const float x0 = xi[0 + j] * id;
221
- const float x1 = xi[QK5_0 / 2 + j] * id;
222
-
223
- const uint8_t xi0 = dpct::min(31, (int8_t) (x0 + 16.5f));
224
- const uint8_t xi1 = dpct::min(31, (int8_t) (x1 + 16.5f));
225
-
226
- dsti->qs[j] = (xi0 & 0xf) | ((xi1 & 0xf) << 4);
227
- qh |= ((xi0 & 0x10u) >> 4) << (j + 0);
228
- qh |= ((xi1 & 0x10u) >> 4) << (j + QK5_0 / 2);
229
- }
230
- memcpy(dsti->qh, &qh, sizeof(qh));
231
- }
232
-
233
- static void cpy_blck_f32_q5_1(const char * cxi, char * cdsti) {
234
- const float * xi = (const float *) cxi;
235
- block_q5_1 * dsti = (block_q5_1 *) cdsti;
236
-
237
- float min = xi[0];
238
- float max = xi[0];
239
-
240
- for (int j = 1; j < QK5_1; ++j) {
241
- const float v = xi[j];
242
- min = v < min ? v : min;
243
- max = v > max ? v : max;
244
- }
245
-
246
- const float d = (max - min) / 31;
247
- const float id = d ? 1.0f / d : 0.0f;
248
-
249
- dsti->dm.x() = d;
250
- dsti->dm.y() = min;
251
-
252
- uint32_t qh = 0;
253
- for (int j = 0; j < QK5_1 / 2; ++j) {
254
- const float x0 = (xi[0 + j] - min) * id;
255
- const float x1 = (xi[QK5_1 / 2 + j] - min) * id;
256
-
257
- const uint8_t xi0 = (uint8_t) (x0 + 0.5f);
258
- const uint8_t xi1 = (uint8_t) (x1 + 0.5f);
259
-
260
- dsti->qs[j] = (xi0 & 0xf) | ((xi1 & 0xf) << 4);
261
- qh |= ((xi0 & 0x10u) >> 4) << (j + 0);
262
- qh |= ((xi1 & 0x10u) >> 4) << (j + QK5_1 / 2);
263
- }
264
- memcpy(dsti->qh, &qh, sizeof(qh));
265
- }
266
-
267
- static void cpy_blck_f32_iq4_nl(const char * cxi, char * cdsti) {
268
- const float * xi = (const float *) cxi;
269
- block_iq4_nl * dsti = (block_iq4_nl *) cdsti;
270
-
271
- float amax = 0.0f;
272
- float vmax = 0.0f;
273
-
274
- for (int j = 0; j < QK4_NL; ++j) {
275
- const float v = xi[j];
276
- if (amax < sycl::fabs((float) v)) {
277
- amax = sycl::fabs((float) v);
278
- vmax = v;
279
- }
280
- }
281
-
282
- float d = vmax / kvalues_iq4nl[0];
283
- const float id = d ? 1.0f / d : 0.0f;
284
-
285
- float sumqx = 0, sumq2 = 0;
286
- for (int j = 0; j < QK4_NL / 2; ++j) {
287
- const float x0 = xi[0 + j] * id;
288
- const float x1 = xi[QK4_NL / 2 + j] * id;
289
- const uint8_t xi0 = best_index_int8(16, kvalues_iq4nl, x0);
290
- const uint8_t xi1 = best_index_int8(16, kvalues_iq4nl, x1);
291
- dsti->qs[j] = xi0 | (xi1 << 4);
292
- const float v0 = kvalues_iq4nl[xi0];
293
- const float v1 = kvalues_iq4nl[xi1];
294
- const float w0 = xi[0 + j] * xi[0 + j];
295
- const float w1 = xi[QK4_NL / 2 + j] * xi[QK4_NL / 2 + j];
296
- sumqx += w0 * v0 * xi[j] + w1 * v1 * xi[QK4_NL / 2 + j];
297
- sumq2 += w0 * v0 * v0 + w1 * v1 * v1;
298
- }
299
-
300
- dsti->d = sumq2 > 0 ? sumqx / sumq2 : d;
301
- }
302
-
303
- template <dequantize_kernel_t dequant, int qk> static void cpy_blck_q_f32(const char * cxi, char * cdsti) {
304
- float * cdstf = (float *) (cdsti);
305
-
306
- for (int j = 0; j < qk / 2; j++) {
307
- dfloat2 dq;
308
- dequant(cxi, 0, j, dq);
309
- *(cdstf + j) = dq.x();
310
- *(cdstf + j + qk / 2) = dq.y();
311
- }
312
- }
313
-
314
- template <cpy_kernel_t cpy_blck, int qk>
315
- static void cpy_f32_q(const char * cx, char * cdst, const int ne, const int ne00, const int ne01, const int ne02,
316
- const int nb00, const int nb01, const int nb02, const int nb03, const int ne10, const int ne11,
317
- const int ne12, const int nb10, const int nb11, const int nb12, const int nb13,
318
- const sycl::nd_item<3> & item_ct1) {
319
- const int i = (item_ct1.get_local_range(2) * item_ct1.get_group(2) + item_ct1.get_local_id(2)) * qk;
320
-
321
- if (i >= ne) {
322
- return;
323
- }
324
-
325
- const int i03 = i / (ne00 * ne01 * ne02);
326
- const int i02 = (i - i03 * ne00 * ne01 * ne02) / (ne00 * ne01);
327
- const int i01 = (i - i03 * ne00 * ne01 * ne02 - i02 * ne01 * ne00) / ne00;
328
- const int i00 = i - i03 * ne00 * ne01 * ne02 - i02 * ne01 * ne00 - i01 * ne00;
329
- const int x_offset = i00 * nb00 + i01 * nb01 + i02 * nb02 + i03 * nb03;
330
-
331
- const int i13 = i / (ne10 * ne11 * ne12);
332
- const int i12 = (i - i13 * ne10 * ne11 * ne12) / (ne10 * ne11);
333
- const int i11 = (i - i13 * ne10 * ne11 * ne12 - i12 * ne10 * ne11) / ne10;
334
- const int i10 = i - i13 * ne10 * ne11 * ne12 - i12 * ne10 * ne11 - i11 * ne10;
335
- const int dst_offset = (i10 / qk) * nb10 + i11 * nb11 + i12 * nb12 + i13 * nb13;
336
-
337
- cpy_blck(cx + x_offset, cdst + dst_offset);
338
- }
339
-
340
- template <cpy_kernel_t cpy_blck, int qk>
341
- static void cpy_q_f32(const char * cx, char * cdst, const int ne, const int ne00, const int ne01, const int ne02,
342
- const int nb00, const int nb01, const int nb02, const int nb03, const int ne10, const int ne11,
343
- const int ne12, const int nb10, const int nb11, const int nb12, const int nb13,
344
- const sycl::nd_item<3> & item_ct1) {
345
- const int i = (item_ct1.get_local_range(2) * item_ct1.get_group(2) + item_ct1.get_local_id(2)) * qk;
346
-
347
- if (i >= ne) {
348
- return;
349
- }
350
-
351
- const int i03 = i / (ne00 * ne01 * ne02);
352
- const int i02 = (i - i03 * ne00 * ne01 * ne02) / (ne00 * ne01);
353
- const int i01 = (i - i03 * ne00 * ne01 * ne02 - i02 * ne01 * ne00) / ne00;
354
- const int i00 = i - i03 * ne00 * ne01 * ne02 - i02 * ne01 * ne00 - i01 * ne00;
355
- const int x_offset = (i00 / qk) * nb00 + i01 * nb01 + i02 * nb02 + i03 * nb03;
356
-
357
- const int i13 = i / (ne10 * ne11 * ne12);
358
- const int i12 = (i - i13 * ne10 * ne11 * ne12) / (ne10 * ne11);
359
- const int i11 = (i - i13 * ne10 * ne11 * ne12 - i12 * ne10 * ne11) / ne10;
360
- const int i10 = i - i13 * ne10 * ne11 * ne12 - i12 * ne10 * ne11 - i11 * ne10;
361
- const int dst_offset = i10 * nb10 + i11 * nb11 + i12 * nb12 + i13 * nb13;
362
-
363
- cpy_blck(cx + x_offset, cdst + dst_offset);
364
- }
365
-
366
- static void ggml_cpy_f16_f32_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
367
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
368
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
369
- const int nb12, const int nb13, queue_ptr stream) {
370
- const int num_blocks = (ne + SYCL_CPY_BLOCK_SIZE - 1) / SYCL_CPY_BLOCK_SIZE;
371
- {
372
- dpct::has_capability_or_fail(stream->get_device(), { sycl::aspect::fp16 });
373
-
374
- stream->parallel_for(
375
- sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks) * sycl::range<3>(1, 1, SYCL_CPY_BLOCK_SIZE),
376
- sycl::range<3>(1, 1, SYCL_CPY_BLOCK_SIZE)),
377
- [=](sycl::nd_item<3> item_ct1) {
378
- cpy_f32_f16<cpy_1_f16_f32>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12,
379
- nb10, nb11, nb12, nb13, item_ct1);
380
- });
381
- }
382
- }
383
-
384
- static void ggml_cpy_f32_f32_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
385
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
386
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
387
- const int nb12, const int nb13, queue_ptr stream) {
388
- const int num_blocks = (ne + SYCL_CPY_BLOCK_SIZE - 1) / SYCL_CPY_BLOCK_SIZE;
389
- {
390
- dpct::has_capability_or_fail(stream->get_device(), { sycl::aspect::fp16 });
391
-
392
- stream->parallel_for(
393
- sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks) * sycl::range<3>(1, 1, SYCL_CPY_BLOCK_SIZE),
394
- sycl::range<3>(1, 1, SYCL_CPY_BLOCK_SIZE)),
395
- [=](sycl::nd_item<3> item_ct1) {
396
- cpy_f32_f16<cpy_1_f32_f32>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12,
397
- nb10, nb11, nb12, nb13, item_ct1);
398
- });
399
- }
400
- }
401
-
402
- static void ggml_cpy_f32_f16_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
403
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
404
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
405
- const int nb12, const int nb13, queue_ptr stream) {
406
- const int num_blocks = (ne + SYCL_CPY_BLOCK_SIZE - 1) / SYCL_CPY_BLOCK_SIZE;
407
- {
408
- dpct::has_capability_or_fail(stream->get_device(), { sycl::aspect::fp16 });
409
-
410
- stream->parallel_for(
411
- sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks) * sycl::range<3>(1, 1, SYCL_CPY_BLOCK_SIZE),
412
- sycl::range<3>(1, 1, SYCL_CPY_BLOCK_SIZE)),
413
- [=](sycl::nd_item<3> item_ct1) {
414
- cpy_f32_f16<cpy_1_f32_f16>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12,
415
- nb10, nb11, nb12, nb13, item_ct1);
416
- });
417
- }
418
- }
419
-
420
- static void ggml_cpy_f32_q8_0_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
421
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
422
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
423
- const int nb12, const int nb13, queue_ptr stream) {
424
- GGML_ASSERT(ne % QK8_0 == 0);
425
- const int num_blocks = ne / QK8_0;
426
- stream->parallel_for(sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks), sycl::range<3>(1, 1, 1)),
427
- [=](sycl::nd_item<3> item_ct1) {
428
- cpy_f32_q<cpy_blck_f32_q8_0, QK8_0>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03,
429
- ne10, ne11, ne12, nb10, nb11, nb12, nb13, item_ct1);
430
- });
431
- }
432
-
433
- static void ggml_cpy_q8_0_f32_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
434
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
435
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
436
- const int nb12, const int nb13, queue_ptr stream) {
437
- const int num_blocks = ne;
438
- stream->parallel_for(sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks), sycl::range<3>(1, 1, 1)),
439
- [=](sycl::nd_item<3> item_ct1) {
440
- cpy_q_f32<cpy_blck_q8_0_f32, QK8_0>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03,
441
- ne10, ne11, ne12, nb10, nb11, nb12, nb13, item_ct1);
442
- });
443
- }
444
-
445
- static void ggml_cpy_f32_q4_0_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
446
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
447
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
448
- const int nb12, const int nb13, queue_ptr stream) {
449
- GGML_ASSERT(ne % QK4_0 == 0);
450
- const int num_blocks = ne / QK4_0;
451
- stream->parallel_for(sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks), sycl::range<3>(1, 1, 1)),
452
- [=](sycl::nd_item<3> item_ct1) {
453
- cpy_f32_q<cpy_blck_f32_q4_0, QK4_0>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03,
454
- ne10, ne11, ne12, nb10, nb11, nb12, nb13, item_ct1);
455
- });
456
- }
457
-
458
- static void ggml_cpy_q4_0_f32_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
459
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
460
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
461
- const int nb12, const int nb13, queue_ptr stream) {
462
- const int num_blocks = ne;
463
- stream->parallel_for(
464
- sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks), sycl::range<3>(1, 1, 1)), [=](sycl::nd_item<3> item_ct1) {
465
- cpy_q_f32<cpy_blck_q_f32<dequantize_q4_0, QK4_0>, QK4_0>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02,
466
- nb03, ne10, ne11, ne12, nb10, nb11, nb12, nb13,
467
- item_ct1);
468
- });
469
- }
470
-
471
- static void ggml_cpy_f32_q4_1_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
472
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
473
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
474
- const int nb12, const int nb13, queue_ptr stream) {
475
- GGML_ASSERT(ne % QK4_1 == 0);
476
- const int num_blocks = ne / QK4_1;
477
- stream->parallel_for(sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks), sycl::range<3>(1, 1, 1)),
478
- [=](sycl::nd_item<3> item_ct1) {
479
- cpy_f32_q<cpy_blck_f32_q4_1, QK4_1>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03,
480
- ne10, ne11, ne12, nb10, nb11, nb12, nb13, item_ct1);
481
- });
482
- }
483
-
484
- static void ggml_cpy_q4_1_f32_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
485
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
486
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
487
- const int nb12, const int nb13, queue_ptr stream) {
488
- const int num_blocks = ne;
489
- stream->parallel_for(
490
- sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks), sycl::range<3>(1, 1, 1)), [=](sycl::nd_item<3> item_ct1) {
491
- cpy_q_f32<cpy_blck_q_f32<dequantize_q4_1, QK4_1>, QK4_1>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02,
492
- nb03, ne10, ne11, ne12, nb10, nb11, nb12, nb13,
493
- item_ct1);
494
- });
495
- }
496
-
497
- static void ggml_cpy_f32_q5_0_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
498
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
499
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
500
- const int nb12, const int nb13, queue_ptr stream) {
501
- GGML_ASSERT(ne % QK5_0 == 0);
502
- const int num_blocks = ne / QK5_0;
503
- stream->parallel_for(sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks), sycl::range<3>(1, 1, 1)),
504
- [=](sycl::nd_item<3> item_ct1) {
505
- cpy_f32_q<cpy_blck_f32_q5_0, QK5_0>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03,
506
- ne10, ne11, ne12, nb10, nb11, nb12, nb13, item_ct1);
507
- });
508
- }
509
-
510
- static void ggml_cpy_q5_0_f32_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
511
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
512
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
513
- const int nb12, const int nb13, queue_ptr stream) {
514
- const int num_blocks = ne;
515
- stream->parallel_for(
516
- sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks), sycl::range<3>(1, 1, 1)), [=](sycl::nd_item<3> item_ct1) {
517
- cpy_q_f32<cpy_blck_q_f32<dequantize_q5_0, QK5_0>, QK5_0>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02,
518
- nb03, ne10, ne11, ne12, nb10, nb11, nb12, nb13,
519
- item_ct1);
520
- });
521
- }
522
-
523
- static void ggml_cpy_f32_q5_1_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
524
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
525
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
526
- const int nb12, const int nb13, queue_ptr stream) {
527
- GGML_ASSERT(ne % QK5_1 == 0);
528
- const int num_blocks = ne / QK5_1;
529
- stream->parallel_for(sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks), sycl::range<3>(1, 1, 1)),
530
- [=](sycl::nd_item<3> item_ct1) {
531
- cpy_f32_q<cpy_blck_f32_q5_1, QK5_1>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03,
532
- ne10, ne11, ne12, nb10, nb11, nb12, nb13, item_ct1);
533
- });
534
- }
535
-
536
- static void ggml_cpy_q5_1_f32_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
537
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
538
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
539
- const int nb12, const int nb13, queue_ptr stream) {
540
- const int num_blocks = ne;
541
- stream->parallel_for(
542
- sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks), sycl::range<3>(1, 1, 1)), [=](sycl::nd_item<3> item_ct1) {
543
- cpy_q_f32<cpy_blck_q_f32<dequantize_q5_1, QK5_1>, QK5_1>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02,
544
- nb03, ne10, ne11, ne12, nb10, nb11, nb12, nb13,
545
- item_ct1);
546
- });
547
- }
548
-
549
- static void ggml_cpy_f32_iq4_nl_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
550
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
551
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
552
- const int nb12, const int nb13, queue_ptr stream) {
553
- GGML_ASSERT(ne % QK4_NL == 0);
554
- const int num_blocks = ne / QK4_NL;
555
- stream->parallel_for(
556
- sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks), sycl::range<3>(1, 1, 1)), [=](sycl::nd_item<3> item_ct1) {
557
- cpy_f32_q<cpy_blck_f32_iq4_nl, QK4_NL>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11,
558
- ne12, nb10, nb11, nb12, nb13, item_ct1);
559
- });
560
- }
561
-
562
- static void ggml_cpy_f16_f16_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
563
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
564
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
565
- const int nb12, const int nb13, queue_ptr stream) {
566
- const int num_blocks = (ne + SYCL_CPY_BLOCK_SIZE - 1) / SYCL_CPY_BLOCK_SIZE;
567
- {
568
- dpct::has_capability_or_fail(stream->get_device(), { sycl::aspect::fp16 });
569
-
570
- stream->parallel_for(
571
- sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks) * sycl::range<3>(1, 1, SYCL_CPY_BLOCK_SIZE),
572
- sycl::range<3>(1, 1, SYCL_CPY_BLOCK_SIZE)),
573
- [=](sycl::nd_item<3> item_ct1) {
574
- cpy_f32_f16<cpy_1_f16_f16>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12,
575
- nb10, nb11, nb12, nb13, item_ct1);
576
- });
577
- }
578
- }
579
-
580
- static void ggml_cpy_i16_i16_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
581
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
582
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
583
- const int nb12, const int nb13, queue_ptr stream) {
584
- const int num_blocks = (ne + SYCL_CPY_BLOCK_SIZE - 1) / SYCL_CPY_BLOCK_SIZE;
585
- {
586
- // dpct::has_capability_or_fail(stream->get_device(),
587
- // {sycl::aspect::fp16});
588
-
589
- stream->parallel_for(
590
- sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks) * sycl::range<3>(1, 1, SYCL_CPY_BLOCK_SIZE),
591
- sycl::range<3>(1, 1, SYCL_CPY_BLOCK_SIZE)),
592
- [=](sycl::nd_item<3> item_ct1) {
593
- cpy_f32_f16<cpy_1_i16_i16>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12,
594
- nb10, nb11, nb12, nb13, item_ct1);
595
- });
596
- }
597
- }
598
-
599
- static void ggml_cpy_i32_i32_sycl(const char * cx, char * cdst, const int ne, const int ne00, const int ne01,
600
- const int ne02, const int nb00, const int nb01, const int nb02, const int nb03,
601
- const int ne10, const int ne11, const int ne12, const int nb10, const int nb11,
602
- const int nb12, const int nb13, queue_ptr stream) {
603
- const int num_blocks = (ne + SYCL_CPY_BLOCK_SIZE - 1) / SYCL_CPY_BLOCK_SIZE;
604
- {
605
- // dpct::has_capability_or_fail(stream->get_device(),
606
- // {sycl::aspect::fp16});
607
-
608
- stream->parallel_for(
609
- sycl::nd_range<3>(sycl::range<3>(1, 1, num_blocks) * sycl::range<3>(1, 1, SYCL_CPY_BLOCK_SIZE),
610
- sycl::range<3>(1, 1, SYCL_CPY_BLOCK_SIZE)),
611
- [=](sycl::nd_item<3> item_ct1) {
612
- cpy_f32_f16<cpy_1_i32_i32>(cx, cdst, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12,
613
- nb10, nb11, nb12, nb13, item_ct1);
614
- });
615
- }
616
- }
617
-
618
- void ggml_sycl_cpy(ggml_backend_sycl_context & ctx, const ggml_tensor * src0, const ggml_tensor * src1) try {
619
- const int64_t ne = ggml_nelements(src0);
620
- GGML_ASSERT(ne == ggml_nelements(src1));
621
-
622
- GGML_ASSERT(ggml_nbytes(src0) <= INT_MAX);
623
- GGML_ASSERT(ggml_nbytes(src1) <= INT_MAX);
624
-
625
- GGML_TENSOR_BINARY_OP_LOCALS01;
626
-
627
- SYCL_CHECK(ggml_sycl_set_device(ctx.device));
628
- queue_ptr main_stream = ctx.stream();
629
-
630
- char * src0_ddc = (char *) src0->data;
631
- char * src1_ddc = (char *) src1->data;
632
- GGML_SYCL_DEBUG("[SYCL] %s: Tensor supplied: %s to %s\n", __func__, ggml_type_name(src0->type),
633
- ggml_type_name(src1->type));
634
-
635
- if (src0->type == GGML_TYPE_F32 && src1->type == GGML_TYPE_F32) {
636
- ggml_cpy_f32_f32_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
637
- nb11, nb12, nb13, main_stream);
638
- } else if (src0->type == GGML_TYPE_F32 && src1->type == GGML_TYPE_F16) {
639
- ggml_cpy_f32_f16_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
640
- nb11, nb12, nb13, main_stream);
641
- } else if (src0->type == GGML_TYPE_F32 && src1->type == GGML_TYPE_Q8_0) {
642
- ggml_cpy_f32_q8_0_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
643
- nb11, nb12, nb13, main_stream);
644
- } else if (src0->type == GGML_TYPE_F32 && src1->type == GGML_TYPE_Q4_0) {
645
- ggml_cpy_f32_q4_0_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
646
- nb11, nb12, nb13, main_stream);
647
- } else if (src0->type == GGML_TYPE_F32 && src1->type == GGML_TYPE_Q4_1) {
648
- ggml_cpy_f32_q4_1_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
649
- nb11, nb12, nb13, main_stream);
650
- } else if (src0->type == GGML_TYPE_F16 && src1->type == GGML_TYPE_F32) {
651
- ggml_cpy_f16_f32_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
652
- nb11, nb12, nb13, main_stream);
653
- } else if (src0->type == GGML_TYPE_F16 && src1->type == GGML_TYPE_F16) {
654
- ggml_cpy_f16_f16_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
655
- nb11, nb12, nb13, main_stream);
656
- } else if (src0->type == GGML_TYPE_I16 && src1->type == GGML_TYPE_I16) {
657
- ggml_cpy_i16_i16_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
658
- nb11, nb12, nb13, main_stream);
659
- } else if (src0->type == GGML_TYPE_I32 && src1->type == GGML_TYPE_I32) {
660
- ggml_cpy_i32_i32_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
661
- nb11, nb12, nb13, main_stream);
662
- } else if (src0->type == GGML_TYPE_Q4_0 && src1->type == GGML_TYPE_F32) {
663
- ggml_cpy_q4_0_f32_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
664
- nb11, nb12, nb13, main_stream);
665
- } else if (src0->type == GGML_TYPE_Q4_1 && src1->type == GGML_TYPE_F32) {
666
- ggml_cpy_q4_1_f32_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
667
- nb11, nb12, nb13, main_stream);
668
- } else if (src0->type == GGML_TYPE_Q8_0 && src1->type == GGML_TYPE_F32) {
669
- ggml_cpy_q8_0_f32_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
670
- nb11, nb12, nb13, main_stream);
671
- } else if (src0->type == GGML_TYPE_F32 && src1->type == GGML_TYPE_Q5_0) {
672
- ggml_cpy_f32_q5_0_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
673
- nb11, nb12, nb13, main_stream);
674
- } else if (src0->type == GGML_TYPE_Q5_0 && src1->type == GGML_TYPE_F32) {
675
- ggml_cpy_q5_0_f32_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
676
- nb11, nb12, nb13, main_stream);
677
- } else if (src0->type == GGML_TYPE_F32 && src1->type == GGML_TYPE_Q5_1) {
678
- ggml_cpy_f32_q5_1_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
679
- nb11, nb12, nb13, main_stream);
680
- } else if (src0->type == GGML_TYPE_Q5_1 && src1->type == GGML_TYPE_F32) {
681
- ggml_cpy_q5_1_f32_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12, nb10,
682
- nb11, nb12, nb13, main_stream);
683
- } else if (src0->type == GGML_TYPE_F32 && src1->type == GGML_TYPE_IQ4_NL) {
684
- ggml_cpy_f32_iq4_nl_sycl(src0_ddc, src1_ddc, ne, ne00, ne01, ne02, nb00, nb01, nb02, nb03, ne10, ne11, ne12,
685
- nb10, nb11, nb12, nb13, main_stream);
686
- } else {
687
- GGML_LOG_ERROR("%s: unsupported type combination (%s to %s)\n", __func__, ggml_type_name(src0->type),
688
- ggml_type_name(src1->type));
689
- GGML_ABORT("fatal error");
690
- }
691
- } catch (const sycl::exception & exc) {
692
- std::cerr << exc.what() << "Exception caught at file:" << __FILE__ << ", line:" << __LINE__ << std::endl;
693
- std::exit(1);
694
- }
695
-
696
- void ggml_sycl_dup(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
697
- // TODO: why do we pass dst as src1 here?
698
- GGML_SYCL_DEBUG("[SYCL] call %s\n", __func__);
699
- ggml_sycl_cpy(ctx, dst->src[0], dst);
700
- GGML_SYCL_DEBUG("[SYCL] call %s done\n", __func__);
701
- }