toy 0.8.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 (2107) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +1124 -0
  3. data/LICENSE +21 -0
  4. data/Makefile +2022 -0
  5. data/README.md +154 -0
  6. data/bin/toy +10 -0
  7. data/lib/toy/compute.rb +135 -0
  8. data/lib/toy/compute_cuda.rb +104 -0
  9. data/lib/toy/compute_metal.rb +97 -0
  10. data/lib/toy/core/cli/describe.rb +188 -0
  11. data/lib/toy/core/cli/eval.rb +385 -0
  12. data/lib/toy/core/cli/exit_codes.rb +15 -0
  13. data/lib/toy/core/cli/fetch.rb +238 -0
  14. data/lib/toy/core/cli/infer.rb +268 -0
  15. data/lib/toy/core/cli/install.rb +228 -0
  16. data/lib/toy/core/cli/list.rb +86 -0
  17. data/lib/toy/core/cli/manifest.rb +49 -0
  18. data/lib/toy/core/cli/new.rb +594 -0
  19. data/lib/toy/core/cli/serve.rb +237 -0
  20. data/lib/toy/core/cli/train.rb +471 -0
  21. data/lib/toy/core/cli.rb +165 -0
  22. data/lib/toy/core/config.rb +64 -0
  23. data/lib/toy/core/gguf_meta.rb +161 -0
  24. data/lib/toy/core/model_scan.rb +221 -0
  25. data/lib/toy/core/run_log.rb +94 -0
  26. data/lib/toy/core/toy_root.rb +95 -0
  27. data/lib/toy/dev/toy_card.rb +299 -0
  28. data/lib/toy/dev/toy_describe_flow.rb +412 -0
  29. data/lib/toy/dev/toy_logprobs.rb +86 -0
  30. data/lib/toy/dev/toy_tap.rb +183 -0
  31. data/lib/toy/dev/toy_token_drift.rb +121 -0
  32. data/lib/toy/ffi/tinynn.rb +1491 -0
  33. data/lib/toy/ffi/tinynn_cuda.rb +1124 -0
  34. data/lib/toy/ffi/tinynn_metal.rb +359 -0
  35. data/lib/toy/ffi_manifest.rb +84 -0
  36. data/lib/toy/io/bpe.rb +325 -0
  37. data/lib/toy/io/gguf_kv.rb +35 -0
  38. data/lib/toy/io/gguf_load.rb +331 -0
  39. data/lib/toy/io/loaders/toy_gpt2_loader.rb +70 -0
  40. data/lib/toy/io/loaders/toy_smollm2_loader.rb +754 -0
  41. data/lib/toy/io/model_index.rb +206 -0
  42. data/lib/toy/io/run_bundle.rb +280 -0
  43. data/lib/toy/io/tokenizer.rb +613 -0
  44. data/lib/toy/io/toy_corpus_loader.rb +52 -0
  45. data/lib/toy/io/toy_events.rb +56 -0
  46. data/lib/toy/io/toy_image_loader.rb +48 -0
  47. data/lib/toy/llm/adamw.rb +169 -0
  48. data/lib/toy/llm/archs/llama_arch.rb +233 -0
  49. data/lib/toy/llm/archs/llama_arch_cuda.rb +237 -0
  50. data/lib/toy/llm/archs/llama_arch_metal.rb +237 -0
  51. data/lib/toy/llm/blocks/transformer_block.rb +876 -0
  52. data/lib/toy/llm/blocks/transformer_block_cuda.rb +880 -0
  53. data/lib/toy/llm/blocks/transformer_block_metal.rb +880 -0
  54. data/lib/toy/llm/classify_batch.rb +88 -0
  55. data/lib/toy/llm/engine/gpt2_fwd_engine.rb +360 -0
  56. data/lib/toy/llm/engine/gpt2_fwd_engine_cuda.rb +362 -0
  57. data/lib/toy/llm/engine/gpt2_fwd_engine_metal.rb +362 -0
  58. data/lib/toy/llm/engine/gpt2_kv_engine.rb +346 -0
  59. data/lib/toy/llm/engine/gpt2_kv_engine_cuda.rb +348 -0
  60. data/lib/toy/llm/engine/gpt2_kv_engine_metal.rb +348 -0
  61. data/lib/toy/llm/engine/gpt2_seq_engine.rb +289 -0
  62. data/lib/toy/llm/engine/gpt2_seq_engine_cuda.rb +293 -0
  63. data/lib/toy/llm/engine/gpt2_seq_engine_metal.rb +293 -0
  64. data/lib/toy/llm/engine/llama_kv_engine.rb +1593 -0
  65. data/lib/toy/llm/engine/llama_kv_engine_cuda.rb +1526 -0
  66. data/lib/toy/llm/engine/llama_kv_engine_metal.rb +1526 -0
  67. data/lib/toy/llm/engine/llama_seq_engine.rb +1233 -0
  68. data/lib/toy/llm/engine/llama_seq_engine_cuda.rb +1238 -0
  69. data/lib/toy/llm/engine/llama_seq_engine_metal.rb +1238 -0
  70. data/lib/toy/llm/engine/vit_tiny_engine.rb +467 -0
  71. data/lib/toy/llm/labels.rb +142 -0
  72. data/lib/toy/llm/primitives/gqa.rb +62 -0
  73. data/lib/toy/llm/primitives/gqa_cuda.rb +66 -0
  74. data/lib/toy/llm/primitives/gqa_metal.rb +66 -0
  75. data/lib/toy/llm/primitives/rms_norm.rb +39 -0
  76. data/lib/toy/llm/primitives/rms_norm_cuda.rb +43 -0
  77. data/lib/toy/llm/primitives/rms_norm_metal.rb +43 -0
  78. data/lib/toy/llm/primitives/rope.rb +68 -0
  79. data/lib/toy/llm/primitives/rope_cuda.rb +72 -0
  80. data/lib/toy/llm/primitives/rope_metal.rb +72 -0
  81. data/lib/toy/llm/primitives/swiglu.rb +41 -0
  82. data/lib/toy/llm/primitives/swiglu_cuda.rb +45 -0
  83. data/lib/toy/llm/primitives/swiglu_metal.rb +45 -0
  84. data/lib/toy/llm/recipe_options.rb +71 -0
  85. data/lib/toy/llm/recipes/from_scratch.rb +105 -0
  86. data/lib/toy/llm/recipes/from_scratch_cuda.rb +109 -0
  87. data/lib/toy/llm/recipes/from_scratch_metal.rb +109 -0
  88. data/lib/toy/llm/recipes/lora.rb +110 -0
  89. data/lib/toy/llm/recipes/lora_cuda.rb +114 -0
  90. data/lib/toy/llm/recipes/lora_metal.rb +114 -0
  91. data/lib/toy/llm/recipes/vit_tiny.rb +75 -0
  92. data/lib/toy/llm/recipes/warm_start.rb +235 -0
  93. data/lib/toy/llm/recipes/warm_start_cuda.rb +239 -0
  94. data/lib/toy/llm/recipes/warm_start_metal.rb +239 -0
  95. data/lib/toy/llm/training_batch.rb +133 -0
  96. data/lib/toy/models/arch.rb +253 -0
  97. data/lib/toy/models/gpt2.rb +311 -0
  98. data/lib/toy/models/toy_gpt2.rb +177 -0
  99. data/lib/toy/models/toy_smollm2.rb +393 -0
  100. data/lib/toy/models/toy_vit.rb +83 -0
  101. data/lib/toy/models/transformer.rb +1494 -0
  102. data/lib/toy/models/transformer_lm.rb +298 -0
  103. data/lib/toy/models/transformer_lm_cuda.rb +159 -0
  104. data/lib/toy/models/transformer_lm_metal.rb +142 -0
  105. data/lib/toy/mri.rb +300 -0
  106. data/lib/toy/run/eval.rb +76 -0
  107. data/lib/toy/run/eval_cuda.rb +66 -0
  108. data/lib/toy/run/eval_lmc.rb +334 -0
  109. data/lib/toy/run/eval_metal.rb +67 -0
  110. data/lib/toy/run/infer.rb +130 -0
  111. data/lib/toy/run/infer_cuda.rb +118 -0
  112. data/lib/toy/run/infer_metal.rb +119 -0
  113. data/lib/toy/run/infer_trace.rb +37 -0
  114. data/lib/toy/run/serve.rb +144 -0
  115. data/lib/toy/run/train.rb +404 -0
  116. data/lib/toy/run/train_cuda.rb +397 -0
  117. data/lib/toy/run/train_gpt2.rb +103 -0
  118. data/lib/toy/run/train_gpt2_cuda.rb +85 -0
  119. data/lib/toy/run/train_gpt2_metal.rb +85 -0
  120. data/lib/toy/run/train_lora.rb +207 -0
  121. data/lib/toy/run/train_lora_cuda.rb +219 -0
  122. data/lib/toy/run/train_metal.rb +227 -0
  123. data/lib/toy/run/train_vit.rb +251 -0
  124. data/lib/toy/serve/openai/embeddings_handler.rb +92 -0
  125. data/lib/toy/serve/openai/handlers.rb +143 -0
  126. data/lib/toy/serve/openai/server.rb +159 -0
  127. data/lib/toy/train/sampler.rb +314 -0
  128. data/lib/toy/train/toy_chat_template.rb +179 -0
  129. data/lib/toy/train/toy_drift_grad.rb +176 -0
  130. data/lib/toy/train/toy_gguf_fuse.rb +428 -0
  131. data/lib/toy/train/toy_gguf_writer.rb +100 -0
  132. data/lib/toy/train/toy_lr_schedule.rb +39 -0
  133. data/lib/toy/train/toy_sample.rb +125 -0
  134. data/lib/toy/train/toy_trainer.rb +86 -0
  135. data/lib/toy/train/training.rb +160 -0
  136. data/lib/toy/version.rb +11 -0
  137. data/lib/toy.rb +902 -0
  138. data/prep/progress +118 -0
  139. data/prep/quietly +64 -0
  140. data/sig/toy.rbs +397 -0
  141. data/sig/toy_compute.rbs +450 -0
  142. data/spinel-ext.json +122 -0
  143. data/tinynn/Makefile +71 -0
  144. data/tinynn/tinynn_backend_cuda.c +99 -0
  145. data/tinynn/tinynn_backend_metal.m +75 -0
  146. data/tinynn/tinynn_events.c +122 -0
  147. data/tinynn/tinynn_events.h +83 -0
  148. data/tinynn/tinynn_ggml.c +2460 -0
  149. data/tinynn/tinynn_ggml.h +545 -0
  150. data/tinynn/tinynn_gguf.c +783 -0
  151. data/tinynn/tinynn_gguf.h +167 -0
  152. data/tinynn/tinynn_trace.c +180 -0
  153. data/tinynn/tinynn_trace.h +85 -0
  154. data/vendor/ggml/AUTHORS +335 -0
  155. data/vendor/ggml/CMakeLists.txt +505 -0
  156. data/vendor/ggml/CONTRIBUTING.md +3 -0
  157. data/vendor/ggml/LICENSE +21 -0
  158. data/vendor/ggml/README.md +50 -0
  159. data/vendor/ggml/ci/run.sh +395 -0
  160. data/vendor/ggml/cmake/FindNCCL.cmake +36 -0
  161. data/vendor/ggml/cmake/GitVars.cmake +22 -0
  162. data/vendor/ggml/cmake/common.cmake +50 -0
  163. data/vendor/ggml/cmake/ggml-config.cmake.in +191 -0
  164. data/vendor/ggml/docs/gguf.md +828 -0
  165. data/vendor/ggml/examples/CMakeLists.txt +34 -0
  166. data/vendor/ggml/examples/common-ggml.cpp +244 -0
  167. data/vendor/ggml/examples/common-ggml.h +18 -0
  168. data/vendor/ggml/examples/common.cpp +675 -0
  169. data/vendor/ggml/examples/common.h +322 -0
  170. data/vendor/ggml/examples/gpt-2/CMakeLists.txt +32 -0
  171. data/vendor/ggml/examples/gpt-2/README.md +225 -0
  172. data/vendor/ggml/examples/gpt-2/convert-cerebras-to-ggml.py +183 -0
  173. data/vendor/ggml/examples/gpt-2/convert-ckpt-to-ggml.py +159 -0
  174. data/vendor/ggml/examples/gpt-2/convert-h5-to-ggml.py +195 -0
  175. data/vendor/ggml/examples/gpt-2/download-ggml-model.sh +69 -0
  176. data/vendor/ggml/examples/gpt-2/download-model.sh +48 -0
  177. data/vendor/ggml/examples/gpt-2/main-alloc.cpp +880 -0
  178. data/vendor/ggml/examples/gpt-2/main-backend.cpp +946 -0
  179. data/vendor/ggml/examples/gpt-2/main-batched.cpp +1210 -0
  180. data/vendor/ggml/examples/gpt-2/main-ctx.cpp +840 -0
  181. data/vendor/ggml/examples/gpt-2/main-sched.cpp +1079 -0
  182. data/vendor/ggml/examples/gpt-2/quantize.cpp +184 -0
  183. data/vendor/ggml/examples/gpt-j/CMakeLists.txt +13 -0
  184. data/vendor/ggml/examples/gpt-j/README.md +239 -0
  185. data/vendor/ggml/examples/gpt-j/convert-h5-to-ggml.py +173 -0
  186. data/vendor/ggml/examples/gpt-j/download-ggml-model.sh +69 -0
  187. data/vendor/ggml/examples/gpt-j/download-model.sh +11 -0
  188. data/vendor/ggml/examples/gpt-j/main.cpp +755 -0
  189. data/vendor/ggml/examples/gpt-j/quantize.cpp +182 -0
  190. data/vendor/ggml/examples/magika/CMakeLists.txt +17 -0
  191. data/vendor/ggml/examples/magika/README.md +23 -0
  192. data/vendor/ggml/examples/magika/convert.py +32 -0
  193. data/vendor/ggml/examples/magika/main.cpp +374 -0
  194. data/vendor/ggml/examples/mnist/CMakeLists.txt +58 -0
  195. data/vendor/ggml/examples/mnist/README.md +206 -0
  196. data/vendor/ggml/examples/mnist/mnist-common.cpp +496 -0
  197. data/vendor/ggml/examples/mnist/mnist-common.h +166 -0
  198. data/vendor/ggml/examples/mnist/mnist-eval.cpp +67 -0
  199. data/vendor/ggml/examples/mnist/mnist-train-cnn.py +91 -0
  200. data/vendor/ggml/examples/mnist/mnist-train-fc.py +131 -0
  201. data/vendor/ggml/examples/mnist/mnist-train.cpp +39 -0
  202. data/vendor/ggml/examples/mnist/server.py +36 -0
  203. data/vendor/ggml/examples/mnist/web/index.html +178 -0
  204. data/vendor/ggml/examples/perf-metal/CMakeLists.txt +7 -0
  205. data/vendor/ggml/examples/perf-metal/perf-metal.cpp +152 -0
  206. data/vendor/ggml/examples/prompts/dolly-v2.txt +100 -0
  207. data/vendor/ggml/examples/prompts/gpt-2-chinese.txt +1 -0
  208. data/vendor/ggml/examples/prompts/gpt-2.txt +100 -0
  209. data/vendor/ggml/examples/prompts/gpt-j.txt +100 -0
  210. data/vendor/ggml/examples/prompts/gpt-neox-japanese.txt +1 -0
  211. data/vendor/ggml/examples/prompts/gpt-neox.txt +100 -0
  212. data/vendor/ggml/examples/prompts/polyglot-ko.txt +3 -0
  213. data/vendor/ggml/examples/prompts/replit.txt +100 -0
  214. data/vendor/ggml/examples/prompts/starcoder.txt +100 -0
  215. data/vendor/ggml/examples/prompts/test-cases.txt +110 -0
  216. data/vendor/ggml/examples/prompts/tokenize_huggingface.py +65 -0
  217. data/vendor/ggml/examples/prompts/whisper.txt +100 -0
  218. data/vendor/ggml/examples/python/README.md +115 -0
  219. data/vendor/ggml/examples/python/api.h +14 -0
  220. data/vendor/ggml/examples/python/example_add_quant.py +25 -0
  221. data/vendor/ggml/examples/python/example_test_all_quants.py +68 -0
  222. data/vendor/ggml/examples/python/ggml/__init__.py +58 -0
  223. data/vendor/ggml/examples/python/ggml/__init__.pyi +2406 -0
  224. data/vendor/ggml/examples/python/ggml/cffi.py +11 -0
  225. data/vendor/ggml/examples/python/ggml/ffi/__init__.pyi +7 -0
  226. data/vendor/ggml/examples/python/ggml/utils.py +182 -0
  227. data/vendor/ggml/examples/python/regenerate.py +42 -0
  228. data/vendor/ggml/examples/python/stubs.py +128 -0
  229. data/vendor/ggml/examples/python/test_tensor.py +258 -0
  230. data/vendor/ggml/examples/sam/CMakeLists.txt +13 -0
  231. data/vendor/ggml/examples/sam/README.md +95 -0
  232. data/vendor/ggml/examples/sam/convert-pth-to-ggml.py +147 -0
  233. data/vendor/ggml/examples/sam/example.jpg +0 -0
  234. data/vendor/ggml/examples/sam/sam.cpp +2370 -0
  235. data/vendor/ggml/examples/simple/CMakeLists.txt +21 -0
  236. data/vendor/ggml/examples/simple/README.md +61 -0
  237. data/vendor/ggml/examples/simple/simple-backend.cpp +153 -0
  238. data/vendor/ggml/examples/simple/simple-ctx.cpp +127 -0
  239. data/vendor/ggml/examples/stb_image.h +7987 -0
  240. data/vendor/ggml/examples/stb_image_write.h +1724 -0
  241. data/vendor/ggml/examples/test-cmake/CMakeLists.txt +10 -0
  242. data/vendor/ggml/examples/test-cmake/README.md +3 -0
  243. data/vendor/ggml/examples/test-cmake/test-cmake.cpp +6 -0
  244. data/vendor/ggml/examples/yolo/CMakeLists.txt +6 -0
  245. data/vendor/ggml/examples/yolo/README.md +59 -0
  246. data/vendor/ggml/examples/yolo/convert-yolov3-tiny.py +53 -0
  247. data/vendor/ggml/examples/yolo/data/coco.names +80 -0
  248. data/vendor/ggml/examples/yolo/data/labels/100_0.png +0 -0
  249. data/vendor/ggml/examples/yolo/data/labels/100_1.png +0 -0
  250. data/vendor/ggml/examples/yolo/data/labels/100_2.png +0 -0
  251. data/vendor/ggml/examples/yolo/data/labels/100_3.png +0 -0
  252. data/vendor/ggml/examples/yolo/data/labels/100_4.png +0 -0
  253. data/vendor/ggml/examples/yolo/data/labels/100_5.png +0 -0
  254. data/vendor/ggml/examples/yolo/data/labels/100_6.png +0 -0
  255. data/vendor/ggml/examples/yolo/data/labels/100_7.png +0 -0
  256. data/vendor/ggml/examples/yolo/data/labels/101_0.png +0 -0
  257. data/vendor/ggml/examples/yolo/data/labels/101_1.png +0 -0
  258. data/vendor/ggml/examples/yolo/data/labels/101_2.png +0 -0
  259. data/vendor/ggml/examples/yolo/data/labels/101_3.png +0 -0
  260. data/vendor/ggml/examples/yolo/data/labels/101_4.png +0 -0
  261. data/vendor/ggml/examples/yolo/data/labels/101_5.png +0 -0
  262. data/vendor/ggml/examples/yolo/data/labels/101_6.png +0 -0
  263. data/vendor/ggml/examples/yolo/data/labels/101_7.png +0 -0
  264. data/vendor/ggml/examples/yolo/data/labels/102_0.png +0 -0
  265. data/vendor/ggml/examples/yolo/data/labels/102_1.png +0 -0
  266. data/vendor/ggml/examples/yolo/data/labels/102_2.png +0 -0
  267. data/vendor/ggml/examples/yolo/data/labels/102_3.png +0 -0
  268. data/vendor/ggml/examples/yolo/data/labels/102_4.png +0 -0
  269. data/vendor/ggml/examples/yolo/data/labels/102_5.png +0 -0
  270. data/vendor/ggml/examples/yolo/data/labels/102_6.png +0 -0
  271. data/vendor/ggml/examples/yolo/data/labels/102_7.png +0 -0
  272. data/vendor/ggml/examples/yolo/data/labels/103_0.png +0 -0
  273. data/vendor/ggml/examples/yolo/data/labels/103_1.png +0 -0
  274. data/vendor/ggml/examples/yolo/data/labels/103_2.png +0 -0
  275. data/vendor/ggml/examples/yolo/data/labels/103_3.png +0 -0
  276. data/vendor/ggml/examples/yolo/data/labels/103_4.png +0 -0
  277. data/vendor/ggml/examples/yolo/data/labels/103_5.png +0 -0
  278. data/vendor/ggml/examples/yolo/data/labels/103_6.png +0 -0
  279. data/vendor/ggml/examples/yolo/data/labels/103_7.png +0 -0
  280. data/vendor/ggml/examples/yolo/data/labels/104_0.png +0 -0
  281. data/vendor/ggml/examples/yolo/data/labels/104_1.png +0 -0
  282. data/vendor/ggml/examples/yolo/data/labels/104_2.png +0 -0
  283. data/vendor/ggml/examples/yolo/data/labels/104_3.png +0 -0
  284. data/vendor/ggml/examples/yolo/data/labels/104_4.png +0 -0
  285. data/vendor/ggml/examples/yolo/data/labels/104_5.png +0 -0
  286. data/vendor/ggml/examples/yolo/data/labels/104_6.png +0 -0
  287. data/vendor/ggml/examples/yolo/data/labels/104_7.png +0 -0
  288. data/vendor/ggml/examples/yolo/data/labels/105_0.png +0 -0
  289. data/vendor/ggml/examples/yolo/data/labels/105_1.png +0 -0
  290. data/vendor/ggml/examples/yolo/data/labels/105_2.png +0 -0
  291. data/vendor/ggml/examples/yolo/data/labels/105_3.png +0 -0
  292. data/vendor/ggml/examples/yolo/data/labels/105_4.png +0 -0
  293. data/vendor/ggml/examples/yolo/data/labels/105_5.png +0 -0
  294. data/vendor/ggml/examples/yolo/data/labels/105_6.png +0 -0
  295. data/vendor/ggml/examples/yolo/data/labels/105_7.png +0 -0
  296. data/vendor/ggml/examples/yolo/data/labels/106_0.png +0 -0
  297. data/vendor/ggml/examples/yolo/data/labels/106_1.png +0 -0
  298. data/vendor/ggml/examples/yolo/data/labels/106_2.png +0 -0
  299. data/vendor/ggml/examples/yolo/data/labels/106_3.png +0 -0
  300. data/vendor/ggml/examples/yolo/data/labels/106_4.png +0 -0
  301. data/vendor/ggml/examples/yolo/data/labels/106_5.png +0 -0
  302. data/vendor/ggml/examples/yolo/data/labels/106_6.png +0 -0
  303. data/vendor/ggml/examples/yolo/data/labels/106_7.png +0 -0
  304. data/vendor/ggml/examples/yolo/data/labels/107_0.png +0 -0
  305. data/vendor/ggml/examples/yolo/data/labels/107_1.png +0 -0
  306. data/vendor/ggml/examples/yolo/data/labels/107_2.png +0 -0
  307. data/vendor/ggml/examples/yolo/data/labels/107_3.png +0 -0
  308. data/vendor/ggml/examples/yolo/data/labels/107_4.png +0 -0
  309. data/vendor/ggml/examples/yolo/data/labels/107_5.png +0 -0
  310. data/vendor/ggml/examples/yolo/data/labels/107_6.png +0 -0
  311. data/vendor/ggml/examples/yolo/data/labels/107_7.png +0 -0
  312. data/vendor/ggml/examples/yolo/data/labels/108_0.png +0 -0
  313. data/vendor/ggml/examples/yolo/data/labels/108_1.png +0 -0
  314. data/vendor/ggml/examples/yolo/data/labels/108_2.png +0 -0
  315. data/vendor/ggml/examples/yolo/data/labels/108_3.png +0 -0
  316. data/vendor/ggml/examples/yolo/data/labels/108_4.png +0 -0
  317. data/vendor/ggml/examples/yolo/data/labels/108_5.png +0 -0
  318. data/vendor/ggml/examples/yolo/data/labels/108_6.png +0 -0
  319. data/vendor/ggml/examples/yolo/data/labels/108_7.png +0 -0
  320. data/vendor/ggml/examples/yolo/data/labels/109_0.png +0 -0
  321. data/vendor/ggml/examples/yolo/data/labels/109_1.png +0 -0
  322. data/vendor/ggml/examples/yolo/data/labels/109_2.png +0 -0
  323. data/vendor/ggml/examples/yolo/data/labels/109_3.png +0 -0
  324. data/vendor/ggml/examples/yolo/data/labels/109_4.png +0 -0
  325. data/vendor/ggml/examples/yolo/data/labels/109_5.png +0 -0
  326. data/vendor/ggml/examples/yolo/data/labels/109_6.png +0 -0
  327. data/vendor/ggml/examples/yolo/data/labels/109_7.png +0 -0
  328. data/vendor/ggml/examples/yolo/data/labels/110_0.png +0 -0
  329. data/vendor/ggml/examples/yolo/data/labels/110_1.png +0 -0
  330. data/vendor/ggml/examples/yolo/data/labels/110_2.png +0 -0
  331. data/vendor/ggml/examples/yolo/data/labels/110_3.png +0 -0
  332. data/vendor/ggml/examples/yolo/data/labels/110_4.png +0 -0
  333. data/vendor/ggml/examples/yolo/data/labels/110_5.png +0 -0
  334. data/vendor/ggml/examples/yolo/data/labels/110_6.png +0 -0
  335. data/vendor/ggml/examples/yolo/data/labels/110_7.png +0 -0
  336. data/vendor/ggml/examples/yolo/data/labels/111_0.png +0 -0
  337. data/vendor/ggml/examples/yolo/data/labels/111_1.png +0 -0
  338. data/vendor/ggml/examples/yolo/data/labels/111_2.png +0 -0
  339. data/vendor/ggml/examples/yolo/data/labels/111_3.png +0 -0
  340. data/vendor/ggml/examples/yolo/data/labels/111_4.png +0 -0
  341. data/vendor/ggml/examples/yolo/data/labels/111_5.png +0 -0
  342. data/vendor/ggml/examples/yolo/data/labels/111_6.png +0 -0
  343. data/vendor/ggml/examples/yolo/data/labels/111_7.png +0 -0
  344. data/vendor/ggml/examples/yolo/data/labels/112_0.png +0 -0
  345. data/vendor/ggml/examples/yolo/data/labels/112_1.png +0 -0
  346. data/vendor/ggml/examples/yolo/data/labels/112_2.png +0 -0
  347. data/vendor/ggml/examples/yolo/data/labels/112_3.png +0 -0
  348. data/vendor/ggml/examples/yolo/data/labels/112_4.png +0 -0
  349. data/vendor/ggml/examples/yolo/data/labels/112_5.png +0 -0
  350. data/vendor/ggml/examples/yolo/data/labels/112_6.png +0 -0
  351. data/vendor/ggml/examples/yolo/data/labels/112_7.png +0 -0
  352. data/vendor/ggml/examples/yolo/data/labels/113_0.png +0 -0
  353. data/vendor/ggml/examples/yolo/data/labels/113_1.png +0 -0
  354. data/vendor/ggml/examples/yolo/data/labels/113_2.png +0 -0
  355. data/vendor/ggml/examples/yolo/data/labels/113_3.png +0 -0
  356. data/vendor/ggml/examples/yolo/data/labels/113_4.png +0 -0
  357. data/vendor/ggml/examples/yolo/data/labels/113_5.png +0 -0
  358. data/vendor/ggml/examples/yolo/data/labels/113_6.png +0 -0
  359. data/vendor/ggml/examples/yolo/data/labels/113_7.png +0 -0
  360. data/vendor/ggml/examples/yolo/data/labels/114_0.png +0 -0
  361. data/vendor/ggml/examples/yolo/data/labels/114_1.png +0 -0
  362. data/vendor/ggml/examples/yolo/data/labels/114_2.png +0 -0
  363. data/vendor/ggml/examples/yolo/data/labels/114_3.png +0 -0
  364. data/vendor/ggml/examples/yolo/data/labels/114_4.png +0 -0
  365. data/vendor/ggml/examples/yolo/data/labels/114_5.png +0 -0
  366. data/vendor/ggml/examples/yolo/data/labels/114_6.png +0 -0
  367. data/vendor/ggml/examples/yolo/data/labels/114_7.png +0 -0
  368. data/vendor/ggml/examples/yolo/data/labels/115_0.png +0 -0
  369. data/vendor/ggml/examples/yolo/data/labels/115_1.png +0 -0
  370. data/vendor/ggml/examples/yolo/data/labels/115_2.png +0 -0
  371. data/vendor/ggml/examples/yolo/data/labels/115_3.png +0 -0
  372. data/vendor/ggml/examples/yolo/data/labels/115_4.png +0 -0
  373. data/vendor/ggml/examples/yolo/data/labels/115_5.png +0 -0
  374. data/vendor/ggml/examples/yolo/data/labels/115_6.png +0 -0
  375. data/vendor/ggml/examples/yolo/data/labels/115_7.png +0 -0
  376. data/vendor/ggml/examples/yolo/data/labels/116_0.png +0 -0
  377. data/vendor/ggml/examples/yolo/data/labels/116_1.png +0 -0
  378. data/vendor/ggml/examples/yolo/data/labels/116_2.png +0 -0
  379. data/vendor/ggml/examples/yolo/data/labels/116_3.png +0 -0
  380. data/vendor/ggml/examples/yolo/data/labels/116_4.png +0 -0
  381. data/vendor/ggml/examples/yolo/data/labels/116_5.png +0 -0
  382. data/vendor/ggml/examples/yolo/data/labels/116_6.png +0 -0
  383. data/vendor/ggml/examples/yolo/data/labels/116_7.png +0 -0
  384. data/vendor/ggml/examples/yolo/data/labels/117_0.png +0 -0
  385. data/vendor/ggml/examples/yolo/data/labels/117_1.png +0 -0
  386. data/vendor/ggml/examples/yolo/data/labels/117_2.png +0 -0
  387. data/vendor/ggml/examples/yolo/data/labels/117_3.png +0 -0
  388. data/vendor/ggml/examples/yolo/data/labels/117_4.png +0 -0
  389. data/vendor/ggml/examples/yolo/data/labels/117_5.png +0 -0
  390. data/vendor/ggml/examples/yolo/data/labels/117_6.png +0 -0
  391. data/vendor/ggml/examples/yolo/data/labels/117_7.png +0 -0
  392. data/vendor/ggml/examples/yolo/data/labels/118_0.png +0 -0
  393. data/vendor/ggml/examples/yolo/data/labels/118_1.png +0 -0
  394. data/vendor/ggml/examples/yolo/data/labels/118_2.png +0 -0
  395. data/vendor/ggml/examples/yolo/data/labels/118_3.png +0 -0
  396. data/vendor/ggml/examples/yolo/data/labels/118_4.png +0 -0
  397. data/vendor/ggml/examples/yolo/data/labels/118_5.png +0 -0
  398. data/vendor/ggml/examples/yolo/data/labels/118_6.png +0 -0
  399. data/vendor/ggml/examples/yolo/data/labels/118_7.png +0 -0
  400. data/vendor/ggml/examples/yolo/data/labels/119_0.png +0 -0
  401. data/vendor/ggml/examples/yolo/data/labels/119_1.png +0 -0
  402. data/vendor/ggml/examples/yolo/data/labels/119_2.png +0 -0
  403. data/vendor/ggml/examples/yolo/data/labels/119_3.png +0 -0
  404. data/vendor/ggml/examples/yolo/data/labels/119_4.png +0 -0
  405. data/vendor/ggml/examples/yolo/data/labels/119_5.png +0 -0
  406. data/vendor/ggml/examples/yolo/data/labels/119_6.png +0 -0
  407. data/vendor/ggml/examples/yolo/data/labels/119_7.png +0 -0
  408. data/vendor/ggml/examples/yolo/data/labels/120_0.png +0 -0
  409. data/vendor/ggml/examples/yolo/data/labels/120_1.png +0 -0
  410. data/vendor/ggml/examples/yolo/data/labels/120_2.png +0 -0
  411. data/vendor/ggml/examples/yolo/data/labels/120_3.png +0 -0
  412. data/vendor/ggml/examples/yolo/data/labels/120_4.png +0 -0
  413. data/vendor/ggml/examples/yolo/data/labels/120_5.png +0 -0
  414. data/vendor/ggml/examples/yolo/data/labels/120_6.png +0 -0
  415. data/vendor/ggml/examples/yolo/data/labels/120_7.png +0 -0
  416. data/vendor/ggml/examples/yolo/data/labels/121_0.png +0 -0
  417. data/vendor/ggml/examples/yolo/data/labels/121_1.png +0 -0
  418. data/vendor/ggml/examples/yolo/data/labels/121_2.png +0 -0
  419. data/vendor/ggml/examples/yolo/data/labels/121_3.png +0 -0
  420. data/vendor/ggml/examples/yolo/data/labels/121_4.png +0 -0
  421. data/vendor/ggml/examples/yolo/data/labels/121_5.png +0 -0
  422. data/vendor/ggml/examples/yolo/data/labels/121_6.png +0 -0
  423. data/vendor/ggml/examples/yolo/data/labels/121_7.png +0 -0
  424. data/vendor/ggml/examples/yolo/data/labels/122_0.png +0 -0
  425. data/vendor/ggml/examples/yolo/data/labels/122_1.png +0 -0
  426. data/vendor/ggml/examples/yolo/data/labels/122_2.png +0 -0
  427. data/vendor/ggml/examples/yolo/data/labels/122_3.png +0 -0
  428. data/vendor/ggml/examples/yolo/data/labels/122_4.png +0 -0
  429. data/vendor/ggml/examples/yolo/data/labels/122_5.png +0 -0
  430. data/vendor/ggml/examples/yolo/data/labels/122_6.png +0 -0
  431. data/vendor/ggml/examples/yolo/data/labels/122_7.png +0 -0
  432. data/vendor/ggml/examples/yolo/data/labels/123_0.png +0 -0
  433. data/vendor/ggml/examples/yolo/data/labels/123_1.png +0 -0
  434. data/vendor/ggml/examples/yolo/data/labels/123_2.png +0 -0
  435. data/vendor/ggml/examples/yolo/data/labels/123_3.png +0 -0
  436. data/vendor/ggml/examples/yolo/data/labels/123_4.png +0 -0
  437. data/vendor/ggml/examples/yolo/data/labels/123_5.png +0 -0
  438. data/vendor/ggml/examples/yolo/data/labels/123_6.png +0 -0
  439. data/vendor/ggml/examples/yolo/data/labels/123_7.png +0 -0
  440. data/vendor/ggml/examples/yolo/data/labels/124_0.png +0 -0
  441. data/vendor/ggml/examples/yolo/data/labels/124_1.png +0 -0
  442. data/vendor/ggml/examples/yolo/data/labels/124_2.png +0 -0
  443. data/vendor/ggml/examples/yolo/data/labels/124_3.png +0 -0
  444. data/vendor/ggml/examples/yolo/data/labels/124_4.png +0 -0
  445. data/vendor/ggml/examples/yolo/data/labels/124_5.png +0 -0
  446. data/vendor/ggml/examples/yolo/data/labels/124_6.png +0 -0
  447. data/vendor/ggml/examples/yolo/data/labels/124_7.png +0 -0
  448. data/vendor/ggml/examples/yolo/data/labels/125_0.png +0 -0
  449. data/vendor/ggml/examples/yolo/data/labels/125_1.png +0 -0
  450. data/vendor/ggml/examples/yolo/data/labels/125_2.png +0 -0
  451. data/vendor/ggml/examples/yolo/data/labels/125_3.png +0 -0
  452. data/vendor/ggml/examples/yolo/data/labels/125_4.png +0 -0
  453. data/vendor/ggml/examples/yolo/data/labels/125_5.png +0 -0
  454. data/vendor/ggml/examples/yolo/data/labels/125_6.png +0 -0
  455. data/vendor/ggml/examples/yolo/data/labels/125_7.png +0 -0
  456. data/vendor/ggml/examples/yolo/data/labels/126_0.png +0 -0
  457. data/vendor/ggml/examples/yolo/data/labels/126_1.png +0 -0
  458. data/vendor/ggml/examples/yolo/data/labels/126_2.png +0 -0
  459. data/vendor/ggml/examples/yolo/data/labels/126_3.png +0 -0
  460. data/vendor/ggml/examples/yolo/data/labels/126_4.png +0 -0
  461. data/vendor/ggml/examples/yolo/data/labels/126_5.png +0 -0
  462. data/vendor/ggml/examples/yolo/data/labels/126_6.png +0 -0
  463. data/vendor/ggml/examples/yolo/data/labels/126_7.png +0 -0
  464. data/vendor/ggml/examples/yolo/data/labels/32_0.png +0 -0
  465. data/vendor/ggml/examples/yolo/data/labels/32_1.png +0 -0
  466. data/vendor/ggml/examples/yolo/data/labels/32_2.png +0 -0
  467. data/vendor/ggml/examples/yolo/data/labels/32_3.png +0 -0
  468. data/vendor/ggml/examples/yolo/data/labels/32_4.png +0 -0
  469. data/vendor/ggml/examples/yolo/data/labels/32_5.png +0 -0
  470. data/vendor/ggml/examples/yolo/data/labels/32_6.png +0 -0
  471. data/vendor/ggml/examples/yolo/data/labels/32_7.png +0 -0
  472. data/vendor/ggml/examples/yolo/data/labels/33_0.png +0 -0
  473. data/vendor/ggml/examples/yolo/data/labels/33_1.png +0 -0
  474. data/vendor/ggml/examples/yolo/data/labels/33_2.png +0 -0
  475. data/vendor/ggml/examples/yolo/data/labels/33_3.png +0 -0
  476. data/vendor/ggml/examples/yolo/data/labels/33_4.png +0 -0
  477. data/vendor/ggml/examples/yolo/data/labels/33_5.png +0 -0
  478. data/vendor/ggml/examples/yolo/data/labels/33_6.png +0 -0
  479. data/vendor/ggml/examples/yolo/data/labels/33_7.png +0 -0
  480. data/vendor/ggml/examples/yolo/data/labels/34_0.png +0 -0
  481. data/vendor/ggml/examples/yolo/data/labels/34_1.png +0 -0
  482. data/vendor/ggml/examples/yolo/data/labels/34_2.png +0 -0
  483. data/vendor/ggml/examples/yolo/data/labels/34_3.png +0 -0
  484. data/vendor/ggml/examples/yolo/data/labels/34_4.png +0 -0
  485. data/vendor/ggml/examples/yolo/data/labels/34_5.png +0 -0
  486. data/vendor/ggml/examples/yolo/data/labels/34_6.png +0 -0
  487. data/vendor/ggml/examples/yolo/data/labels/34_7.png +0 -0
  488. data/vendor/ggml/examples/yolo/data/labels/35_0.png +0 -0
  489. data/vendor/ggml/examples/yolo/data/labels/35_1.png +0 -0
  490. data/vendor/ggml/examples/yolo/data/labels/35_2.png +0 -0
  491. data/vendor/ggml/examples/yolo/data/labels/35_3.png +0 -0
  492. data/vendor/ggml/examples/yolo/data/labels/35_4.png +0 -0
  493. data/vendor/ggml/examples/yolo/data/labels/35_5.png +0 -0
  494. data/vendor/ggml/examples/yolo/data/labels/35_6.png +0 -0
  495. data/vendor/ggml/examples/yolo/data/labels/35_7.png +0 -0
  496. data/vendor/ggml/examples/yolo/data/labels/36_0.png +0 -0
  497. data/vendor/ggml/examples/yolo/data/labels/36_1.png +0 -0
  498. data/vendor/ggml/examples/yolo/data/labels/36_2.png +0 -0
  499. data/vendor/ggml/examples/yolo/data/labels/36_3.png +0 -0
  500. data/vendor/ggml/examples/yolo/data/labels/36_4.png +0 -0
  501. data/vendor/ggml/examples/yolo/data/labels/36_5.png +0 -0
  502. data/vendor/ggml/examples/yolo/data/labels/36_6.png +0 -0
  503. data/vendor/ggml/examples/yolo/data/labels/36_7.png +0 -0
  504. data/vendor/ggml/examples/yolo/data/labels/37_0.png +0 -0
  505. data/vendor/ggml/examples/yolo/data/labels/37_1.png +0 -0
  506. data/vendor/ggml/examples/yolo/data/labels/37_2.png +0 -0
  507. data/vendor/ggml/examples/yolo/data/labels/37_3.png +0 -0
  508. data/vendor/ggml/examples/yolo/data/labels/37_4.png +0 -0
  509. data/vendor/ggml/examples/yolo/data/labels/37_5.png +0 -0
  510. data/vendor/ggml/examples/yolo/data/labels/37_6.png +0 -0
  511. data/vendor/ggml/examples/yolo/data/labels/37_7.png +0 -0
  512. data/vendor/ggml/examples/yolo/data/labels/38_0.png +0 -0
  513. data/vendor/ggml/examples/yolo/data/labels/38_1.png +0 -0
  514. data/vendor/ggml/examples/yolo/data/labels/38_2.png +0 -0
  515. data/vendor/ggml/examples/yolo/data/labels/38_3.png +0 -0
  516. data/vendor/ggml/examples/yolo/data/labels/38_4.png +0 -0
  517. data/vendor/ggml/examples/yolo/data/labels/38_5.png +0 -0
  518. data/vendor/ggml/examples/yolo/data/labels/38_6.png +0 -0
  519. data/vendor/ggml/examples/yolo/data/labels/38_7.png +0 -0
  520. data/vendor/ggml/examples/yolo/data/labels/39_0.png +0 -0
  521. data/vendor/ggml/examples/yolo/data/labels/39_1.png +0 -0
  522. data/vendor/ggml/examples/yolo/data/labels/39_2.png +0 -0
  523. data/vendor/ggml/examples/yolo/data/labels/39_3.png +0 -0
  524. data/vendor/ggml/examples/yolo/data/labels/39_4.png +0 -0
  525. data/vendor/ggml/examples/yolo/data/labels/39_5.png +0 -0
  526. data/vendor/ggml/examples/yolo/data/labels/39_6.png +0 -0
  527. data/vendor/ggml/examples/yolo/data/labels/39_7.png +0 -0
  528. data/vendor/ggml/examples/yolo/data/labels/40_0.png +0 -0
  529. data/vendor/ggml/examples/yolo/data/labels/40_1.png +0 -0
  530. data/vendor/ggml/examples/yolo/data/labels/40_2.png +0 -0
  531. data/vendor/ggml/examples/yolo/data/labels/40_3.png +0 -0
  532. data/vendor/ggml/examples/yolo/data/labels/40_4.png +0 -0
  533. data/vendor/ggml/examples/yolo/data/labels/40_5.png +0 -0
  534. data/vendor/ggml/examples/yolo/data/labels/40_6.png +0 -0
  535. data/vendor/ggml/examples/yolo/data/labels/40_7.png +0 -0
  536. data/vendor/ggml/examples/yolo/data/labels/41_0.png +0 -0
  537. data/vendor/ggml/examples/yolo/data/labels/41_1.png +0 -0
  538. data/vendor/ggml/examples/yolo/data/labels/41_2.png +0 -0
  539. data/vendor/ggml/examples/yolo/data/labels/41_3.png +0 -0
  540. data/vendor/ggml/examples/yolo/data/labels/41_4.png +0 -0
  541. data/vendor/ggml/examples/yolo/data/labels/41_5.png +0 -0
  542. data/vendor/ggml/examples/yolo/data/labels/41_6.png +0 -0
  543. data/vendor/ggml/examples/yolo/data/labels/41_7.png +0 -0
  544. data/vendor/ggml/examples/yolo/data/labels/42_0.png +0 -0
  545. data/vendor/ggml/examples/yolo/data/labels/42_1.png +0 -0
  546. data/vendor/ggml/examples/yolo/data/labels/42_2.png +0 -0
  547. data/vendor/ggml/examples/yolo/data/labels/42_3.png +0 -0
  548. data/vendor/ggml/examples/yolo/data/labels/42_4.png +0 -0
  549. data/vendor/ggml/examples/yolo/data/labels/42_5.png +0 -0
  550. data/vendor/ggml/examples/yolo/data/labels/42_6.png +0 -0
  551. data/vendor/ggml/examples/yolo/data/labels/42_7.png +0 -0
  552. data/vendor/ggml/examples/yolo/data/labels/43_0.png +0 -0
  553. data/vendor/ggml/examples/yolo/data/labels/43_1.png +0 -0
  554. data/vendor/ggml/examples/yolo/data/labels/43_2.png +0 -0
  555. data/vendor/ggml/examples/yolo/data/labels/43_3.png +0 -0
  556. data/vendor/ggml/examples/yolo/data/labels/43_4.png +0 -0
  557. data/vendor/ggml/examples/yolo/data/labels/43_5.png +0 -0
  558. data/vendor/ggml/examples/yolo/data/labels/43_6.png +0 -0
  559. data/vendor/ggml/examples/yolo/data/labels/43_7.png +0 -0
  560. data/vendor/ggml/examples/yolo/data/labels/44_0.png +0 -0
  561. data/vendor/ggml/examples/yolo/data/labels/44_1.png +0 -0
  562. data/vendor/ggml/examples/yolo/data/labels/44_2.png +0 -0
  563. data/vendor/ggml/examples/yolo/data/labels/44_3.png +0 -0
  564. data/vendor/ggml/examples/yolo/data/labels/44_4.png +0 -0
  565. data/vendor/ggml/examples/yolo/data/labels/44_5.png +0 -0
  566. data/vendor/ggml/examples/yolo/data/labels/44_6.png +0 -0
  567. data/vendor/ggml/examples/yolo/data/labels/44_7.png +0 -0
  568. data/vendor/ggml/examples/yolo/data/labels/45_0.png +0 -0
  569. data/vendor/ggml/examples/yolo/data/labels/45_1.png +0 -0
  570. data/vendor/ggml/examples/yolo/data/labels/45_2.png +0 -0
  571. data/vendor/ggml/examples/yolo/data/labels/45_3.png +0 -0
  572. data/vendor/ggml/examples/yolo/data/labels/45_4.png +0 -0
  573. data/vendor/ggml/examples/yolo/data/labels/45_5.png +0 -0
  574. data/vendor/ggml/examples/yolo/data/labels/45_6.png +0 -0
  575. data/vendor/ggml/examples/yolo/data/labels/45_7.png +0 -0
  576. data/vendor/ggml/examples/yolo/data/labels/46_0.png +0 -0
  577. data/vendor/ggml/examples/yolo/data/labels/46_1.png +0 -0
  578. data/vendor/ggml/examples/yolo/data/labels/46_2.png +0 -0
  579. data/vendor/ggml/examples/yolo/data/labels/46_3.png +0 -0
  580. data/vendor/ggml/examples/yolo/data/labels/46_4.png +0 -0
  581. data/vendor/ggml/examples/yolo/data/labels/46_5.png +0 -0
  582. data/vendor/ggml/examples/yolo/data/labels/46_6.png +0 -0
  583. data/vendor/ggml/examples/yolo/data/labels/46_7.png +0 -0
  584. data/vendor/ggml/examples/yolo/data/labels/47_0.png +0 -0
  585. data/vendor/ggml/examples/yolo/data/labels/47_1.png +0 -0
  586. data/vendor/ggml/examples/yolo/data/labels/47_2.png +0 -0
  587. data/vendor/ggml/examples/yolo/data/labels/47_3.png +0 -0
  588. data/vendor/ggml/examples/yolo/data/labels/47_4.png +0 -0
  589. data/vendor/ggml/examples/yolo/data/labels/47_5.png +0 -0
  590. data/vendor/ggml/examples/yolo/data/labels/47_6.png +0 -0
  591. data/vendor/ggml/examples/yolo/data/labels/47_7.png +0 -0
  592. data/vendor/ggml/examples/yolo/data/labels/48_0.png +0 -0
  593. data/vendor/ggml/examples/yolo/data/labels/48_1.png +0 -0
  594. data/vendor/ggml/examples/yolo/data/labels/48_2.png +0 -0
  595. data/vendor/ggml/examples/yolo/data/labels/48_3.png +0 -0
  596. data/vendor/ggml/examples/yolo/data/labels/48_4.png +0 -0
  597. data/vendor/ggml/examples/yolo/data/labels/48_5.png +0 -0
  598. data/vendor/ggml/examples/yolo/data/labels/48_6.png +0 -0
  599. data/vendor/ggml/examples/yolo/data/labels/48_7.png +0 -0
  600. data/vendor/ggml/examples/yolo/data/labels/49_0.png +0 -0
  601. data/vendor/ggml/examples/yolo/data/labels/49_1.png +0 -0
  602. data/vendor/ggml/examples/yolo/data/labels/49_2.png +0 -0
  603. data/vendor/ggml/examples/yolo/data/labels/49_3.png +0 -0
  604. data/vendor/ggml/examples/yolo/data/labels/49_4.png +0 -0
  605. data/vendor/ggml/examples/yolo/data/labels/49_5.png +0 -0
  606. data/vendor/ggml/examples/yolo/data/labels/49_6.png +0 -0
  607. data/vendor/ggml/examples/yolo/data/labels/49_7.png +0 -0
  608. data/vendor/ggml/examples/yolo/data/labels/50_0.png +0 -0
  609. data/vendor/ggml/examples/yolo/data/labels/50_1.png +0 -0
  610. data/vendor/ggml/examples/yolo/data/labels/50_2.png +0 -0
  611. data/vendor/ggml/examples/yolo/data/labels/50_3.png +0 -0
  612. data/vendor/ggml/examples/yolo/data/labels/50_4.png +0 -0
  613. data/vendor/ggml/examples/yolo/data/labels/50_5.png +0 -0
  614. data/vendor/ggml/examples/yolo/data/labels/50_6.png +0 -0
  615. data/vendor/ggml/examples/yolo/data/labels/50_7.png +0 -0
  616. data/vendor/ggml/examples/yolo/data/labels/51_0.png +0 -0
  617. data/vendor/ggml/examples/yolo/data/labels/51_1.png +0 -0
  618. data/vendor/ggml/examples/yolo/data/labels/51_2.png +0 -0
  619. data/vendor/ggml/examples/yolo/data/labels/51_3.png +0 -0
  620. data/vendor/ggml/examples/yolo/data/labels/51_4.png +0 -0
  621. data/vendor/ggml/examples/yolo/data/labels/51_5.png +0 -0
  622. data/vendor/ggml/examples/yolo/data/labels/51_6.png +0 -0
  623. data/vendor/ggml/examples/yolo/data/labels/51_7.png +0 -0
  624. data/vendor/ggml/examples/yolo/data/labels/52_0.png +0 -0
  625. data/vendor/ggml/examples/yolo/data/labels/52_1.png +0 -0
  626. data/vendor/ggml/examples/yolo/data/labels/52_2.png +0 -0
  627. data/vendor/ggml/examples/yolo/data/labels/52_3.png +0 -0
  628. data/vendor/ggml/examples/yolo/data/labels/52_4.png +0 -0
  629. data/vendor/ggml/examples/yolo/data/labels/52_5.png +0 -0
  630. data/vendor/ggml/examples/yolo/data/labels/52_6.png +0 -0
  631. data/vendor/ggml/examples/yolo/data/labels/52_7.png +0 -0
  632. data/vendor/ggml/examples/yolo/data/labels/53_0.png +0 -0
  633. data/vendor/ggml/examples/yolo/data/labels/53_1.png +0 -0
  634. data/vendor/ggml/examples/yolo/data/labels/53_2.png +0 -0
  635. data/vendor/ggml/examples/yolo/data/labels/53_3.png +0 -0
  636. data/vendor/ggml/examples/yolo/data/labels/53_4.png +0 -0
  637. data/vendor/ggml/examples/yolo/data/labels/53_5.png +0 -0
  638. data/vendor/ggml/examples/yolo/data/labels/53_6.png +0 -0
  639. data/vendor/ggml/examples/yolo/data/labels/53_7.png +0 -0
  640. data/vendor/ggml/examples/yolo/data/labels/54_0.png +0 -0
  641. data/vendor/ggml/examples/yolo/data/labels/54_1.png +0 -0
  642. data/vendor/ggml/examples/yolo/data/labels/54_2.png +0 -0
  643. data/vendor/ggml/examples/yolo/data/labels/54_3.png +0 -0
  644. data/vendor/ggml/examples/yolo/data/labels/54_4.png +0 -0
  645. data/vendor/ggml/examples/yolo/data/labels/54_5.png +0 -0
  646. data/vendor/ggml/examples/yolo/data/labels/54_6.png +0 -0
  647. data/vendor/ggml/examples/yolo/data/labels/54_7.png +0 -0
  648. data/vendor/ggml/examples/yolo/data/labels/55_0.png +0 -0
  649. data/vendor/ggml/examples/yolo/data/labels/55_1.png +0 -0
  650. data/vendor/ggml/examples/yolo/data/labels/55_2.png +0 -0
  651. data/vendor/ggml/examples/yolo/data/labels/55_3.png +0 -0
  652. data/vendor/ggml/examples/yolo/data/labels/55_4.png +0 -0
  653. data/vendor/ggml/examples/yolo/data/labels/55_5.png +0 -0
  654. data/vendor/ggml/examples/yolo/data/labels/55_6.png +0 -0
  655. data/vendor/ggml/examples/yolo/data/labels/55_7.png +0 -0
  656. data/vendor/ggml/examples/yolo/data/labels/56_0.png +0 -0
  657. data/vendor/ggml/examples/yolo/data/labels/56_1.png +0 -0
  658. data/vendor/ggml/examples/yolo/data/labels/56_2.png +0 -0
  659. data/vendor/ggml/examples/yolo/data/labels/56_3.png +0 -0
  660. data/vendor/ggml/examples/yolo/data/labels/56_4.png +0 -0
  661. data/vendor/ggml/examples/yolo/data/labels/56_5.png +0 -0
  662. data/vendor/ggml/examples/yolo/data/labels/56_6.png +0 -0
  663. data/vendor/ggml/examples/yolo/data/labels/56_7.png +0 -0
  664. data/vendor/ggml/examples/yolo/data/labels/57_0.png +0 -0
  665. data/vendor/ggml/examples/yolo/data/labels/57_1.png +0 -0
  666. data/vendor/ggml/examples/yolo/data/labels/57_2.png +0 -0
  667. data/vendor/ggml/examples/yolo/data/labels/57_3.png +0 -0
  668. data/vendor/ggml/examples/yolo/data/labels/57_4.png +0 -0
  669. data/vendor/ggml/examples/yolo/data/labels/57_5.png +0 -0
  670. data/vendor/ggml/examples/yolo/data/labels/57_6.png +0 -0
  671. data/vendor/ggml/examples/yolo/data/labels/57_7.png +0 -0
  672. data/vendor/ggml/examples/yolo/data/labels/58_0.png +0 -0
  673. data/vendor/ggml/examples/yolo/data/labels/58_1.png +0 -0
  674. data/vendor/ggml/examples/yolo/data/labels/58_2.png +0 -0
  675. data/vendor/ggml/examples/yolo/data/labels/58_3.png +0 -0
  676. data/vendor/ggml/examples/yolo/data/labels/58_4.png +0 -0
  677. data/vendor/ggml/examples/yolo/data/labels/58_5.png +0 -0
  678. data/vendor/ggml/examples/yolo/data/labels/58_6.png +0 -0
  679. data/vendor/ggml/examples/yolo/data/labels/58_7.png +0 -0
  680. data/vendor/ggml/examples/yolo/data/labels/59_0.png +0 -0
  681. data/vendor/ggml/examples/yolo/data/labels/59_1.png +0 -0
  682. data/vendor/ggml/examples/yolo/data/labels/59_2.png +0 -0
  683. data/vendor/ggml/examples/yolo/data/labels/59_3.png +0 -0
  684. data/vendor/ggml/examples/yolo/data/labels/59_4.png +0 -0
  685. data/vendor/ggml/examples/yolo/data/labels/59_5.png +0 -0
  686. data/vendor/ggml/examples/yolo/data/labels/59_6.png +0 -0
  687. data/vendor/ggml/examples/yolo/data/labels/59_7.png +0 -0
  688. data/vendor/ggml/examples/yolo/data/labels/60_0.png +0 -0
  689. data/vendor/ggml/examples/yolo/data/labels/60_1.png +0 -0
  690. data/vendor/ggml/examples/yolo/data/labels/60_2.png +0 -0
  691. data/vendor/ggml/examples/yolo/data/labels/60_3.png +0 -0
  692. data/vendor/ggml/examples/yolo/data/labels/60_4.png +0 -0
  693. data/vendor/ggml/examples/yolo/data/labels/60_5.png +0 -0
  694. data/vendor/ggml/examples/yolo/data/labels/60_6.png +0 -0
  695. data/vendor/ggml/examples/yolo/data/labels/60_7.png +0 -0
  696. data/vendor/ggml/examples/yolo/data/labels/61_0.png +0 -0
  697. data/vendor/ggml/examples/yolo/data/labels/61_1.png +0 -0
  698. data/vendor/ggml/examples/yolo/data/labels/61_2.png +0 -0
  699. data/vendor/ggml/examples/yolo/data/labels/61_3.png +0 -0
  700. data/vendor/ggml/examples/yolo/data/labels/61_4.png +0 -0
  701. data/vendor/ggml/examples/yolo/data/labels/61_5.png +0 -0
  702. data/vendor/ggml/examples/yolo/data/labels/61_6.png +0 -0
  703. data/vendor/ggml/examples/yolo/data/labels/61_7.png +0 -0
  704. data/vendor/ggml/examples/yolo/data/labels/62_0.png +0 -0
  705. data/vendor/ggml/examples/yolo/data/labels/62_1.png +0 -0
  706. data/vendor/ggml/examples/yolo/data/labels/62_2.png +0 -0
  707. data/vendor/ggml/examples/yolo/data/labels/62_3.png +0 -0
  708. data/vendor/ggml/examples/yolo/data/labels/62_4.png +0 -0
  709. data/vendor/ggml/examples/yolo/data/labels/62_5.png +0 -0
  710. data/vendor/ggml/examples/yolo/data/labels/62_6.png +0 -0
  711. data/vendor/ggml/examples/yolo/data/labels/62_7.png +0 -0
  712. data/vendor/ggml/examples/yolo/data/labels/63_0.png +0 -0
  713. data/vendor/ggml/examples/yolo/data/labels/63_1.png +0 -0
  714. data/vendor/ggml/examples/yolo/data/labels/63_2.png +0 -0
  715. data/vendor/ggml/examples/yolo/data/labels/63_3.png +0 -0
  716. data/vendor/ggml/examples/yolo/data/labels/63_4.png +0 -0
  717. data/vendor/ggml/examples/yolo/data/labels/63_5.png +0 -0
  718. data/vendor/ggml/examples/yolo/data/labels/63_6.png +0 -0
  719. data/vendor/ggml/examples/yolo/data/labels/63_7.png +0 -0
  720. data/vendor/ggml/examples/yolo/data/labels/64_0.png +0 -0
  721. data/vendor/ggml/examples/yolo/data/labels/64_1.png +0 -0
  722. data/vendor/ggml/examples/yolo/data/labels/64_2.png +0 -0
  723. data/vendor/ggml/examples/yolo/data/labels/64_3.png +0 -0
  724. data/vendor/ggml/examples/yolo/data/labels/64_4.png +0 -0
  725. data/vendor/ggml/examples/yolo/data/labels/64_5.png +0 -0
  726. data/vendor/ggml/examples/yolo/data/labels/64_6.png +0 -0
  727. data/vendor/ggml/examples/yolo/data/labels/64_7.png +0 -0
  728. data/vendor/ggml/examples/yolo/data/labels/65_0.png +0 -0
  729. data/vendor/ggml/examples/yolo/data/labels/65_1.png +0 -0
  730. data/vendor/ggml/examples/yolo/data/labels/65_2.png +0 -0
  731. data/vendor/ggml/examples/yolo/data/labels/65_3.png +0 -0
  732. data/vendor/ggml/examples/yolo/data/labels/65_4.png +0 -0
  733. data/vendor/ggml/examples/yolo/data/labels/65_5.png +0 -0
  734. data/vendor/ggml/examples/yolo/data/labels/65_6.png +0 -0
  735. data/vendor/ggml/examples/yolo/data/labels/65_7.png +0 -0
  736. data/vendor/ggml/examples/yolo/data/labels/66_0.png +0 -0
  737. data/vendor/ggml/examples/yolo/data/labels/66_1.png +0 -0
  738. data/vendor/ggml/examples/yolo/data/labels/66_2.png +0 -0
  739. data/vendor/ggml/examples/yolo/data/labels/66_3.png +0 -0
  740. data/vendor/ggml/examples/yolo/data/labels/66_4.png +0 -0
  741. data/vendor/ggml/examples/yolo/data/labels/66_5.png +0 -0
  742. data/vendor/ggml/examples/yolo/data/labels/66_6.png +0 -0
  743. data/vendor/ggml/examples/yolo/data/labels/66_7.png +0 -0
  744. data/vendor/ggml/examples/yolo/data/labels/67_0.png +0 -0
  745. data/vendor/ggml/examples/yolo/data/labels/67_1.png +0 -0
  746. data/vendor/ggml/examples/yolo/data/labels/67_2.png +0 -0
  747. data/vendor/ggml/examples/yolo/data/labels/67_3.png +0 -0
  748. data/vendor/ggml/examples/yolo/data/labels/67_4.png +0 -0
  749. data/vendor/ggml/examples/yolo/data/labels/67_5.png +0 -0
  750. data/vendor/ggml/examples/yolo/data/labels/67_6.png +0 -0
  751. data/vendor/ggml/examples/yolo/data/labels/67_7.png +0 -0
  752. data/vendor/ggml/examples/yolo/data/labels/68_0.png +0 -0
  753. data/vendor/ggml/examples/yolo/data/labels/68_1.png +0 -0
  754. data/vendor/ggml/examples/yolo/data/labels/68_2.png +0 -0
  755. data/vendor/ggml/examples/yolo/data/labels/68_3.png +0 -0
  756. data/vendor/ggml/examples/yolo/data/labels/68_4.png +0 -0
  757. data/vendor/ggml/examples/yolo/data/labels/68_5.png +0 -0
  758. data/vendor/ggml/examples/yolo/data/labels/68_6.png +0 -0
  759. data/vendor/ggml/examples/yolo/data/labels/68_7.png +0 -0
  760. data/vendor/ggml/examples/yolo/data/labels/69_0.png +0 -0
  761. data/vendor/ggml/examples/yolo/data/labels/69_1.png +0 -0
  762. data/vendor/ggml/examples/yolo/data/labels/69_2.png +0 -0
  763. data/vendor/ggml/examples/yolo/data/labels/69_3.png +0 -0
  764. data/vendor/ggml/examples/yolo/data/labels/69_4.png +0 -0
  765. data/vendor/ggml/examples/yolo/data/labels/69_5.png +0 -0
  766. data/vendor/ggml/examples/yolo/data/labels/69_6.png +0 -0
  767. data/vendor/ggml/examples/yolo/data/labels/69_7.png +0 -0
  768. data/vendor/ggml/examples/yolo/data/labels/70_0.png +0 -0
  769. data/vendor/ggml/examples/yolo/data/labels/70_1.png +0 -0
  770. data/vendor/ggml/examples/yolo/data/labels/70_2.png +0 -0
  771. data/vendor/ggml/examples/yolo/data/labels/70_3.png +0 -0
  772. data/vendor/ggml/examples/yolo/data/labels/70_4.png +0 -0
  773. data/vendor/ggml/examples/yolo/data/labels/70_5.png +0 -0
  774. data/vendor/ggml/examples/yolo/data/labels/70_6.png +0 -0
  775. data/vendor/ggml/examples/yolo/data/labels/70_7.png +0 -0
  776. data/vendor/ggml/examples/yolo/data/labels/71_0.png +0 -0
  777. data/vendor/ggml/examples/yolo/data/labels/71_1.png +0 -0
  778. data/vendor/ggml/examples/yolo/data/labels/71_2.png +0 -0
  779. data/vendor/ggml/examples/yolo/data/labels/71_3.png +0 -0
  780. data/vendor/ggml/examples/yolo/data/labels/71_4.png +0 -0
  781. data/vendor/ggml/examples/yolo/data/labels/71_5.png +0 -0
  782. data/vendor/ggml/examples/yolo/data/labels/71_6.png +0 -0
  783. data/vendor/ggml/examples/yolo/data/labels/71_7.png +0 -0
  784. data/vendor/ggml/examples/yolo/data/labels/72_0.png +0 -0
  785. data/vendor/ggml/examples/yolo/data/labels/72_1.png +0 -0
  786. data/vendor/ggml/examples/yolo/data/labels/72_2.png +0 -0
  787. data/vendor/ggml/examples/yolo/data/labels/72_3.png +0 -0
  788. data/vendor/ggml/examples/yolo/data/labels/72_4.png +0 -0
  789. data/vendor/ggml/examples/yolo/data/labels/72_5.png +0 -0
  790. data/vendor/ggml/examples/yolo/data/labels/72_6.png +0 -0
  791. data/vendor/ggml/examples/yolo/data/labels/72_7.png +0 -0
  792. data/vendor/ggml/examples/yolo/data/labels/73_0.png +0 -0
  793. data/vendor/ggml/examples/yolo/data/labels/73_1.png +0 -0
  794. data/vendor/ggml/examples/yolo/data/labels/73_2.png +0 -0
  795. data/vendor/ggml/examples/yolo/data/labels/73_3.png +0 -0
  796. data/vendor/ggml/examples/yolo/data/labels/73_4.png +0 -0
  797. data/vendor/ggml/examples/yolo/data/labels/73_5.png +0 -0
  798. data/vendor/ggml/examples/yolo/data/labels/73_6.png +0 -0
  799. data/vendor/ggml/examples/yolo/data/labels/73_7.png +0 -0
  800. data/vendor/ggml/examples/yolo/data/labels/74_0.png +0 -0
  801. data/vendor/ggml/examples/yolo/data/labels/74_1.png +0 -0
  802. data/vendor/ggml/examples/yolo/data/labels/74_2.png +0 -0
  803. data/vendor/ggml/examples/yolo/data/labels/74_3.png +0 -0
  804. data/vendor/ggml/examples/yolo/data/labels/74_4.png +0 -0
  805. data/vendor/ggml/examples/yolo/data/labels/74_5.png +0 -0
  806. data/vendor/ggml/examples/yolo/data/labels/74_6.png +0 -0
  807. data/vendor/ggml/examples/yolo/data/labels/74_7.png +0 -0
  808. data/vendor/ggml/examples/yolo/data/labels/75_0.png +0 -0
  809. data/vendor/ggml/examples/yolo/data/labels/75_1.png +0 -0
  810. data/vendor/ggml/examples/yolo/data/labels/75_2.png +0 -0
  811. data/vendor/ggml/examples/yolo/data/labels/75_3.png +0 -0
  812. data/vendor/ggml/examples/yolo/data/labels/75_4.png +0 -0
  813. data/vendor/ggml/examples/yolo/data/labels/75_5.png +0 -0
  814. data/vendor/ggml/examples/yolo/data/labels/75_6.png +0 -0
  815. data/vendor/ggml/examples/yolo/data/labels/75_7.png +0 -0
  816. data/vendor/ggml/examples/yolo/data/labels/76_0.png +0 -0
  817. data/vendor/ggml/examples/yolo/data/labels/76_1.png +0 -0
  818. data/vendor/ggml/examples/yolo/data/labels/76_2.png +0 -0
  819. data/vendor/ggml/examples/yolo/data/labels/76_3.png +0 -0
  820. data/vendor/ggml/examples/yolo/data/labels/76_4.png +0 -0
  821. data/vendor/ggml/examples/yolo/data/labels/76_5.png +0 -0
  822. data/vendor/ggml/examples/yolo/data/labels/76_6.png +0 -0
  823. data/vendor/ggml/examples/yolo/data/labels/76_7.png +0 -0
  824. data/vendor/ggml/examples/yolo/data/labels/77_0.png +0 -0
  825. data/vendor/ggml/examples/yolo/data/labels/77_1.png +0 -0
  826. data/vendor/ggml/examples/yolo/data/labels/77_2.png +0 -0
  827. data/vendor/ggml/examples/yolo/data/labels/77_3.png +0 -0
  828. data/vendor/ggml/examples/yolo/data/labels/77_4.png +0 -0
  829. data/vendor/ggml/examples/yolo/data/labels/77_5.png +0 -0
  830. data/vendor/ggml/examples/yolo/data/labels/77_6.png +0 -0
  831. data/vendor/ggml/examples/yolo/data/labels/77_7.png +0 -0
  832. data/vendor/ggml/examples/yolo/data/labels/78_0.png +0 -0
  833. data/vendor/ggml/examples/yolo/data/labels/78_1.png +0 -0
  834. data/vendor/ggml/examples/yolo/data/labels/78_2.png +0 -0
  835. data/vendor/ggml/examples/yolo/data/labels/78_3.png +0 -0
  836. data/vendor/ggml/examples/yolo/data/labels/78_4.png +0 -0
  837. data/vendor/ggml/examples/yolo/data/labels/78_5.png +0 -0
  838. data/vendor/ggml/examples/yolo/data/labels/78_6.png +0 -0
  839. data/vendor/ggml/examples/yolo/data/labels/78_7.png +0 -0
  840. data/vendor/ggml/examples/yolo/data/labels/79_0.png +0 -0
  841. data/vendor/ggml/examples/yolo/data/labels/79_1.png +0 -0
  842. data/vendor/ggml/examples/yolo/data/labels/79_2.png +0 -0
  843. data/vendor/ggml/examples/yolo/data/labels/79_3.png +0 -0
  844. data/vendor/ggml/examples/yolo/data/labels/79_4.png +0 -0
  845. data/vendor/ggml/examples/yolo/data/labels/79_5.png +0 -0
  846. data/vendor/ggml/examples/yolo/data/labels/79_6.png +0 -0
  847. data/vendor/ggml/examples/yolo/data/labels/79_7.png +0 -0
  848. data/vendor/ggml/examples/yolo/data/labels/80_0.png +0 -0
  849. data/vendor/ggml/examples/yolo/data/labels/80_1.png +0 -0
  850. data/vendor/ggml/examples/yolo/data/labels/80_2.png +0 -0
  851. data/vendor/ggml/examples/yolo/data/labels/80_3.png +0 -0
  852. data/vendor/ggml/examples/yolo/data/labels/80_4.png +0 -0
  853. data/vendor/ggml/examples/yolo/data/labels/80_5.png +0 -0
  854. data/vendor/ggml/examples/yolo/data/labels/80_6.png +0 -0
  855. data/vendor/ggml/examples/yolo/data/labels/80_7.png +0 -0
  856. data/vendor/ggml/examples/yolo/data/labels/81_0.png +0 -0
  857. data/vendor/ggml/examples/yolo/data/labels/81_1.png +0 -0
  858. data/vendor/ggml/examples/yolo/data/labels/81_2.png +0 -0
  859. data/vendor/ggml/examples/yolo/data/labels/81_3.png +0 -0
  860. data/vendor/ggml/examples/yolo/data/labels/81_4.png +0 -0
  861. data/vendor/ggml/examples/yolo/data/labels/81_5.png +0 -0
  862. data/vendor/ggml/examples/yolo/data/labels/81_6.png +0 -0
  863. data/vendor/ggml/examples/yolo/data/labels/81_7.png +0 -0
  864. data/vendor/ggml/examples/yolo/data/labels/82_0.png +0 -0
  865. data/vendor/ggml/examples/yolo/data/labels/82_1.png +0 -0
  866. data/vendor/ggml/examples/yolo/data/labels/82_2.png +0 -0
  867. data/vendor/ggml/examples/yolo/data/labels/82_3.png +0 -0
  868. data/vendor/ggml/examples/yolo/data/labels/82_4.png +0 -0
  869. data/vendor/ggml/examples/yolo/data/labels/82_5.png +0 -0
  870. data/vendor/ggml/examples/yolo/data/labels/82_6.png +0 -0
  871. data/vendor/ggml/examples/yolo/data/labels/82_7.png +0 -0
  872. data/vendor/ggml/examples/yolo/data/labels/83_0.png +0 -0
  873. data/vendor/ggml/examples/yolo/data/labels/83_1.png +0 -0
  874. data/vendor/ggml/examples/yolo/data/labels/83_2.png +0 -0
  875. data/vendor/ggml/examples/yolo/data/labels/83_3.png +0 -0
  876. data/vendor/ggml/examples/yolo/data/labels/83_4.png +0 -0
  877. data/vendor/ggml/examples/yolo/data/labels/83_5.png +0 -0
  878. data/vendor/ggml/examples/yolo/data/labels/83_6.png +0 -0
  879. data/vendor/ggml/examples/yolo/data/labels/83_7.png +0 -0
  880. data/vendor/ggml/examples/yolo/data/labels/84_0.png +0 -0
  881. data/vendor/ggml/examples/yolo/data/labels/84_1.png +0 -0
  882. data/vendor/ggml/examples/yolo/data/labels/84_2.png +0 -0
  883. data/vendor/ggml/examples/yolo/data/labels/84_3.png +0 -0
  884. data/vendor/ggml/examples/yolo/data/labels/84_4.png +0 -0
  885. data/vendor/ggml/examples/yolo/data/labels/84_5.png +0 -0
  886. data/vendor/ggml/examples/yolo/data/labels/84_6.png +0 -0
  887. data/vendor/ggml/examples/yolo/data/labels/84_7.png +0 -0
  888. data/vendor/ggml/examples/yolo/data/labels/85_0.png +0 -0
  889. data/vendor/ggml/examples/yolo/data/labels/85_1.png +0 -0
  890. data/vendor/ggml/examples/yolo/data/labels/85_2.png +0 -0
  891. data/vendor/ggml/examples/yolo/data/labels/85_3.png +0 -0
  892. data/vendor/ggml/examples/yolo/data/labels/85_4.png +0 -0
  893. data/vendor/ggml/examples/yolo/data/labels/85_5.png +0 -0
  894. data/vendor/ggml/examples/yolo/data/labels/85_6.png +0 -0
  895. data/vendor/ggml/examples/yolo/data/labels/85_7.png +0 -0
  896. data/vendor/ggml/examples/yolo/data/labels/86_0.png +0 -0
  897. data/vendor/ggml/examples/yolo/data/labels/86_1.png +0 -0
  898. data/vendor/ggml/examples/yolo/data/labels/86_2.png +0 -0
  899. data/vendor/ggml/examples/yolo/data/labels/86_3.png +0 -0
  900. data/vendor/ggml/examples/yolo/data/labels/86_4.png +0 -0
  901. data/vendor/ggml/examples/yolo/data/labels/86_5.png +0 -0
  902. data/vendor/ggml/examples/yolo/data/labels/86_6.png +0 -0
  903. data/vendor/ggml/examples/yolo/data/labels/86_7.png +0 -0
  904. data/vendor/ggml/examples/yolo/data/labels/87_0.png +0 -0
  905. data/vendor/ggml/examples/yolo/data/labels/87_1.png +0 -0
  906. data/vendor/ggml/examples/yolo/data/labels/87_2.png +0 -0
  907. data/vendor/ggml/examples/yolo/data/labels/87_3.png +0 -0
  908. data/vendor/ggml/examples/yolo/data/labels/87_4.png +0 -0
  909. data/vendor/ggml/examples/yolo/data/labels/87_5.png +0 -0
  910. data/vendor/ggml/examples/yolo/data/labels/87_6.png +0 -0
  911. data/vendor/ggml/examples/yolo/data/labels/87_7.png +0 -0
  912. data/vendor/ggml/examples/yolo/data/labels/88_0.png +0 -0
  913. data/vendor/ggml/examples/yolo/data/labels/88_1.png +0 -0
  914. data/vendor/ggml/examples/yolo/data/labels/88_2.png +0 -0
  915. data/vendor/ggml/examples/yolo/data/labels/88_3.png +0 -0
  916. data/vendor/ggml/examples/yolo/data/labels/88_4.png +0 -0
  917. data/vendor/ggml/examples/yolo/data/labels/88_5.png +0 -0
  918. data/vendor/ggml/examples/yolo/data/labels/88_6.png +0 -0
  919. data/vendor/ggml/examples/yolo/data/labels/88_7.png +0 -0
  920. data/vendor/ggml/examples/yolo/data/labels/89_0.png +0 -0
  921. data/vendor/ggml/examples/yolo/data/labels/89_1.png +0 -0
  922. data/vendor/ggml/examples/yolo/data/labels/89_2.png +0 -0
  923. data/vendor/ggml/examples/yolo/data/labels/89_3.png +0 -0
  924. data/vendor/ggml/examples/yolo/data/labels/89_4.png +0 -0
  925. data/vendor/ggml/examples/yolo/data/labels/89_5.png +0 -0
  926. data/vendor/ggml/examples/yolo/data/labels/89_6.png +0 -0
  927. data/vendor/ggml/examples/yolo/data/labels/89_7.png +0 -0
  928. data/vendor/ggml/examples/yolo/data/labels/90_0.png +0 -0
  929. data/vendor/ggml/examples/yolo/data/labels/90_1.png +0 -0
  930. data/vendor/ggml/examples/yolo/data/labels/90_2.png +0 -0
  931. data/vendor/ggml/examples/yolo/data/labels/90_3.png +0 -0
  932. data/vendor/ggml/examples/yolo/data/labels/90_4.png +0 -0
  933. data/vendor/ggml/examples/yolo/data/labels/90_5.png +0 -0
  934. data/vendor/ggml/examples/yolo/data/labels/90_6.png +0 -0
  935. data/vendor/ggml/examples/yolo/data/labels/90_7.png +0 -0
  936. data/vendor/ggml/examples/yolo/data/labels/91_0.png +0 -0
  937. data/vendor/ggml/examples/yolo/data/labels/91_1.png +0 -0
  938. data/vendor/ggml/examples/yolo/data/labels/91_2.png +0 -0
  939. data/vendor/ggml/examples/yolo/data/labels/91_3.png +0 -0
  940. data/vendor/ggml/examples/yolo/data/labels/91_4.png +0 -0
  941. data/vendor/ggml/examples/yolo/data/labels/91_5.png +0 -0
  942. data/vendor/ggml/examples/yolo/data/labels/91_6.png +0 -0
  943. data/vendor/ggml/examples/yolo/data/labels/91_7.png +0 -0
  944. data/vendor/ggml/examples/yolo/data/labels/92_0.png +0 -0
  945. data/vendor/ggml/examples/yolo/data/labels/92_1.png +0 -0
  946. data/vendor/ggml/examples/yolo/data/labels/92_2.png +0 -0
  947. data/vendor/ggml/examples/yolo/data/labels/92_3.png +0 -0
  948. data/vendor/ggml/examples/yolo/data/labels/92_4.png +0 -0
  949. data/vendor/ggml/examples/yolo/data/labels/92_5.png +0 -0
  950. data/vendor/ggml/examples/yolo/data/labels/92_6.png +0 -0
  951. data/vendor/ggml/examples/yolo/data/labels/92_7.png +0 -0
  952. data/vendor/ggml/examples/yolo/data/labels/93_0.png +0 -0
  953. data/vendor/ggml/examples/yolo/data/labels/93_1.png +0 -0
  954. data/vendor/ggml/examples/yolo/data/labels/93_2.png +0 -0
  955. data/vendor/ggml/examples/yolo/data/labels/93_3.png +0 -0
  956. data/vendor/ggml/examples/yolo/data/labels/93_4.png +0 -0
  957. data/vendor/ggml/examples/yolo/data/labels/93_5.png +0 -0
  958. data/vendor/ggml/examples/yolo/data/labels/93_6.png +0 -0
  959. data/vendor/ggml/examples/yolo/data/labels/93_7.png +0 -0
  960. data/vendor/ggml/examples/yolo/data/labels/94_0.png +0 -0
  961. data/vendor/ggml/examples/yolo/data/labels/94_1.png +0 -0
  962. data/vendor/ggml/examples/yolo/data/labels/94_2.png +0 -0
  963. data/vendor/ggml/examples/yolo/data/labels/94_3.png +0 -0
  964. data/vendor/ggml/examples/yolo/data/labels/94_4.png +0 -0
  965. data/vendor/ggml/examples/yolo/data/labels/94_5.png +0 -0
  966. data/vendor/ggml/examples/yolo/data/labels/94_6.png +0 -0
  967. data/vendor/ggml/examples/yolo/data/labels/94_7.png +0 -0
  968. data/vendor/ggml/examples/yolo/data/labels/95_0.png +0 -0
  969. data/vendor/ggml/examples/yolo/data/labels/95_1.png +0 -0
  970. data/vendor/ggml/examples/yolo/data/labels/95_2.png +0 -0
  971. data/vendor/ggml/examples/yolo/data/labels/95_3.png +0 -0
  972. data/vendor/ggml/examples/yolo/data/labels/95_4.png +0 -0
  973. data/vendor/ggml/examples/yolo/data/labels/95_5.png +0 -0
  974. data/vendor/ggml/examples/yolo/data/labels/95_6.png +0 -0
  975. data/vendor/ggml/examples/yolo/data/labels/95_7.png +0 -0
  976. data/vendor/ggml/examples/yolo/data/labels/96_0.png +0 -0
  977. data/vendor/ggml/examples/yolo/data/labels/96_1.png +0 -0
  978. data/vendor/ggml/examples/yolo/data/labels/96_2.png +0 -0
  979. data/vendor/ggml/examples/yolo/data/labels/96_3.png +0 -0
  980. data/vendor/ggml/examples/yolo/data/labels/96_4.png +0 -0
  981. data/vendor/ggml/examples/yolo/data/labels/96_5.png +0 -0
  982. data/vendor/ggml/examples/yolo/data/labels/96_6.png +0 -0
  983. data/vendor/ggml/examples/yolo/data/labels/96_7.png +0 -0
  984. data/vendor/ggml/examples/yolo/data/labels/97_0.png +0 -0
  985. data/vendor/ggml/examples/yolo/data/labels/97_1.png +0 -0
  986. data/vendor/ggml/examples/yolo/data/labels/97_2.png +0 -0
  987. data/vendor/ggml/examples/yolo/data/labels/97_3.png +0 -0
  988. data/vendor/ggml/examples/yolo/data/labels/97_4.png +0 -0
  989. data/vendor/ggml/examples/yolo/data/labels/97_5.png +0 -0
  990. data/vendor/ggml/examples/yolo/data/labels/97_6.png +0 -0
  991. data/vendor/ggml/examples/yolo/data/labels/97_7.png +0 -0
  992. data/vendor/ggml/examples/yolo/data/labels/98_0.png +0 -0
  993. data/vendor/ggml/examples/yolo/data/labels/98_1.png +0 -0
  994. data/vendor/ggml/examples/yolo/data/labels/98_2.png +0 -0
  995. data/vendor/ggml/examples/yolo/data/labels/98_3.png +0 -0
  996. data/vendor/ggml/examples/yolo/data/labels/98_4.png +0 -0
  997. data/vendor/ggml/examples/yolo/data/labels/98_5.png +0 -0
  998. data/vendor/ggml/examples/yolo/data/labels/98_6.png +0 -0
  999. data/vendor/ggml/examples/yolo/data/labels/98_7.png +0 -0
  1000. data/vendor/ggml/examples/yolo/data/labels/99_0.png +0 -0
  1001. data/vendor/ggml/examples/yolo/data/labels/99_1.png +0 -0
  1002. data/vendor/ggml/examples/yolo/data/labels/99_2.png +0 -0
  1003. data/vendor/ggml/examples/yolo/data/labels/99_3.png +0 -0
  1004. data/vendor/ggml/examples/yolo/data/labels/99_4.png +0 -0
  1005. data/vendor/ggml/examples/yolo/data/labels/99_5.png +0 -0
  1006. data/vendor/ggml/examples/yolo/data/labels/99_6.png +0 -0
  1007. data/vendor/ggml/examples/yolo/data/labels/99_7.png +0 -0
  1008. data/vendor/ggml/examples/yolo/yolo-image.cpp +210 -0
  1009. data/vendor/ggml/examples/yolo/yolo-image.h +39 -0
  1010. data/vendor/ggml/examples/yolo/yolov3-tiny.cpp +661 -0
  1011. data/vendor/ggml/ggml.pc.in +10 -0
  1012. data/vendor/ggml/include/ggml-alloc.h +85 -0
  1013. data/vendor/ggml/include/ggml-backend.h +431 -0
  1014. data/vendor/ggml/include/ggml-blas.h +25 -0
  1015. data/vendor/ggml/include/ggml-cann.h +123 -0
  1016. data/vendor/ggml/include/ggml-cpp.h +39 -0
  1017. data/vendor/ggml/include/ggml-cpu.h +151 -0
  1018. data/vendor/ggml/include/ggml-cuda.h +50 -0
  1019. data/vendor/ggml/include/ggml-hexagon.h +19 -0
  1020. data/vendor/ggml/include/ggml-metal.h +61 -0
  1021. data/vendor/ggml/include/ggml-opencl.h +26 -0
  1022. data/vendor/ggml/include/ggml-openvino.h +37 -0
  1023. data/vendor/ggml/include/ggml-opt.h +256 -0
  1024. data/vendor/ggml/include/ggml-rpc.h +35 -0
  1025. data/vendor/ggml/include/ggml-sycl.h +49 -0
  1026. data/vendor/ggml/include/ggml-virtgpu.h +14 -0
  1027. data/vendor/ggml/include/ggml-vulkan.h +29 -0
  1028. data/vendor/ggml/include/ggml-webgpu.h +19 -0
  1029. data/vendor/ggml/include/ggml-zdnn.h +17 -0
  1030. data/vendor/ggml/include/ggml-zendnn.h +22 -0
  1031. data/vendor/ggml/include/ggml.h +2845 -0
  1032. data/vendor/ggml/include/gguf.h +204 -0
  1033. data/vendor/ggml/requirements.txt +12 -0
  1034. data/vendor/ggml/scripts/gen-authors.sh +9 -0
  1035. data/vendor/ggml/scripts/release.sh +296 -0
  1036. data/vendor/ggml/scripts/sync-llama-am.sh +167 -0
  1037. data/vendor/ggml/scripts/sync-llama.last +1 -0
  1038. data/vendor/ggml/scripts/sync-llama.sh +21 -0
  1039. data/vendor/ggml/scripts/sync-whisper-am.sh +138 -0
  1040. data/vendor/ggml/scripts/sync-whisper.last +1 -0
  1041. data/vendor/ggml/scripts/sync-whisper.sh +17 -0
  1042. data/vendor/ggml/src/CMakeLists.txt +493 -0
  1043. data/vendor/ggml/src/ggml-alloc.c +1248 -0
  1044. data/vendor/ggml/src/ggml-backend-dl.cpp +48 -0
  1045. data/vendor/ggml/src/ggml-backend-dl.h +45 -0
  1046. data/vendor/ggml/src/ggml-backend-impl.h +275 -0
  1047. data/vendor/ggml/src/ggml-backend-meta.cpp +2144 -0
  1048. data/vendor/ggml/src/ggml-backend-reg.cpp +586 -0
  1049. data/vendor/ggml/src/ggml-backend.cpp +2371 -0
  1050. data/vendor/ggml/src/ggml-blas/CMakeLists.txt +101 -0
  1051. data/vendor/ggml/src/ggml-blas/ggml-blas.cpp +522 -0
  1052. data/vendor/ggml/src/ggml-cann/CMakeLists.txt +89 -0
  1053. data/vendor/ggml/src/ggml-cann/acl_tensor.cpp +195 -0
  1054. data/vendor/ggml/src/ggml-cann/acl_tensor.h +349 -0
  1055. data/vendor/ggml/src/ggml-cann/aclnn_ops.cpp +4436 -0
  1056. data/vendor/ggml/src/ggml-cann/aclnn_ops.h +1190 -0
  1057. data/vendor/ggml/src/ggml-cann/common.h +651 -0
  1058. data/vendor/ggml/src/ggml-cann/ggml-cann.cpp +3062 -0
  1059. data/vendor/ggml/src/ggml-common.h +1900 -0
  1060. data/vendor/ggml/src/ggml-cpu/CMakeLists.txt +731 -0
  1061. data/vendor/ggml/src/ggml-cpu/amx/amx.cpp +249 -0
  1062. data/vendor/ggml/src/ggml-cpu/amx/amx.h +8 -0
  1063. data/vendor/ggml/src/ggml-cpu/amx/common.h +115 -0
  1064. data/vendor/ggml/src/ggml-cpu/amx/mmq.cpp +2512 -0
  1065. data/vendor/ggml/src/ggml-cpu/amx/mmq.h +10 -0
  1066. data/vendor/ggml/src/ggml-cpu/arch/arm/cpu-feats.cpp +98 -0
  1067. data/vendor/ggml/src/ggml-cpu/arch/arm/quants.c +4245 -0
  1068. data/vendor/ggml/src/ggml-cpu/arch/arm/repack.cpp +5156 -0
  1069. data/vendor/ggml/src/ggml-cpu/arch/loongarch/quants.c +2158 -0
  1070. data/vendor/ggml/src/ggml-cpu/arch/powerpc/cpu-feats.cpp +82 -0
  1071. data/vendor/ggml/src/ggml-cpu/arch/powerpc/quants.c +2304 -0
  1072. data/vendor/ggml/src/ggml-cpu/arch/riscv/cpu-feats.cpp +38 -0
  1073. data/vendor/ggml/src/ggml-cpu/arch/riscv/quants.c +4553 -0
  1074. data/vendor/ggml/src/ggml-cpu/arch/riscv/repack.cpp +1703 -0
  1075. data/vendor/ggml/src/ggml-cpu/arch/s390/cpu-feats.cpp +50 -0
  1076. data/vendor/ggml/src/ggml-cpu/arch/s390/quants.c +1465 -0
  1077. data/vendor/ggml/src/ggml-cpu/arch/wasm/quants.c +1220 -0
  1078. data/vendor/ggml/src/ggml-cpu/arch/x86/cpu-feats.cpp +327 -0
  1079. data/vendor/ggml/src/ggml-cpu/arch/x86/quants.c +3970 -0
  1080. data/vendor/ggml/src/ggml-cpu/arch/x86/repack.cpp +6407 -0
  1081. data/vendor/ggml/src/ggml-cpu/arch-fallback.h +348 -0
  1082. data/vendor/ggml/src/ggml-cpu/binary-ops.cpp +154 -0
  1083. data/vendor/ggml/src/ggml-cpu/binary-ops.h +16 -0
  1084. data/vendor/ggml/src/ggml-cpu/cmake/FindSIMD.cmake +100 -0
  1085. data/vendor/ggml/src/ggml-cpu/cmake/FindSMTIME.cmake +32 -0
  1086. data/vendor/ggml/src/ggml-cpu/common.h +95 -0
  1087. data/vendor/ggml/src/ggml-cpu/ggml-cpu-impl.h +539 -0
  1088. data/vendor/ggml/src/ggml-cpu/ggml-cpu.c +3835 -0
  1089. data/vendor/ggml/src/ggml-cpu/ggml-cpu.cpp +703 -0
  1090. data/vendor/ggml/src/ggml-cpu/hbm.cpp +55 -0
  1091. data/vendor/ggml/src/ggml-cpu/hbm.h +8 -0
  1092. data/vendor/ggml/src/ggml-cpu/kleidiai/kernels.cpp +939 -0
  1093. data/vendor/ggml/src/ggml-cpu/kleidiai/kernels.h +90 -0
  1094. data/vendor/ggml/src/ggml-cpu/kleidiai/kleidiai.cpp +1513 -0
  1095. data/vendor/ggml/src/ggml-cpu/kleidiai/kleidiai.h +17 -0
  1096. data/vendor/ggml/src/ggml-cpu/llamafile/sgemm.cpp +4051 -0
  1097. data/vendor/ggml/src/ggml-cpu/llamafile/sgemm.h +25 -0
  1098. data/vendor/ggml/src/ggml-cpu/ops.cpp +11373 -0
  1099. data/vendor/ggml/src/ggml-cpu/ops.h +119 -0
  1100. data/vendor/ggml/src/ggml-cpu/quants.c +1288 -0
  1101. data/vendor/ggml/src/ggml-cpu/quants.h +103 -0
  1102. data/vendor/ggml/src/ggml-cpu/repack.cpp +4836 -0
  1103. data/vendor/ggml/src/ggml-cpu/repack.h +245 -0
  1104. data/vendor/ggml/src/ggml-cpu/simd-gemm.h +226 -0
  1105. data/vendor/ggml/src/ggml-cpu/simd-mappings.h +1319 -0
  1106. data/vendor/ggml/src/ggml-cpu/spacemit/ime.cpp +1740 -0
  1107. data/vendor/ggml/src/ggml-cpu/spacemit/ime.h +21 -0
  1108. data/vendor/ggml/src/ggml-cpu/spacemit/ime1_kernels.cpp +1027 -0
  1109. data/vendor/ggml/src/ggml-cpu/spacemit/ime2_kernels.cpp +5768 -0
  1110. data/vendor/ggml/src/ggml-cpu/spacemit/ime_env.cpp +320 -0
  1111. data/vendor/ggml/src/ggml-cpu/spacemit/ime_env.h +55 -0
  1112. data/vendor/ggml/src/ggml-cpu/spacemit/ime_kernels.h +189 -0
  1113. data/vendor/ggml/src/ggml-cpu/spacemit/repack.cpp +1795 -0
  1114. data/vendor/ggml/src/ggml-cpu/spacemit/repack.h +14 -0
  1115. data/vendor/ggml/src/ggml-cpu/spacemit/rvv_kernels.cpp +3178 -0
  1116. data/vendor/ggml/src/ggml-cpu/spacemit/rvv_kernels.h +95 -0
  1117. data/vendor/ggml/src/ggml-cpu/spacemit/spine_barrier.h +34 -0
  1118. data/vendor/ggml/src/ggml-cpu/spacemit/spine_mem_pool.cpp +760 -0
  1119. data/vendor/ggml/src/ggml-cpu/spacemit/spine_mem_pool.h +32 -0
  1120. data/vendor/ggml/src/ggml-cpu/spacemit/spine_tcm.h +409 -0
  1121. data/vendor/ggml/src/ggml-cpu/traits.cpp +36 -0
  1122. data/vendor/ggml/src/ggml-cpu/traits.h +38 -0
  1123. data/vendor/ggml/src/ggml-cpu/unary-ops.cpp +337 -0
  1124. data/vendor/ggml/src/ggml-cpu/unary-ops.h +35 -0
  1125. data/vendor/ggml/src/ggml-cpu/vec.cpp +629 -0
  1126. data/vendor/ggml/src/ggml-cpu/vec.h +1588 -0
  1127. data/vendor/ggml/src/ggml-cuda/CMakeLists.txt +268 -0
  1128. data/vendor/ggml/src/ggml-cuda/acc.cu +61 -0
  1129. data/vendor/ggml/src/ggml-cuda/acc.cuh +5 -0
  1130. data/vendor/ggml/src/ggml-cuda/add-id.cu +58 -0
  1131. data/vendor/ggml/src/ggml-cuda/add-id.cuh +3 -0
  1132. data/vendor/ggml/src/ggml-cuda/allreduce.cu +971 -0
  1133. data/vendor/ggml/src/ggml-cuda/allreduce.cuh +29 -0
  1134. data/vendor/ggml/src/ggml-cuda/arange.cu +34 -0
  1135. data/vendor/ggml/src/ggml-cuda/arange.cuh +5 -0
  1136. data/vendor/ggml/src/ggml-cuda/argmax.cu +91 -0
  1137. data/vendor/ggml/src/ggml-cuda/argmax.cuh +3 -0
  1138. data/vendor/ggml/src/ggml-cuda/argsort.cu +266 -0
  1139. data/vendor/ggml/src/ggml-cuda/argsort.cuh +19 -0
  1140. data/vendor/ggml/src/ggml-cuda/binbcast.cu +534 -0
  1141. data/vendor/ggml/src/ggml-cuda/binbcast.cuh +12 -0
  1142. data/vendor/ggml/src/ggml-cuda/clamp.cu +45 -0
  1143. data/vendor/ggml/src/ggml-cuda/clamp.cuh +5 -0
  1144. data/vendor/ggml/src/ggml-cuda/common.cuh +1489 -0
  1145. data/vendor/ggml/src/ggml-cuda/concat.cu +204 -0
  1146. data/vendor/ggml/src/ggml-cuda/concat.cuh +5 -0
  1147. data/vendor/ggml/src/ggml-cuda/conv-transpose-1d.cu +86 -0
  1148. data/vendor/ggml/src/ggml-cuda/conv-transpose-1d.cuh +5 -0
  1149. data/vendor/ggml/src/ggml-cuda/conv2d-dw.cu +161 -0
  1150. data/vendor/ggml/src/ggml-cuda/conv2d-dw.cuh +5 -0
  1151. data/vendor/ggml/src/ggml-cuda/conv2d-transpose.cu +115 -0
  1152. data/vendor/ggml/src/ggml-cuda/conv2d-transpose.cuh +5 -0
  1153. data/vendor/ggml/src/ggml-cuda/conv2d.cu +166 -0
  1154. data/vendor/ggml/src/ggml-cuda/conv2d.cuh +5 -0
  1155. data/vendor/ggml/src/ggml-cuda/convert.cu +892 -0
  1156. data/vendor/ggml/src/ggml-cuda/convert.cuh +66 -0
  1157. data/vendor/ggml/src/ggml-cuda/count-equal.cu +64 -0
  1158. data/vendor/ggml/src/ggml-cuda/count-equal.cuh +5 -0
  1159. data/vendor/ggml/src/ggml-cuda/cp-async.cuh +57 -0
  1160. data/vendor/ggml/src/ggml-cuda/cpy-utils.cuh +217 -0
  1161. data/vendor/ggml/src/ggml-cuda/cpy.cu +558 -0
  1162. data/vendor/ggml/src/ggml-cuda/cpy.cuh +7 -0
  1163. data/vendor/ggml/src/ggml-cuda/cross-entropy-loss.cu +177 -0
  1164. data/vendor/ggml/src/ggml-cuda/cross-entropy-loss.cuh +7 -0
  1165. data/vendor/ggml/src/ggml-cuda/cumsum.cu +307 -0
  1166. data/vendor/ggml/src/ggml-cuda/cumsum.cuh +5 -0
  1167. data/vendor/ggml/src/ggml-cuda/dequantize.cuh +99 -0
  1168. data/vendor/ggml/src/ggml-cuda/diag.cu +77 -0
  1169. data/vendor/ggml/src/ggml-cuda/diag.cuh +5 -0
  1170. data/vendor/ggml/src/ggml-cuda/diagmask.cu +40 -0
  1171. data/vendor/ggml/src/ggml-cuda/diagmask.cuh +5 -0
  1172. data/vendor/ggml/src/ggml-cuda/fattn-common.cuh +1212 -0
  1173. data/vendor/ggml/src/ggml-cuda/fattn-mma-f16.cuh +2020 -0
  1174. data/vendor/ggml/src/ggml-cuda/fattn-tile.cu +61 -0
  1175. data/vendor/ggml/src/ggml-cuda/fattn-tile.cuh +1347 -0
  1176. data/vendor/ggml/src/ggml-cuda/fattn-vec.cuh +600 -0
  1177. data/vendor/ggml/src/ggml-cuda/fattn-wmma-f16.cu +696 -0
  1178. data/vendor/ggml/src/ggml-cuda/fattn-wmma-f16.cuh +51 -0
  1179. data/vendor/ggml/src/ggml-cuda/fattn.cu +562 -0
  1180. data/vendor/ggml/src/ggml-cuda/fattn.cuh +5 -0
  1181. data/vendor/ggml/src/ggml-cuda/fill.cu +37 -0
  1182. data/vendor/ggml/src/ggml-cuda/fill.cuh +3 -0
  1183. data/vendor/ggml/src/ggml-cuda/gated_delta_net.cu +311 -0
  1184. data/vendor/ggml/src/ggml-cuda/gated_delta_net.cuh +4 -0
  1185. data/vendor/ggml/src/ggml-cuda/getrows.cu +300 -0
  1186. data/vendor/ggml/src/ggml-cuda/getrows.cuh +15 -0
  1187. data/vendor/ggml/src/ggml-cuda/ggml-cuda.cu +5684 -0
  1188. data/vendor/ggml/src/ggml-cuda/gla.cu +93 -0
  1189. data/vendor/ggml/src/ggml-cuda/gla.cuh +3 -0
  1190. data/vendor/ggml/src/ggml-cuda/im2col.cu +267 -0
  1191. data/vendor/ggml/src/ggml-cuda/im2col.cuh +6 -0
  1192. data/vendor/ggml/src/ggml-cuda/mean.cu +75 -0
  1193. data/vendor/ggml/src/ggml-cuda/mean.cuh +3 -0
  1194. data/vendor/ggml/src/ggml-cuda/mma.cuh +1456 -0
  1195. data/vendor/ggml/src/ggml-cuda/mmf.cu +191 -0
  1196. data/vendor/ggml/src/ggml-cuda/mmf.cuh +908 -0
  1197. data/vendor/ggml/src/ggml-cuda/mmid.cu +164 -0
  1198. data/vendor/ggml/src/ggml-cuda/mmid.cuh +5 -0
  1199. data/vendor/ggml/src/ggml-cuda/mmq.cu +372 -0
  1200. data/vendor/ggml/src/ggml-cuda/mmq.cuh +4176 -0
  1201. data/vendor/ggml/src/ggml-cuda/mmvf.cu +862 -0
  1202. data/vendor/ggml/src/ggml-cuda/mmvf.cuh +14 -0
  1203. data/vendor/ggml/src/ggml-cuda/mmvq.cu +1161 -0
  1204. data/vendor/ggml/src/ggml-cuda/mmvq.cuh +16 -0
  1205. data/vendor/ggml/src/ggml-cuda/norm.cu +672 -0
  1206. data/vendor/ggml/src/ggml-cuda/norm.cuh +18 -0
  1207. data/vendor/ggml/src/ggml-cuda/opt-step-adamw.cu +78 -0
  1208. data/vendor/ggml/src/ggml-cuda/opt-step-adamw.cuh +5 -0
  1209. data/vendor/ggml/src/ggml-cuda/opt-step-sgd.cu +49 -0
  1210. data/vendor/ggml/src/ggml-cuda/opt-step-sgd.cuh +5 -0
  1211. data/vendor/ggml/src/ggml-cuda/out-prod.cu +84 -0
  1212. data/vendor/ggml/src/ggml-cuda/out-prod.cuh +3 -0
  1213. data/vendor/ggml/src/ggml-cuda/pad.cu +106 -0
  1214. data/vendor/ggml/src/ggml-cuda/pad.cuh +5 -0
  1215. data/vendor/ggml/src/ggml-cuda/pad_reflect_1d.cu +91 -0
  1216. data/vendor/ggml/src/ggml-cuda/pad_reflect_1d.cuh +5 -0
  1217. data/vendor/ggml/src/ggml-cuda/pool2d.cu +94 -0
  1218. data/vendor/ggml/src/ggml-cuda/pool2d.cuh +5 -0
  1219. data/vendor/ggml/src/ggml-cuda/quantize.cu +443 -0
  1220. data/vendor/ggml/src/ggml-cuda/quantize.cuh +41 -0
  1221. data/vendor/ggml/src/ggml-cuda/reduce_rows.cuh +39 -0
  1222. data/vendor/ggml/src/ggml-cuda/roll.cu +67 -0
  1223. data/vendor/ggml/src/ggml-cuda/roll.cuh +5 -0
  1224. data/vendor/ggml/src/ggml-cuda/rope.cu +665 -0
  1225. data/vendor/ggml/src/ggml-cuda/rope.cuh +9 -0
  1226. data/vendor/ggml/src/ggml-cuda/scale.cu +34 -0
  1227. data/vendor/ggml/src/ggml-cuda/scale.cuh +5 -0
  1228. data/vendor/ggml/src/ggml-cuda/set-rows.cu +330 -0
  1229. data/vendor/ggml/src/ggml-cuda/set-rows.cuh +7 -0
  1230. data/vendor/ggml/src/ggml-cuda/set.cu +39 -0
  1231. data/vendor/ggml/src/ggml-cuda/set.cuh +7 -0
  1232. data/vendor/ggml/src/ggml-cuda/snake.cu +72 -0
  1233. data/vendor/ggml/src/ggml-cuda/snake.cuh +8 -0
  1234. data/vendor/ggml/src/ggml-cuda/softcap.cu +34 -0
  1235. data/vendor/ggml/src/ggml-cuda/softcap.cuh +5 -0
  1236. data/vendor/ggml/src/ggml-cuda/softmax.cu +472 -0
  1237. data/vendor/ggml/src/ggml-cuda/softmax.cuh +7 -0
  1238. data/vendor/ggml/src/ggml-cuda/solve_tri.cu +275 -0
  1239. data/vendor/ggml/src/ggml-cuda/solve_tri.cuh +3 -0
  1240. data/vendor/ggml/src/ggml-cuda/ssm-conv.cu +197 -0
  1241. data/vendor/ggml/src/ggml-cuda/ssm-conv.cuh +3 -0
  1242. data/vendor/ggml/src/ggml-cuda/ssm-scan.cu +342 -0
  1243. data/vendor/ggml/src/ggml-cuda/ssm-scan.cuh +3 -0
  1244. data/vendor/ggml/src/ggml-cuda/sum.cu +41 -0
  1245. data/vendor/ggml/src/ggml-cuda/sum.cuh +5 -0
  1246. data/vendor/ggml/src/ggml-cuda/sumrows.cu +43 -0
  1247. data/vendor/ggml/src/ggml-cuda/sumrows.cuh +4 -0
  1248. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_1-ncols2_16.cu +6 -0
  1249. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_1-ncols2_32.cu +6 -0
  1250. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_1-ncols2_8.cu +12 -0
  1251. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_16-ncols2_1.cu +10 -0
  1252. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_16-ncols2_2.cu +10 -0
  1253. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_16-ncols2_4.cu +12 -0
  1254. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_16.cu +6 -0
  1255. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_32.cu +6 -0
  1256. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_4.cu +12 -0
  1257. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_8.cu +12 -0
  1258. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_32-ncols2_1.cu +10 -0
  1259. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_32-ncols2_2.cu +10 -0
  1260. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_16.cu +6 -0
  1261. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_2.cu +10 -0
  1262. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_4.cu +12 -0
  1263. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_8.cu +12 -0
  1264. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_64-ncols2_1.cu +10 -0
  1265. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_1.cu +10 -0
  1266. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_2.cu +10 -0
  1267. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_4.cu +12 -0
  1268. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_8.cu +12 -0
  1269. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq112-dv112.cu +5 -0
  1270. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq128-dv128.cu +5 -0
  1271. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq192-dv128.cu +5 -0
  1272. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq256-dv256.cu +5 -0
  1273. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq320-dv256.cu +5 -0
  1274. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq40-dv40.cu +5 -0
  1275. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq512-dv512.cu +5 -0
  1276. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq576-dv512.cu +5 -0
  1277. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq64-dv64.cu +5 -0
  1278. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq72-dv72.cu +5 -0
  1279. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq80-dv80.cu +5 -0
  1280. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq96-dv96.cu +5 -0
  1281. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-bf16-bf16.cu +7 -0
  1282. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-bf16-f16.cu +7 -0
  1283. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-bf16-q4_0.cu +7 -0
  1284. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-bf16-q4_1.cu +7 -0
  1285. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-bf16-q5_0.cu +7 -0
  1286. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-bf16-q5_1.cu +7 -0
  1287. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-bf16-q8_0.cu +7 -0
  1288. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-f16-bf16.cu +7 -0
  1289. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-f16-f16.cu +7 -0
  1290. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-f16-q4_0.cu +7 -0
  1291. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-f16-q4_1.cu +7 -0
  1292. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-f16-q5_0.cu +7 -0
  1293. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-f16-q5_1.cu +7 -0
  1294. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-f16-q8_0.cu +7 -0
  1295. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_0-bf16.cu +7 -0
  1296. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_0-f16.cu +7 -0
  1297. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_0-q4_0.cu +7 -0
  1298. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_0-q4_1.cu +7 -0
  1299. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_0-q5_0.cu +7 -0
  1300. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_0-q5_1.cu +7 -0
  1301. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_0-q8_0.cu +7 -0
  1302. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_1-bf16.cu +7 -0
  1303. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_1-f16.cu +7 -0
  1304. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_1-q4_0.cu +7 -0
  1305. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_1-q4_1.cu +7 -0
  1306. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_1-q5_0.cu +7 -0
  1307. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_1-q5_1.cu +7 -0
  1308. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_1-q8_0.cu +7 -0
  1309. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_0-bf16.cu +7 -0
  1310. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_0-f16.cu +7 -0
  1311. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_0-q4_0.cu +7 -0
  1312. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_0-q4_1.cu +7 -0
  1313. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_0-q5_0.cu +7 -0
  1314. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_0-q5_1.cu +7 -0
  1315. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_0-q8_0.cu +7 -0
  1316. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_1-bf16.cu +7 -0
  1317. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_1-f16.cu +7 -0
  1318. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_1-q4_0.cu +7 -0
  1319. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_1-q4_1.cu +7 -0
  1320. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_1-q5_0.cu +7 -0
  1321. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_1-q5_1.cu +7 -0
  1322. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_1-q8_0.cu +7 -0
  1323. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q8_0-bf16.cu +7 -0
  1324. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q8_0-f16.cu +7 -0
  1325. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q8_0-q4_0.cu +7 -0
  1326. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q8_0-q4_1.cu +7 -0
  1327. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q8_0-q5_0.cu +7 -0
  1328. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q8_0-q5_1.cu +7 -0
  1329. data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q8_0-q8_0.cu +7 -0
  1330. data/vendor/ggml/src/ggml-cuda/template-instances/generate_cu_files.py +110 -0
  1331. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_1.cu +5 -0
  1332. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_10.cu +5 -0
  1333. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_11.cu +5 -0
  1334. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_12.cu +5 -0
  1335. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_13.cu +5 -0
  1336. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_14.cu +5 -0
  1337. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_15.cu +5 -0
  1338. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_16.cu +5 -0
  1339. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_2.cu +5 -0
  1340. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_3.cu +5 -0
  1341. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_4.cu +5 -0
  1342. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_5.cu +5 -0
  1343. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_6.cu +5 -0
  1344. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_7.cu +5 -0
  1345. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_8.cu +5 -0
  1346. data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_9.cu +5 -0
  1347. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq1_s.cu +5 -0
  1348. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq2_s.cu +5 -0
  1349. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq2_xs.cu +5 -0
  1350. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq2_xxs.cu +5 -0
  1351. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq3_s.cu +5 -0
  1352. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq3_xxs.cu +5 -0
  1353. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq4_nl.cu +5 -0
  1354. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq4_xs.cu +5 -0
  1355. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-mxfp4.cu +5 -0
  1356. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-nvfp4.cu +5 -0
  1357. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q1_0.cu +5 -0
  1358. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q2_k.cu +5 -0
  1359. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q3_k.cu +5 -0
  1360. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q4_0.cu +5 -0
  1361. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q4_1.cu +5 -0
  1362. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q4_k.cu +5 -0
  1363. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q5_0.cu +5 -0
  1364. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q5_1.cu +5 -0
  1365. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q5_k.cu +5 -0
  1366. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q6_k.cu +5 -0
  1367. data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q8_0.cu +5 -0
  1368. data/vendor/ggml/src/ggml-cuda/top-k.cu +95 -0
  1369. data/vendor/ggml/src/ggml-cuda/top-k.cuh +3 -0
  1370. data/vendor/ggml/src/ggml-cuda/topk-moe.cu +415 -0
  1371. data/vendor/ggml/src/ggml-cuda/topk-moe.cuh +27 -0
  1372. data/vendor/ggml/src/ggml-cuda/tri.cu +136 -0
  1373. data/vendor/ggml/src/ggml-cuda/tri.cuh +5 -0
  1374. data/vendor/ggml/src/ggml-cuda/tsembd.cu +47 -0
  1375. data/vendor/ggml/src/ggml-cuda/tsembd.cuh +5 -0
  1376. data/vendor/ggml/src/ggml-cuda/unary.cu +640 -0
  1377. data/vendor/ggml/src/ggml-cuda/unary.cuh +114 -0
  1378. data/vendor/ggml/src/ggml-cuda/upscale.cu +293 -0
  1379. data/vendor/ggml/src/ggml-cuda/upscale.cuh +5 -0
  1380. data/vendor/ggml/src/ggml-cuda/vecdotq.cuh +1317 -0
  1381. data/vendor/ggml/src/ggml-cuda/vendors/cuda.h +28 -0
  1382. data/vendor/ggml/src/ggml-cuda/vendors/hip.h +304 -0
  1383. data/vendor/ggml/src/ggml-cuda/vendors/musa.h +150 -0
  1384. data/vendor/ggml/src/ggml-cuda/wkv.cu +199 -0
  1385. data/vendor/ggml/src/ggml-cuda/wkv.cuh +7 -0
  1386. data/vendor/ggml/src/ggml-hexagon/CMakeLists.txt +118 -0
  1387. data/vendor/ggml/src/ggml-hexagon/ggml-hexagon.cpp +3680 -0
  1388. data/vendor/ggml/src/ggml-hexagon/htp/CMakeLists.txt +78 -0
  1389. data/vendor/ggml/src/ggml-hexagon/htp/act-ops.c +782 -0
  1390. data/vendor/ggml/src/ggml-hexagon/htp/argsort-ops.c +293 -0
  1391. data/vendor/ggml/src/ggml-hexagon/htp/binary-ops.c +872 -0
  1392. data/vendor/ggml/src/ggml-hexagon/htp/cmake-toolchain.cmake +157 -0
  1393. data/vendor/ggml/src/ggml-hexagon/htp/cpy-ops.c +275 -0
  1394. data/vendor/ggml/src/ggml-hexagon/htp/cumsum-ops.c +270 -0
  1395. data/vendor/ggml/src/ggml-hexagon/htp/diag-ops.c +216 -0
  1396. data/vendor/ggml/src/ggml-hexagon/htp/fill-ops.c +123 -0
  1397. data/vendor/ggml/src/ggml-hexagon/htp/flash-attn-ops.c +727 -0
  1398. data/vendor/ggml/src/ggml-hexagon/htp/gated-delta-net-ops.c +955 -0
  1399. data/vendor/ggml/src/ggml-hexagon/htp/get-rows-ops.c +124 -0
  1400. data/vendor/ggml/src/ggml-hexagon/htp/hex-dma.c +63 -0
  1401. data/vendor/ggml/src/ggml-hexagon/htp/hex-dma.h +372 -0
  1402. data/vendor/ggml/src/ggml-hexagon/htp/hex-dump.h +86 -0
  1403. data/vendor/ggml/src/ggml-hexagon/htp/hex-fastdiv.h +37 -0
  1404. data/vendor/ggml/src/ggml-hexagon/htp/hex-utils.h +137 -0
  1405. data/vendor/ggml/src/ggml-hexagon/htp/hmx-flash-attn-ops.c +1841 -0
  1406. data/vendor/ggml/src/ggml-hexagon/htp/hmx-matmul-ops.c +1785 -0
  1407. data/vendor/ggml/src/ggml-hexagon/htp/hmx-ops.h +71 -0
  1408. data/vendor/ggml/src/ggml-hexagon/htp/hmx-profile.h +34 -0
  1409. data/vendor/ggml/src/ggml-hexagon/htp/hmx-queue.c +158 -0
  1410. data/vendor/ggml/src/ggml-hexagon/htp/hmx-queue.h +134 -0
  1411. data/vendor/ggml/src/ggml-hexagon/htp/hmx-utils.h +200 -0
  1412. data/vendor/ggml/src/ggml-hexagon/htp/htp-ctx.h +111 -0
  1413. data/vendor/ggml/src/ggml-hexagon/htp/htp-ops.h +181 -0
  1414. data/vendor/ggml/src/ggml-hexagon/htp/htp_iface.idl +22 -0
  1415. data/vendor/ggml/src/ggml-hexagon/htp/hvx-arith.h +443 -0
  1416. data/vendor/ggml/src/ggml-hexagon/htp/hvx-base.h +308 -0
  1417. data/vendor/ggml/src/ggml-hexagon/htp/hvx-copy.h +262 -0
  1418. data/vendor/ggml/src/ggml-hexagon/htp/hvx-div.h +291 -0
  1419. data/vendor/ggml/src/ggml-hexagon/htp/hvx-dump.h +129 -0
  1420. data/vendor/ggml/src/ggml-hexagon/htp/hvx-exp.h +216 -0
  1421. data/vendor/ggml/src/ggml-hexagon/htp/hvx-floor.h +100 -0
  1422. data/vendor/ggml/src/ggml-hexagon/htp/hvx-inverse.h +210 -0
  1423. data/vendor/ggml/src/ggml-hexagon/htp/hvx-reduce.h +296 -0
  1424. data/vendor/ggml/src/ggml-hexagon/htp/hvx-repl.h +74 -0
  1425. data/vendor/ggml/src/ggml-hexagon/htp/hvx-scale.h +133 -0
  1426. data/vendor/ggml/src/ggml-hexagon/htp/hvx-sigmoid.h +142 -0
  1427. data/vendor/ggml/src/ggml-hexagon/htp/hvx-sqrt.h +126 -0
  1428. data/vendor/ggml/src/ggml-hexagon/htp/hvx-types.h +36 -0
  1429. data/vendor/ggml/src/ggml-hexagon/htp/hvx-utils.h +19 -0
  1430. data/vendor/ggml/src/ggml-hexagon/htp/main.c +880 -0
  1431. data/vendor/ggml/src/ggml-hexagon/htp/matmul-ops.c +3173 -0
  1432. data/vendor/ggml/src/ggml-hexagon/htp/repeat-ops.c +148 -0
  1433. data/vendor/ggml/src/ggml-hexagon/htp/rope-ops.c +494 -0
  1434. data/vendor/ggml/src/ggml-hexagon/htp/set-rows-ops.c +184 -0
  1435. data/vendor/ggml/src/ggml-hexagon/htp/softmax-ops.c +407 -0
  1436. data/vendor/ggml/src/ggml-hexagon/htp/solve-tri-ops.c +267 -0
  1437. data/vendor/ggml/src/ggml-hexagon/htp/ssm-conv.c +340 -0
  1438. data/vendor/ggml/src/ggml-hexagon/htp/sum-rows-ops.c +128 -0
  1439. data/vendor/ggml/src/ggml-hexagon/htp/unary-ops.c +657 -0
  1440. data/vendor/ggml/src/ggml-hexagon/htp/vtcm-utils.h +16 -0
  1441. data/vendor/ggml/src/ggml-hexagon/htp/worker-pool.c +293 -0
  1442. data/vendor/ggml/src/ggml-hexagon/htp/worker-pool.h +57 -0
  1443. data/vendor/ggml/src/ggml-hexagon/htp-drv.cpp +418 -0
  1444. data/vendor/ggml/src/ggml-hexagon/htp-drv.h +121 -0
  1445. data/vendor/ggml/src/ggml-hexagon/libdl.h +79 -0
  1446. data/vendor/ggml/src/ggml-hexagon/libggml-htp.inf +40 -0
  1447. data/vendor/ggml/src/ggml-hexagon/op-desc.h +153 -0
  1448. data/vendor/ggml/src/ggml-hip/CMakeLists.txt +157 -0
  1449. data/vendor/ggml/src/ggml-impl.h +783 -0
  1450. data/vendor/ggml/src/ggml-metal/CMakeLists.txt +124 -0
  1451. data/vendor/ggml/src/ggml-metal/ggml-metal-common.cpp +457 -0
  1452. data/vendor/ggml/src/ggml-metal/ggml-metal-common.h +52 -0
  1453. data/vendor/ggml/src/ggml-metal/ggml-metal-context.h +41 -0
  1454. data/vendor/ggml/src/ggml-metal/ggml-metal-context.m +739 -0
  1455. data/vendor/ggml/src/ggml-metal/ggml-metal-device.cpp +2053 -0
  1456. data/vendor/ggml/src/ggml-metal/ggml-metal-device.h +296 -0
  1457. data/vendor/ggml/src/ggml-metal/ggml-metal-device.m +1829 -0
  1458. data/vendor/ggml/src/ggml-metal/ggml-metal-impl.h +1175 -0
  1459. data/vendor/ggml/src/ggml-metal/ggml-metal-ops.cpp +4606 -0
  1460. data/vendor/ggml/src/ggml-metal/ggml-metal-ops.h +97 -0
  1461. data/vendor/ggml/src/ggml-metal/ggml-metal.cpp +950 -0
  1462. data/vendor/ggml/src/ggml-metal/ggml-metal.metal +10679 -0
  1463. data/vendor/ggml/src/ggml-musa/CMakeLists.txt +124 -0
  1464. data/vendor/ggml/src/ggml-musa/mudnn.cu +112 -0
  1465. data/vendor/ggml/src/ggml-musa/mudnn.cuh +12 -0
  1466. data/vendor/ggml/src/ggml-opencl/CMakeLists.txt +189 -0
  1467. data/vendor/ggml/src/ggml-opencl/ggml-opencl.cpp +16374 -0
  1468. data/vendor/ggml/src/ggml-opencl/kernels/add.cl +190 -0
  1469. data/vendor/ggml/src/ggml-opencl/kernels/add_id.cl +42 -0
  1470. data/vendor/ggml/src/ggml-opencl/kernels/argsort.cl +86 -0
  1471. data/vendor/ggml/src/ggml-opencl/kernels/clamp.cl +20 -0
  1472. data/vendor/ggml/src/ggml-opencl/kernels/concat.cl +51 -0
  1473. data/vendor/ggml/src/ggml-opencl/kernels/conv2d.cl +185 -0
  1474. data/vendor/ggml/src/ggml-opencl/kernels/conv2d_f16_f32.cl +176 -0
  1475. data/vendor/ggml/src/ggml-opencl/kernels/cpy.cl +229 -0
  1476. data/vendor/ggml/src/ggml-opencl/kernels/cumsum.cl +139 -0
  1477. data/vendor/ggml/src/ggml-opencl/kernels/cvt.cl +1471 -0
  1478. data/vendor/ggml/src/ggml-opencl/kernels/diag.cl +27 -0
  1479. data/vendor/ggml/src/ggml-opencl/kernels/diag_mask_inf.cl +58 -0
  1480. data/vendor/ggml/src/ggml-opencl/kernels/div.cl +138 -0
  1481. data/vendor/ggml/src/ggml-opencl/kernels/embed_kernel.py +26 -0
  1482. data/vendor/ggml/src/ggml-opencl/kernels/exp.cl +125 -0
  1483. data/vendor/ggml/src/ggml-opencl/kernels/expm1.cl +113 -0
  1484. data/vendor/ggml/src/ggml-opencl/kernels/fill.cl +17 -0
  1485. data/vendor/ggml/src/ggml-opencl/kernels/flash_attn_f16.cl +370 -0
  1486. data/vendor/ggml/src/ggml-opencl/kernels/flash_attn_f32.cl +371 -0
  1487. data/vendor/ggml/src/ggml-opencl/kernels/flash_attn_f32_f16.cl +373 -0
  1488. data/vendor/ggml/src/ggml-opencl/kernels/gelu.cl +89 -0
  1489. data/vendor/ggml/src/ggml-opencl/kernels/gemm_moe_mxfp4_f32.cl +162 -0
  1490. data/vendor/ggml/src/ggml-opencl/kernels/gemm_moe_mxfp4_f32_ns.cl +302 -0
  1491. data/vendor/ggml/src/ggml-opencl/kernels/gemm_moe_q4_0_f32_ns.cl +252 -0
  1492. data/vendor/ggml/src/ggml-opencl/kernels/gemm_moe_q4_1_f32_ns.cl +254 -0
  1493. data/vendor/ggml/src/ggml-opencl/kernels/gemm_moe_q5_0_f32_ns.cl +256 -0
  1494. data/vendor/ggml/src/ggml-opencl/kernels/gemm_moe_q5_1_f32_ns.cl +258 -0
  1495. data/vendor/ggml/src/ggml-opencl/kernels/gemm_noshuffle_iq4_nl_f32.cl +150 -0
  1496. data/vendor/ggml/src/ggml-opencl/kernels/gemm_noshuffle_q4_0_f32.cl +139 -0
  1497. data/vendor/ggml/src/ggml-opencl/kernels/gemm_noshuffle_q4_1_f32.cl +132 -0
  1498. data/vendor/ggml/src/ggml-opencl/kernels/gemm_noshuffle_q4_k_f32.cl +172 -0
  1499. data/vendor/ggml/src/ggml-opencl/kernels/gemm_noshuffle_q5_k_f32.cl +176 -0
  1500. data/vendor/ggml/src/ggml-opencl/kernels/gemm_noshuffle_q6_k_f32.cl +140 -0
  1501. data/vendor/ggml/src/ggml-opencl/kernels/gemm_noshuffle_q8_0_f32.cl +129 -0
  1502. data/vendor/ggml/src/ggml-opencl/kernels/gemm_xmem_f16_f32_os8.cl +233 -0
  1503. data/vendor/ggml/src/ggml-opencl/kernels/gemv_moe_mxfp4_f32.cl +156 -0
  1504. data/vendor/ggml/src/ggml-opencl/kernels/gemv_moe_mxfp4_f32_ns.cl +161 -0
  1505. data/vendor/ggml/src/ggml-opencl/kernels/gemv_moe_q4_0_f32_ns.cl +116 -0
  1506. data/vendor/ggml/src/ggml-opencl/kernels/gemv_moe_q4_1_f32_ns.cl +119 -0
  1507. data/vendor/ggml/src/ggml-opencl/kernels/gemv_moe_q5_0_f32_ns.cl +119 -0
  1508. data/vendor/ggml/src/ggml-opencl/kernels/gemv_moe_q5_1_f32_ns.cl +121 -0
  1509. data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_iq4_nl_f32.cl +302 -0
  1510. data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_q4_0_f32.cl +274 -0
  1511. data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_q4_0_f32_spec.cl +268 -0
  1512. data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_q4_1_f32.cl +283 -0
  1513. data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_q4_k_f32.cl +318 -0
  1514. data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_q5_k_f32.cl +326 -0
  1515. data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_q6_k_f32.cl +293 -0
  1516. data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_q8_0_f32.cl +195 -0
  1517. data/vendor/ggml/src/ggml-opencl/kernels/get_rows.cl +187 -0
  1518. data/vendor/ggml/src/ggml-opencl/kernels/glu.cl +378 -0
  1519. data/vendor/ggml/src/ggml-opencl/kernels/group_norm.cl +121 -0
  1520. data/vendor/ggml/src/ggml-opencl/kernels/im2col_f16.cl +57 -0
  1521. data/vendor/ggml/src/ggml-opencl/kernels/im2col_f32.cl +57 -0
  1522. data/vendor/ggml/src/ggml-opencl/kernels/l2_norm.cl +71 -0
  1523. data/vendor/ggml/src/ggml-opencl/kernels/mean.cl +140 -0
  1524. data/vendor/ggml/src/ggml-opencl/kernels/moe_reorder_b.cl +30 -0
  1525. data/vendor/ggml/src/ggml-opencl/kernels/moe_sort_by_expert.cl +82 -0
  1526. data/vendor/ggml/src/ggml-opencl/kernels/mul.cl +152 -0
  1527. data/vendor/ggml/src/ggml-opencl/kernels/mul_mat_f16_f32.cl +130 -0
  1528. data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_f16_f32_kq_kqv.cl +273 -0
  1529. data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_f16_f32_l4_lm.cl +146 -0
  1530. data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_f32_f32_l4_lm.cl +147 -0
  1531. data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_iq4_nl_f32_l4_lm.cl +171 -0
  1532. data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_q4_0_f32_l4_lm.cl +163 -0
  1533. data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_q4_1_f32_l4_lm.cl +165 -0
  1534. data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_q4_k_f32_l4_lm.cl +179 -0
  1535. data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_q5_k_f32_l4_lm.cl +192 -0
  1536. data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_q6_k_f32_l4_lm.cl +158 -0
  1537. data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_q8_0_f32_l4_lm.cl +154 -0
  1538. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_f16_f16.cl +118 -0
  1539. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_f16_f32.cl +118 -0
  1540. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_f16_f32_1row.cl +94 -0
  1541. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_f16_f32_l4.cl +84 -0
  1542. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_f32_f32.cl +118 -0
  1543. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_id_mxfp4_f32.cl +189 -0
  1544. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_id_mxfp4_f32_flat.cl +176 -0
  1545. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_id_q4_0_f32_8x_flat.cl +283 -0
  1546. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_id_q8_0_f32.cl +140 -0
  1547. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_id_q8_0_f32_flat.cl +222 -0
  1548. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_iq4_nl_f32.cl +164 -0
  1549. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_iq4_nl_f32_flat.cl +202 -0
  1550. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_mxfp4_f32.cl +144 -0
  1551. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_mxfp4_f32_flat.cl +167 -0
  1552. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32.cl +192 -0
  1553. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_1d_16x_flat.cl +307 -0
  1554. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_1d_8x_flat.cl +265 -0
  1555. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_8x_flat.cl +272 -0
  1556. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_v.cl +254 -0
  1557. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_1_f32.cl +219 -0
  1558. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_1_f32_flat.cl +229 -0
  1559. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_k_f32.cl +180 -0
  1560. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_k_f32_flat.cl +196 -0
  1561. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q5_k_f32.cl +187 -0
  1562. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q5_k_f32_flat.cl +203 -0
  1563. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q6_k_f32.cl +194 -0
  1564. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q6_k_f32_flat.cl +194 -0
  1565. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q8_0_f32.cl +125 -0
  1566. data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q8_0_f32_flat.cl +202 -0
  1567. data/vendor/ggml/src/ggml-opencl/kernels/neg.cl +125 -0
  1568. data/vendor/ggml/src/ggml-opencl/kernels/norm.cl +161 -0
  1569. data/vendor/ggml/src/ggml-opencl/kernels/pad.cl +39 -0
  1570. data/vendor/ggml/src/ggml-opencl/kernels/relu.cl +16 -0
  1571. data/vendor/ggml/src/ggml-opencl/kernels/repeat.cl +38 -0
  1572. data/vendor/ggml/src/ggml-opencl/kernels/rms_norm.cl +190 -0
  1573. data/vendor/ggml/src/ggml-opencl/kernels/rope.cl +747 -0
  1574. data/vendor/ggml/src/ggml-opencl/kernels/scale.cl +27 -0
  1575. data/vendor/ggml/src/ggml-opencl/kernels/set_rows.cl +208 -0
  1576. data/vendor/ggml/src/ggml-opencl/kernels/sigmoid.cl +29 -0
  1577. data/vendor/ggml/src/ggml-opencl/kernels/silu.cl +30 -0
  1578. data/vendor/ggml/src/ggml-opencl/kernels/softmax_4_f16.cl +108 -0
  1579. data/vendor/ggml/src/ggml-opencl/kernels/softmax_4_f32.cl +108 -0
  1580. data/vendor/ggml/src/ggml-opencl/kernels/softmax_f16.cl +107 -0
  1581. data/vendor/ggml/src/ggml-opencl/kernels/softmax_f32.cl +107 -0
  1582. data/vendor/ggml/src/ggml-opencl/kernels/softplus.cl +116 -0
  1583. data/vendor/ggml/src/ggml-opencl/kernels/solve_tri.cl +51 -0
  1584. data/vendor/ggml/src/ggml-opencl/kernels/sqr.cl +53 -0
  1585. data/vendor/ggml/src/ggml-opencl/kernels/sqrt.cl +53 -0
  1586. data/vendor/ggml/src/ggml-opencl/kernels/ssm_conv.cl +77 -0
  1587. data/vendor/ggml/src/ggml-opencl/kernels/sub.cl +138 -0
  1588. data/vendor/ggml/src/ggml-opencl/kernels/sum_rows.cl +140 -0
  1589. data/vendor/ggml/src/ggml-opencl/kernels/tanh.cl +109 -0
  1590. data/vendor/ggml/src/ggml-opencl/kernels/transpose.cl +143 -0
  1591. data/vendor/ggml/src/ggml-opencl/kernels/tri.cl +32 -0
  1592. data/vendor/ggml/src/ggml-opencl/kernels/tsembd.cl +48 -0
  1593. data/vendor/ggml/src/ggml-opencl/kernels/upscale.cl +120 -0
  1594. data/vendor/ggml/src/ggml-openvino/CMakeLists.txt +22 -0
  1595. data/vendor/ggml/src/ggml-openvino/ggml-decoder.cpp +985 -0
  1596. data/vendor/ggml/src/ggml-openvino/ggml-decoder.h +294 -0
  1597. data/vendor/ggml/src/ggml-openvino/ggml-openvino-extra.cpp +380 -0
  1598. data/vendor/ggml/src/ggml-openvino/ggml-openvino-extra.h +182 -0
  1599. data/vendor/ggml/src/ggml-openvino/ggml-openvino.cpp +1132 -0
  1600. data/vendor/ggml/src/ggml-openvino/ggml-quants.cpp +956 -0
  1601. data/vendor/ggml/src/ggml-openvino/ggml-quants.h +153 -0
  1602. data/vendor/ggml/src/ggml-openvino/openvino/decoder.h +74 -0
  1603. data/vendor/ggml/src/ggml-openvino/openvino/frontend.cpp +27 -0
  1604. data/vendor/ggml/src/ggml-openvino/openvino/frontend.h +23 -0
  1605. data/vendor/ggml/src/ggml-openvino/openvino/input_model.cpp +17 -0
  1606. data/vendor/ggml/src/ggml-openvino/openvino/input_model.h +29 -0
  1607. data/vendor/ggml/src/ggml-openvino/openvino/node_context.h +112 -0
  1608. data/vendor/ggml/src/ggml-openvino/openvino/op/cont.cpp +48 -0
  1609. data/vendor/ggml/src/ggml-openvino/openvino/op/cpy.cpp +21 -0
  1610. data/vendor/ggml/src/ggml-openvino/openvino/op/flash_attn_ext.cpp +90 -0
  1611. data/vendor/ggml/src/ggml-openvino/openvino/op/get_rows.cpp +69 -0
  1612. data/vendor/ggml/src/ggml-openvino/openvino/op/glu_geglu.cpp +61 -0
  1613. data/vendor/ggml/src/ggml-openvino/openvino/op/glu_swiglu.cpp +62 -0
  1614. data/vendor/ggml/src/ggml-openvino/openvino/op/mulmat.cpp +90 -0
  1615. data/vendor/ggml/src/ggml-openvino/openvino/op/permute.cpp +102 -0
  1616. data/vendor/ggml/src/ggml-openvino/openvino/op/reshape.cpp +83 -0
  1617. data/vendor/ggml/src/ggml-openvino/openvino/op/rms_norm.cpp +46 -0
  1618. data/vendor/ggml/src/ggml-openvino/openvino/op/rope.cpp +149 -0
  1619. data/vendor/ggml/src/ggml-openvino/openvino/op/scale.cpp +41 -0
  1620. data/vendor/ggml/src/ggml-openvino/openvino/op/set_rows.cpp +76 -0
  1621. data/vendor/ggml/src/ggml-openvino/openvino/op/softmax.cpp +89 -0
  1622. data/vendor/ggml/src/ggml-openvino/openvino/op/transpose.cpp +23 -0
  1623. data/vendor/ggml/src/ggml-openvino/openvino/op/unary_gelu.cpp +25 -0
  1624. data/vendor/ggml/src/ggml-openvino/openvino/op/unary_silu.cpp +27 -0
  1625. data/vendor/ggml/src/ggml-openvino/openvino/op/view.cpp +53 -0
  1626. data/vendor/ggml/src/ggml-openvino/openvino/op_table.cpp +47 -0
  1627. data/vendor/ggml/src/ggml-openvino/openvino/op_table.h +40 -0
  1628. data/vendor/ggml/src/ggml-openvino/openvino/pass/fuse_to_sdpa.cpp +60 -0
  1629. data/vendor/ggml/src/ggml-openvino/openvino/pass/fuse_to_sdpa.h +17 -0
  1630. data/vendor/ggml/src/ggml-openvino/openvino/pass/mark_decompression_convert_constant_folding.h +29 -0
  1631. data/vendor/ggml/src/ggml-openvino/openvino/pass/squeeze_matmul.cpp +58 -0
  1632. data/vendor/ggml/src/ggml-openvino/openvino/pass/squeeze_matmul.h +17 -0
  1633. data/vendor/ggml/src/ggml-openvino/openvino/rt_info/weightless_caching_attributes.hpp +41 -0
  1634. data/vendor/ggml/src/ggml-openvino/openvino/translate_session.cpp +317 -0
  1635. data/vendor/ggml/src/ggml-openvino/openvino/translate_session.h +28 -0
  1636. data/vendor/ggml/src/ggml-openvino/openvino/utils.cpp +257 -0
  1637. data/vendor/ggml/src/ggml-openvino/openvino/utils.h +86 -0
  1638. data/vendor/ggml/src/ggml-openvino/utils.cpp +880 -0
  1639. data/vendor/ggml/src/ggml-openvino/utils.h +143 -0
  1640. data/vendor/ggml/src/ggml-opt.cpp +1094 -0
  1641. data/vendor/ggml/src/ggml-quants.c +5491 -0
  1642. data/vendor/ggml/src/ggml-quants.h +112 -0
  1643. data/vendor/ggml/src/ggml-rpc/CMakeLists.txt +33 -0
  1644. data/vendor/ggml/src/ggml-rpc/ggml-rpc.cpp +1974 -0
  1645. data/vendor/ggml/src/ggml-rpc/transport.cpp +683 -0
  1646. data/vendor/ggml/src/ggml-rpc/transport.h +34 -0
  1647. data/vendor/ggml/src/ggml-sycl/CMakeLists.txt +207 -0
  1648. data/vendor/ggml/src/ggml-sycl/add-id.cpp +81 -0
  1649. data/vendor/ggml/src/ggml-sycl/add-id.hpp +8 -0
  1650. data/vendor/ggml/src/ggml-sycl/backend.hpp +48 -0
  1651. data/vendor/ggml/src/ggml-sycl/binbcast.cpp +346 -0
  1652. data/vendor/ggml/src/ggml-sycl/binbcast.hpp +39 -0
  1653. data/vendor/ggml/src/ggml-sycl/common.cpp +155 -0
  1654. data/vendor/ggml/src/ggml-sycl/common.hpp +1002 -0
  1655. data/vendor/ggml/src/ggml-sycl/concat.cpp +202 -0
  1656. data/vendor/ggml/src/ggml-sycl/concat.hpp +20 -0
  1657. data/vendor/ggml/src/ggml-sycl/conv.cpp +101 -0
  1658. data/vendor/ggml/src/ggml-sycl/conv.hpp +20 -0
  1659. data/vendor/ggml/src/ggml-sycl/convert.cpp +825 -0
  1660. data/vendor/ggml/src/ggml-sycl/convert.hpp +64 -0
  1661. data/vendor/ggml/src/ggml-sycl/count-equal.cpp +79 -0
  1662. data/vendor/ggml/src/ggml-sycl/count-equal.hpp +9 -0
  1663. data/vendor/ggml/src/ggml-sycl/cpy.cpp +602 -0
  1664. data/vendor/ggml/src/ggml-sycl/cpy.hpp +223 -0
  1665. data/vendor/ggml/src/ggml-sycl/cumsum.cpp +148 -0
  1666. data/vendor/ggml/src/ggml-sycl/cumsum.hpp +5 -0
  1667. data/vendor/ggml/src/ggml-sycl/dequantize.hpp +975 -0
  1668. data/vendor/ggml/src/ggml-sycl/diag.cpp +67 -0
  1669. data/vendor/ggml/src/ggml-sycl/diag.hpp +5 -0
  1670. data/vendor/ggml/src/ggml-sycl/dmmv.cpp +1579 -0
  1671. data/vendor/ggml/src/ggml-sycl/dmmv.hpp +27 -0
  1672. data/vendor/ggml/src/ggml-sycl/dpct/helper.hpp +3774 -0
  1673. data/vendor/ggml/src/ggml-sycl/element_wise.cpp +1124 -0
  1674. data/vendor/ggml/src/ggml-sycl/element_wise.hpp +94 -0
  1675. data/vendor/ggml/src/ggml-sycl/fattn-buffers.cpp +56 -0
  1676. data/vendor/ggml/src/ggml-sycl/fattn-buffers.hpp +63 -0
  1677. data/vendor/ggml/src/ggml-sycl/fattn-common.hpp +1181 -0
  1678. data/vendor/ggml/src/ggml-sycl/fattn-tile.cpp +59 -0
  1679. data/vendor/ggml/src/ggml-sycl/fattn-tile.hpp +1246 -0
  1680. data/vendor/ggml/src/ggml-sycl/fattn-vec.hpp +674 -0
  1681. data/vendor/ggml/src/ggml-sycl/fattn.cpp +227 -0
  1682. data/vendor/ggml/src/ggml-sycl/fattn.hpp +22 -0
  1683. data/vendor/ggml/src/ggml-sycl/fill.cpp +55 -0
  1684. data/vendor/ggml/src/ggml-sycl/fill.hpp +5 -0
  1685. data/vendor/ggml/src/ggml-sycl/gated_delta_net.cpp +307 -0
  1686. data/vendor/ggml/src/ggml-sycl/gated_delta_net.hpp +9 -0
  1687. data/vendor/ggml/src/ggml-sycl/gemm.hpp +93 -0
  1688. data/vendor/ggml/src/ggml-sycl/getrows.cpp +219 -0
  1689. data/vendor/ggml/src/ggml-sycl/getrows.hpp +20 -0
  1690. data/vendor/ggml/src/ggml-sycl/ggml-sycl.cpp +5520 -0
  1691. data/vendor/ggml/src/ggml-sycl/gla.cpp +106 -0
  1692. data/vendor/ggml/src/ggml-sycl/gla.hpp +8 -0
  1693. data/vendor/ggml/src/ggml-sycl/im2col.cpp +400 -0
  1694. data/vendor/ggml/src/ggml-sycl/im2col.hpp +23 -0
  1695. data/vendor/ggml/src/ggml-sycl/mmq.cpp +3030 -0
  1696. data/vendor/ggml/src/ggml-sycl/mmq.hpp +33 -0
  1697. data/vendor/ggml/src/ggml-sycl/mmvq.cpp +1380 -0
  1698. data/vendor/ggml/src/ggml-sycl/mmvq.hpp +43 -0
  1699. data/vendor/ggml/src/ggml-sycl/norm.cpp +656 -0
  1700. data/vendor/ggml/src/ggml-sycl/norm.hpp +28 -0
  1701. data/vendor/ggml/src/ggml-sycl/outprod.cpp +47 -0
  1702. data/vendor/ggml/src/ggml-sycl/outprod.hpp +10 -0
  1703. data/vendor/ggml/src/ggml-sycl/pad.cpp +97 -0
  1704. data/vendor/ggml/src/ggml-sycl/pad.hpp +24 -0
  1705. data/vendor/ggml/src/ggml-sycl/pad_reflect_1d.cpp +100 -0
  1706. data/vendor/ggml/src/ggml-sycl/pad_reflect_1d.hpp +10 -0
  1707. data/vendor/ggml/src/ggml-sycl/presets.hpp +79 -0
  1708. data/vendor/ggml/src/ggml-sycl/quantize.hpp +133 -0
  1709. data/vendor/ggml/src/ggml-sycl/quants.hpp +156 -0
  1710. data/vendor/ggml/src/ggml-sycl/repeat_back.cpp +76 -0
  1711. data/vendor/ggml/src/ggml-sycl/repeat_back.hpp +8 -0
  1712. data/vendor/ggml/src/ggml-sycl/roll.cpp +122 -0
  1713. data/vendor/ggml/src/ggml-sycl/roll.hpp +20 -0
  1714. data/vendor/ggml/src/ggml-sycl/rope.cpp +641 -0
  1715. data/vendor/ggml/src/ggml-sycl/rope.hpp +26 -0
  1716. data/vendor/ggml/src/ggml-sycl/set.cpp +73 -0
  1717. data/vendor/ggml/src/ggml-sycl/set.hpp +5 -0
  1718. data/vendor/ggml/src/ggml-sycl/set_rows.cpp +240 -0
  1719. data/vendor/ggml/src/ggml-sycl/set_rows.hpp +8 -0
  1720. data/vendor/ggml/src/ggml-sycl/softmax.cpp +426 -0
  1721. data/vendor/ggml/src/ggml-sycl/softmax.hpp +24 -0
  1722. data/vendor/ggml/src/ggml-sycl/solve_tri.cpp +172 -0
  1723. data/vendor/ggml/src/ggml-sycl/solve_tri.hpp +8 -0
  1724. data/vendor/ggml/src/ggml-sycl/ssm_conv.cpp +132 -0
  1725. data/vendor/ggml/src/ggml-sycl/ssm_conv.hpp +5 -0
  1726. data/vendor/ggml/src/ggml-sycl/ssm_scan.cpp +156 -0
  1727. data/vendor/ggml/src/ggml-sycl/ssm_scan.hpp +5 -0
  1728. data/vendor/ggml/src/ggml-sycl/sycl_hw.cpp +67 -0
  1729. data/vendor/ggml/src/ggml-sycl/sycl_hw.hpp +38 -0
  1730. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq112-dv112.cpp +5 -0
  1731. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq128-dv128.cpp +5 -0
  1732. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq256-dv256.cpp +5 -0
  1733. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq40-dv40.cpp +5 -0
  1734. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq512-dv512.cpp +6 -0
  1735. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq576-dv512.cpp +5 -0
  1736. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq64-dv64.cpp +5 -0
  1737. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq72-dv72.cpp +5 -0
  1738. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq80-dv80.cpp +5 -0
  1739. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq96-dv96.cpp +5 -0
  1740. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-f16-f16.cpp +8 -0
  1741. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-f16-q4_0.cpp +8 -0
  1742. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-f16-q4_1.cpp +8 -0
  1743. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-f16-q5_0.cpp +8 -0
  1744. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-f16-q5_1.cpp +8 -0
  1745. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-f16-q8_0.cpp +8 -0
  1746. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_0-f16.cpp +8 -0
  1747. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_0-q4_0.cpp +8 -0
  1748. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_0-q4_1.cpp +8 -0
  1749. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_0-q5_0.cpp +8 -0
  1750. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_0-q5_1.cpp +8 -0
  1751. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_0-q8_0.cpp +8 -0
  1752. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_1-f16.cpp +8 -0
  1753. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_1-q4_0.cpp +8 -0
  1754. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_1-q4_1.cpp +8 -0
  1755. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_1-q5_0.cpp +8 -0
  1756. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_1-q5_1.cpp +8 -0
  1757. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_1-q8_0.cpp +8 -0
  1758. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_0-f16.cpp +8 -0
  1759. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_0-q4_0.cpp +8 -0
  1760. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_0-q4_1.cpp +8 -0
  1761. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_0-q5_0.cpp +8 -0
  1762. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_0-q5_1.cpp +8 -0
  1763. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_0-q8_0.cpp +8 -0
  1764. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_1-f16.cpp +8 -0
  1765. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_1-q4_0.cpp +8 -0
  1766. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_1-q4_1.cpp +8 -0
  1767. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_1-q5_0.cpp +8 -0
  1768. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_1-q5_1.cpp +8 -0
  1769. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_1-q8_0.cpp +8 -0
  1770. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q8_0-f16.cpp +8 -0
  1771. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q8_0-q4_0.cpp +8 -0
  1772. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q8_0-q4_1.cpp +8 -0
  1773. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q8_0-q5_0.cpp +8 -0
  1774. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q8_0-q5_1.cpp +8 -0
  1775. data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q8_0-q8_0.cpp +8 -0
  1776. data/vendor/ggml/src/ggml-sycl/tsembd.cpp +73 -0
  1777. data/vendor/ggml/src/ggml-sycl/tsembd.hpp +20 -0
  1778. data/vendor/ggml/src/ggml-sycl/type.hpp +112 -0
  1779. data/vendor/ggml/src/ggml-sycl/upscale.cpp +410 -0
  1780. data/vendor/ggml/src/ggml-sycl/upscale.hpp +9 -0
  1781. data/vendor/ggml/src/ggml-sycl/vecdotq.hpp +1508 -0
  1782. data/vendor/ggml/src/ggml-sycl/wkv.cpp +293 -0
  1783. data/vendor/ggml/src/ggml-sycl/wkv.hpp +10 -0
  1784. data/vendor/ggml/src/ggml-threading.cpp +12 -0
  1785. data/vendor/ggml/src/ggml-threading.h +14 -0
  1786. data/vendor/ggml/src/ggml-virtgpu/CMakeLists.txt +70 -0
  1787. data/vendor/ggml/src/ggml-virtgpu/apir_cs_ggml-rpc-front.cpp +87 -0
  1788. data/vendor/ggml/src/ggml-virtgpu/backend/CMakeLists.txt +21 -0
  1789. data/vendor/ggml/src/ggml-virtgpu/backend/apir_cs_ggml-rpc-back.cpp +115 -0
  1790. data/vendor/ggml/src/ggml-virtgpu/backend/backend-convert.h +13 -0
  1791. data/vendor/ggml/src/ggml-virtgpu/backend/backend-dispatched-backend.cpp +102 -0
  1792. data/vendor/ggml/src/ggml-virtgpu/backend/backend-dispatched-buffer-type.cpp +105 -0
  1793. data/vendor/ggml/src/ggml-virtgpu/backend/backend-dispatched-buffer.cpp +179 -0
  1794. data/vendor/ggml/src/ggml-virtgpu/backend/backend-dispatched-device.cpp +148 -0
  1795. data/vendor/ggml/src/ggml-virtgpu/backend/backend-dispatched.cpp +51 -0
  1796. data/vendor/ggml/src/ggml-virtgpu/backend/backend-dispatched.gen.h +73 -0
  1797. data/vendor/ggml/src/ggml-virtgpu/backend/backend-dispatched.h +27 -0
  1798. data/vendor/ggml/src/ggml-virtgpu/backend/backend-virgl-apir.h +32 -0
  1799. data/vendor/ggml/src/ggml-virtgpu/backend/backend.cpp +144 -0
  1800. data/vendor/ggml/src/ggml-virtgpu/backend/shared/api_remoting.h +95 -0
  1801. data/vendor/ggml/src/ggml-virtgpu/backend/shared/apir_backend.gen.h +94 -0
  1802. data/vendor/ggml/src/ggml-virtgpu/backend/shared/apir_backend.h +50 -0
  1803. data/vendor/ggml/src/ggml-virtgpu/backend/shared/apir_cs.h +378 -0
  1804. data/vendor/ggml/src/ggml-virtgpu/backend/shared/apir_cs_ggml.h +232 -0
  1805. data/vendor/ggml/src/ggml-virtgpu/backend/shared/apir_cs_rpc.h +58 -0
  1806. data/vendor/ggml/src/ggml-virtgpu/ggml-backend-buffer-type.cpp +81 -0
  1807. data/vendor/ggml/src/ggml-virtgpu/ggml-backend-buffer.cpp +123 -0
  1808. data/vendor/ggml/src/ggml-virtgpu/ggml-backend-device.cpp +160 -0
  1809. data/vendor/ggml/src/ggml-virtgpu/ggml-backend-reg.cpp +213 -0
  1810. data/vendor/ggml/src/ggml-virtgpu/ggml-backend.cpp +71 -0
  1811. data/vendor/ggml/src/ggml-virtgpu/ggml-remoting.h +71 -0
  1812. data/vendor/ggml/src/ggml-virtgpu/ggmlremoting_functions.yaml +166 -0
  1813. data/vendor/ggml/src/ggml-virtgpu/include/apir_hw.h +9 -0
  1814. data/vendor/ggml/src/ggml-virtgpu/regenerate_remoting.py +333 -0
  1815. data/vendor/ggml/src/ggml-virtgpu/virtgpu-apir.h +15 -0
  1816. data/vendor/ggml/src/ggml-virtgpu/virtgpu-forward-backend.cpp +58 -0
  1817. data/vendor/ggml/src/ggml-virtgpu/virtgpu-forward-buffer-type.cpp +110 -0
  1818. data/vendor/ggml/src/ggml-virtgpu/virtgpu-forward-buffer.cpp +173 -0
  1819. data/vendor/ggml/src/ggml-virtgpu/virtgpu-forward-device.cpp +192 -0
  1820. data/vendor/ggml/src/ggml-virtgpu/virtgpu-forward-impl.h +36 -0
  1821. data/vendor/ggml/src/ggml-virtgpu/virtgpu-forward.gen.h +53 -0
  1822. data/vendor/ggml/src/ggml-virtgpu/virtgpu-shm.cpp +99 -0
  1823. data/vendor/ggml/src/ggml-virtgpu/virtgpu-shm.h +23 -0
  1824. data/vendor/ggml/src/ggml-virtgpu/virtgpu-utils.cpp +179 -0
  1825. data/vendor/ggml/src/ggml-virtgpu/virtgpu-utils.h +86 -0
  1826. data/vendor/ggml/src/ggml-virtgpu/virtgpu.cpp +545 -0
  1827. data/vendor/ggml/src/ggml-virtgpu/virtgpu.h +115 -0
  1828. data/vendor/ggml/src/ggml-vulkan/CMakeLists.txt +220 -0
  1829. data/vendor/ggml/src/ggml-vulkan/cmake/host-toolchain.cmake.in +15 -0
  1830. data/vendor/ggml/src/ggml-vulkan/ggml-vulkan.cpp +17208 -0
  1831. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/CMakeLists.txt +31 -0
  1832. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/abs.comp +21 -0
  1833. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/acc.comp +37 -0
  1834. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/add.comp +69 -0
  1835. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/add1.comp +28 -0
  1836. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/add_id.comp +42 -0
  1837. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/arange.comp +20 -0
  1838. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/argmax.comp +60 -0
  1839. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/argsort.comp +86 -0
  1840. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/argsort_large.comp +114 -0
  1841. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/ceil.comp +22 -0
  1842. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/clamp.comp +17 -0
  1843. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/concat.comp +41 -0
  1844. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/contig_copy.comp +49 -0
  1845. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/conv2d_dw.comp +105 -0
  1846. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/conv2d_mm.comp +347 -0
  1847. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/conv_transpose_1d.comp +98 -0
  1848. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/copy.comp +23 -0
  1849. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/copy_from_quant.comp +51 -0
  1850. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/copy_to_quant.comp +320 -0
  1851. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/copy_transpose.comp +67 -0
  1852. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/cos.comp +17 -0
  1853. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/count_equal.comp +31 -0
  1854. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/count_experts.comp +51 -0
  1855. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/cumsum.comp +83 -0
  1856. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/cumsum_multipass1.comp +60 -0
  1857. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/cumsum_multipass2.comp +66 -0
  1858. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_f32.comp +20 -0
  1859. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_funcs.glsl +653 -0
  1860. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_funcs_cm2.glsl +768 -0
  1861. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_head.glsl +13 -0
  1862. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq1_m.comp +42 -0
  1863. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq1_s.comp +35 -0
  1864. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq2_s.comp +44 -0
  1865. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq2_xs.comp +43 -0
  1866. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq2_xxs.comp +49 -0
  1867. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq3_s.comp +40 -0
  1868. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq3_xxs.comp +51 -0
  1869. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq4_nl.comp +32 -0
  1870. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq4_xs.comp +34 -0
  1871. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_mxfp4.comp +32 -0
  1872. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_nvfp4.comp +32 -0
  1873. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q1_0.comp +29 -0
  1874. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q2_k.comp +34 -0
  1875. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q3_k.comp +42 -0
  1876. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q4_0.comp +30 -0
  1877. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q4_1.comp +32 -0
  1878. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q4_k.comp +68 -0
  1879. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q5_0.comp +34 -0
  1880. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q5_1.comp +35 -0
  1881. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q5_k.comp +70 -0
  1882. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q6_k.comp +33 -0
  1883. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q8_0.comp +31 -0
  1884. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/diag.comp +28 -0
  1885. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/diag_mask_inf.comp +34 -0
  1886. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/div.comp +27 -0
  1887. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/elu.comp +27 -0
  1888. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/exp.comp +20 -0
  1889. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/feature-tests/bfloat16.comp +7 -0
  1890. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/feature-tests/coopmat.comp +7 -0
  1891. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/feature-tests/coopmat2.comp +7 -0
  1892. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/feature-tests/integer_dot.comp +7 -0
  1893. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/fill.comp +19 -0
  1894. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn.comp +756 -0
  1895. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_base.glsl +255 -0
  1896. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_cm1.comp +626 -0
  1897. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_cm2.comp +427 -0
  1898. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_dequant.glsl +123 -0
  1899. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_mask_opt.comp +162 -0
  1900. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_mmq_funcs.glsl +203 -0
  1901. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_split_k_reduce.comp +121 -0
  1902. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/floor.comp +22 -0
  1903. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/gated_delta_net.comp +190 -0
  1904. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/geglu.comp +13 -0
  1905. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/geglu_erf.comp +27 -0
  1906. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/geglu_quick.comp +11 -0
  1907. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/gelu.comp +25 -0
  1908. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/gelu_erf.comp +39 -0
  1909. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/gelu_quick.comp +23 -0
  1910. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/generic_binary_head.glsl +65 -0
  1911. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/generic_head.glsl +11 -0
  1912. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/generic_unary_head.glsl +83 -0
  1913. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/get_rows.comp +42 -0
  1914. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/get_rows_quant.comp +51 -0
  1915. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/glu_head.glsl +28 -0
  1916. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/glu_main.glsl +39 -0
  1917. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/group_norm.comp +66 -0
  1918. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/hardsigmoid.comp +22 -0
  1919. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/hardswish.comp +22 -0
  1920. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/im2col.comp +93 -0
  1921. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/im2col_3d.comp +124 -0
  1922. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/l2_norm.comp +44 -0
  1923. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/leaky_relu.comp +22 -0
  1924. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/log.comp +17 -0
  1925. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul.comp +27 -0
  1926. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_split_k_reduce.comp +48 -0
  1927. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec.comp +169 -0
  1928. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_base.glsl +230 -0
  1929. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iface.glsl +35 -0
  1930. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq1_m.comp +132 -0
  1931. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq1_s.comp +95 -0
  1932. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq2_s.comp +90 -0
  1933. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq2_xs.comp +105 -0
  1934. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq2_xxs.comp +87 -0
  1935. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq3_s.comp +90 -0
  1936. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq3_xxs.comp +88 -0
  1937. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_nc.comp +124 -0
  1938. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_p021.comp +156 -0
  1939. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q2_k.comp +128 -0
  1940. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q3_k.comp +132 -0
  1941. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q4_k.comp +134 -0
  1942. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q5_k.comp +165 -0
  1943. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q6_k.comp +130 -0
  1944. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vecq.comp +143 -0
  1945. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vecq_funcs.glsl +503 -0
  1946. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mm.comp +464 -0
  1947. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mm_cm2.comp +624 -0
  1948. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mm_funcs.glsl +600 -0
  1949. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mm_id_funcs.glsl +74 -0
  1950. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mmq.comp +311 -0
  1951. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mmq_funcs.glsl +454 -0
  1952. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mmq_shmem_types.glsl +93 -0
  1953. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/multi_add.comp +194 -0
  1954. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/neg.comp +20 -0
  1955. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/norm.comp +44 -0
  1956. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/opt_step_adamw.comp +42 -0
  1957. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/opt_step_sgd.comp +22 -0
  1958. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/pad.comp +64 -0
  1959. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/pool2d.comp +74 -0
  1960. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/quantize_q8_1.comp +127 -0
  1961. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/reglu.comp +9 -0
  1962. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/relu.comp +21 -0
  1963. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/repeat.comp +26 -0
  1964. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/repeat_back.comp +37 -0
  1965. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rms_norm.comp +150 -0
  1966. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rms_norm_back.comp +55 -0
  1967. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rms_norm_partials.comp +65 -0
  1968. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/roll.comp +46 -0
  1969. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rope_funcs.glsl +207 -0
  1970. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rope_head.glsl +19 -0
  1971. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rope_multi.comp +17 -0
  1972. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rope_neox.comp +17 -0
  1973. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rope_norm.comp +17 -0
  1974. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rope_params.glsl +31 -0
  1975. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rope_vision.comp +17 -0
  1976. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/round.comp +29 -0
  1977. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/scale.comp +24 -0
  1978. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/sgn.comp +21 -0
  1979. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/sigmoid.comp +20 -0
  1980. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/silu.comp +22 -0
  1981. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/silu_back.comp +26 -0
  1982. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/sin.comp +17 -0
  1983. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/soft_max.comp +195 -0
  1984. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/soft_max_back.comp +54 -0
  1985. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/soft_max_large1.comp +62 -0
  1986. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/soft_max_large2.comp +79 -0
  1987. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/soft_max_large3.comp +65 -0
  1988. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/soft_max_large_common.glsl +53 -0
  1989. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/softplus.comp +23 -0
  1990. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/solve_tri.comp +81 -0
  1991. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/sqrt.comp +17 -0
  1992. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/square.comp +17 -0
  1993. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/ssm_conv.comp +50 -0
  1994. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/ssm_scan.comp +124 -0
  1995. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/step.comp +22 -0
  1996. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/sub.comp +29 -0
  1997. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/sum_rows.comp +47 -0
  1998. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/sum_rows.glsl +25 -0
  1999. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/swiglu.comp +9 -0
  2000. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/swiglu_oai.comp +14 -0
  2001. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/tanh.comp +20 -0
  2002. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/timestep_embedding.comp +42 -0
  2003. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/topk_argsort.comp +118 -0
  2004. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/topk_moe.comp +213 -0
  2005. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/topk_nary_search.comp +246 -0
  2006. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/tri.comp +42 -0
  2007. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/trunc.comp +22 -0
  2008. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/types.glsl +1846 -0
  2009. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/upscale.comp +178 -0
  2010. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/utils.glsl +25 -0
  2011. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp +1183 -0
  2012. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/wkv6.comp +87 -0
  2013. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/wkv7.comp +91 -0
  2014. data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/xielu.comp +35 -0
  2015. data/vendor/ggml/src/ggml-webgpu/CMakeLists.txt +80 -0
  2016. data/vendor/ggml/src/ggml-webgpu/ggml-webgpu-shader-lib.hpp +3231 -0
  2017. data/vendor/ggml/src/ggml-webgpu/ggml-webgpu.cpp +4461 -0
  2018. data/vendor/ggml/src/ggml-webgpu/pre_wgsl.hpp +778 -0
  2019. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/add_id.wgsl +64 -0
  2020. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/argmax.wgsl +72 -0
  2021. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/argsort.wgsl +106 -0
  2022. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/argsort_merge.wgsl +134 -0
  2023. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/binary.wgsl +139 -0
  2024. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/common_decls.tmpl +905 -0
  2025. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/concat.wgsl +75 -0
  2026. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/conv2d.wgsl +165 -0
  2027. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/cpy.wgsl +81 -0
  2028. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/cumsum.wgsl +66 -0
  2029. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/embed_wgsl.py +89 -0
  2030. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/flash_attn.wgsl +706 -0
  2031. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/flash_attn_tile.wgsl +351 -0
  2032. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/flash_attn_vec_blk.wgsl +101 -0
  2033. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/flash_attn_vec_reduce.wgsl +84 -0
  2034. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/flash_attn_vec_split.wgsl +720 -0
  2035. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/gated_delta_net.wgsl +132 -0
  2036. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/get_rows.wgsl +773 -0
  2037. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/glu.wgsl +155 -0
  2038. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/im2col.wgsl +101 -0
  2039. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/memset.wgsl +40 -0
  2040. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat.wgsl +747 -0
  2041. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_decls.tmpl +1210 -0
  2042. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_id.wgsl +195 -0
  2043. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_id_gather.wgsl +55 -0
  2044. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_id_vec.wgsl +154 -0
  2045. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_reg_tile.wgsl +149 -0
  2046. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_subgroup_matrix.wgsl +200 -0
  2047. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_vec.wgsl +133 -0
  2048. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_vec_acc.tmpl +1433 -0
  2049. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/pad.wgsl +86 -0
  2050. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/repeat.wgsl +67 -0
  2051. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/rms_norm_mul.wgsl +152 -0
  2052. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/rope.wgsl +224 -0
  2053. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/row_norm.wgsl +153 -0
  2054. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/scale.wgsl +63 -0
  2055. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/set.wgsl +109 -0
  2056. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/set_rows.wgsl +109 -0
  2057. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/soft_max.wgsl +245 -0
  2058. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/solve_tri.wgsl +121 -0
  2059. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/ssm_conv.wgsl +65 -0
  2060. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/ssm_scan.wgsl +193 -0
  2061. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/sum_rows.wgsl +55 -0
  2062. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/unary.wgsl +210 -0
  2063. data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/upscale.wgsl +240 -0
  2064. data/vendor/ggml/src/ggml-zdnn/CMakeLists.txt +36 -0
  2065. data/vendor/ggml/src/ggml-zdnn/common.hpp +59 -0
  2066. data/vendor/ggml/src/ggml-zdnn/ggml-zdnn.cpp +637 -0
  2067. data/vendor/ggml/src/ggml-zdnn/mmf.cpp +80 -0
  2068. data/vendor/ggml/src/ggml-zdnn/mmf.hpp +12 -0
  2069. data/vendor/ggml/src/ggml-zdnn/utils.cpp +79 -0
  2070. data/vendor/ggml/src/ggml-zdnn/utils.hpp +19 -0
  2071. data/vendor/ggml/src/ggml-zendnn/CMakeLists.txt +91 -0
  2072. data/vendor/ggml/src/ggml-zendnn/ggml-zendnn.cpp +669 -0
  2073. data/vendor/ggml/src/ggml.c +7777 -0
  2074. data/vendor/ggml/src/ggml.cpp +26 -0
  2075. data/vendor/ggml/src/gguf.cpp +1556 -0
  2076. data/vendor/ggml/tests/CMakeLists.txt +356 -0
  2077. data/vendor/ggml/tests/test-arange.cpp +100 -0
  2078. data/vendor/ggml/tests/test-backend-ops.cpp +9786 -0
  2079. data/vendor/ggml/tests/test-cont.c +170 -0
  2080. data/vendor/ggml/tests/test-conv-transpose-1d.cpp +691 -0
  2081. data/vendor/ggml/tests/test-conv-transpose.c +248 -0
  2082. data/vendor/ggml/tests/test-conv1d-dw-c1.cpp +243 -0
  2083. data/vendor/ggml/tests/test-conv1d-dw-c2.cpp +243 -0
  2084. data/vendor/ggml/tests/test-conv1d.cpp +289 -0
  2085. data/vendor/ggml/tests/test-conv2d-dw.cpp +153 -0
  2086. data/vendor/ggml/tests/test-conv2d.cpp +391 -0
  2087. data/vendor/ggml/tests/test-customop.c +300 -0
  2088. data/vendor/ggml/tests/test-dup.c +111 -0
  2089. data/vendor/ggml/tests/test-interpolate.cpp +166 -0
  2090. data/vendor/ggml/tests/test-opt.cpp +1003 -0
  2091. data/vendor/ggml/tests/test-pad-reflect-1d.cpp +213 -0
  2092. data/vendor/ggml/tests/test-pool.c +274 -0
  2093. data/vendor/ggml/tests/test-quantize-fns.cpp +196 -0
  2094. data/vendor/ggml/tests/test-quantize-perf.cpp +356 -0
  2095. data/vendor/ggml/tests/test-rel-pos.c +87 -0
  2096. data/vendor/ggml/tests/test-roll.cpp +128 -0
  2097. data/vendor/ggml/tests/test-timestep_embedding.cpp +180 -0
  2098. data/vendor-patches/0001-cuda-buffer_from_ptr.patch +253 -0
  2099. data/vendor-patches/0002-cuda-buffer_from_ptr-reuse-iface.patch +117 -0
  2100. data/vendor-patches/0003-cuda-buffer_from_ptr-copy-mode.patch +128 -0
  2101. data/vendor-patches/0004-cuda-cpy-strided.patch +61 -0
  2102. data/vendor-patches/0005-concat-backward.patch +36 -0
  2103. data/vendor-patches/0006-getrows-back-large-vocab.patch +69 -0
  2104. data/vendor-patches/0007-gpt2-backward-kernels.patch +438 -0
  2105. data/vendor-patches/0008-mul-mat-backward-mixed-precision.patch +50 -0
  2106. data/vendor-patches/0009-sched-unsupported-node-diagnostic.patch +26 -0
  2107. metadata +2161 -0
@@ -0,0 +1,2845 @@
1
+ #pragma once
2
+
3
+ //
4
+ // GGML Tensor Library
5
+ //
6
+ // This documentation is still a work in progress.
7
+ // If you wish some specific topics to be covered, feel free to drop a comment:
8
+ //
9
+ // https://github.com/ggml-org/whisper.cpp/issues/40
10
+ //
11
+ // ## Overview
12
+ //
13
+ // This library implements:
14
+ //
15
+ // - a set of tensor operations
16
+ // - automatic differentiation
17
+ // - basic optimization algorithms
18
+ //
19
+ // The aim of this library is to provide a minimalistic approach for various machine learning tasks. This includes,
20
+ // but is not limited to, the following:
21
+ //
22
+ // - linear regression
23
+ // - support vector machines
24
+ // - neural networks
25
+ //
26
+ // The library allows the user to define a certain function using the available tensor operations. This function
27
+ // definition is represented internally via a computation graph. Each tensor operation in the function definition
28
+ // corresponds to a node in the graph. Having the computation graph defined, the user can choose to compute the
29
+ // function's value and/or its gradient with respect to the input variables. Optionally, the function can be optimized
30
+ // using one of the available optimization algorithms.
31
+ //
32
+ // For example, here we define the function: f(x) = a*x^2 + b
33
+ //
34
+ // {
35
+ // struct ggml_init_params params = {
36
+ // .mem_size = 16*1024*1024,
37
+ // .mem_buffer = NULL,
38
+ // };
39
+ //
40
+ // // memory allocation happens here
41
+ // struct ggml_context * ctx = ggml_init(params);
42
+ //
43
+ // struct ggml_tensor * x = ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 1);
44
+ //
45
+ // ggml_set_param(ctx, x); // x is an input variable
46
+ //
47
+ // struct ggml_tensor * a = ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 1);
48
+ // struct ggml_tensor * b = ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 1);
49
+ // struct ggml_tensor * x2 = ggml_mul(ctx, x, x);
50
+ // struct ggml_tensor * f = ggml_add(ctx, ggml_mul(ctx, a, x2), b);
51
+ //
52
+ // ...
53
+ // }
54
+ //
55
+ // Notice that the function definition above does not involve any actual computation. The computation is performed only
56
+ // when the user explicitly requests it. For example, to compute the function's value at x = 2.0:
57
+ //
58
+ // {
59
+ // ...
60
+ //
61
+ // struct ggml_cgraph * gf = ggml_new_graph(ctx);
62
+ // ggml_build_forward_expand(gf, f);
63
+ //
64
+ // // set the input variable and parameter values
65
+ // ggml_set_f32(x, 2.0f);
66
+ // ggml_set_f32(a, 3.0f);
67
+ // ggml_set_f32(b, 4.0f);
68
+ //
69
+ // ggml_graph_compute_with_ctx(ctx, &gf, n_threads);
70
+ //
71
+ // printf("f = %f\n", ggml_get_f32_1d(f, 0));
72
+ //
73
+ // ...
74
+ // }
75
+ //
76
+ // The actual computation is performed in the ggml_graph_compute() function.
77
+ //
78
+ // The ggml_new_tensor_...() functions create new tensors. They are allocated in the memory buffer provided to the
79
+ // ggml_init() function. You have to be careful not to exceed the memory buffer size. Therefore, you have to know
80
+ // in advance how much memory you need for your computation. Alternatively, you can allocate a large enough memory
81
+ // and after defining the computation graph, call the ggml_used_mem() function to find out how much memory was
82
+ // actually needed.
83
+ //
84
+ // The ggml_set_param() function marks a tensor as an input variable. This is used by the automatic
85
+ // differentiation and optimization algorithms.
86
+ //
87
+ // The described approach allows to define the function graph once and then compute its forward or backward graphs
88
+ // multiple times. All computations will use the same memory buffer allocated in the ggml_init() function. This way
89
+ // the user can avoid the memory allocation overhead at runtime.
90
+ //
91
+ // The library supports multi-dimensional tensors - up to 4 dimensions. The FP16 and FP32 data types are first class
92
+ // citizens, but in theory the library can be extended to support FP8 and integer data types.
93
+ //
94
+ // Each tensor operation produces a new tensor. Initially the library was envisioned to support only the use of unary
95
+ // and binary operations. Most of the available operations fall into one of these two categories. With time, it became
96
+ // clear that the library needs to support more complex operations. The way to support these operations is not clear
97
+ // yet, but a few examples are demonstrated in the following operations:
98
+ //
99
+ // - ggml_permute()
100
+ // - ggml_conv_1d_1s()
101
+ // - ggml_conv_1d_2s()
102
+ //
103
+ // For each tensor operator, the library implements a forward and backward computation function. The forward function
104
+ // computes the output tensor value given the input tensor values. The backward function computes the adjoint of the
105
+ // input tensors given the adjoint of the output tensor. For a detailed explanation of what this means, take a
106
+ // calculus class, or watch the following video:
107
+ //
108
+ // What is Automatic Differentiation?
109
+ // https://www.youtube.com/watch?v=wG_nF1awSSY
110
+ //
111
+ //
112
+ // ## Tensor data (struct ggml_tensor)
113
+ //
114
+ // The tensors are stored in memory via the ggml_tensor struct. The structure provides information about the size of
115
+ // the tensor, the data type, and the memory buffer where the tensor data is stored. Additionally, it contains
116
+ // pointers to the "source" tensors - i.e. the tensors that were used to compute the current tensor. For example:
117
+ //
118
+ // {
119
+ // struct ggml_tensor * c = ggml_add(ctx, a, b);
120
+ //
121
+ // assert(c->src[0] == a);
122
+ // assert(c->src[1] == b);
123
+ // }
124
+ //
125
+ // The multi-dimensional tensors are stored in row-major order. The ggml_tensor struct contains fields for the
126
+ // number of elements in each dimension ("ne") as well as the number of bytes ("nb", a.k.a. stride). This allows
127
+ // to store tensors that are not contiguous in memory, which is useful for operations such as transposition and
128
+ // permutation. All tensor operations have to take the stride into account and not assume that the tensor is
129
+ // contiguous in memory.
130
+ //
131
+ // The data of the tensor is accessed via the "data" pointer. For example:
132
+ //
133
+ // {
134
+ // const int nx = 2;
135
+ // const int ny = 3;
136
+ //
137
+ // struct ggml_tensor * a = ggml_new_tensor_2d(ctx, GGML_TYPE_F32, nx, ny);
138
+ //
139
+ // for (int y = 0; y < ny; y++) {
140
+ // for (int x = 0; x < nx; x++) {
141
+ // *(float *) ((char *) a->data + y*a->nb[1] + x*a->nb[0]) = x + y;
142
+ // }
143
+ // }
144
+ //
145
+ // ...
146
+ // }
147
+ //
148
+ // Alternatively, there are helper functions, such as ggml_get_f32_1d() and ggml_set_f32_1d() that can be used.
149
+ //
150
+ // ## The matrix multiplication operator (ggml_mul_mat)
151
+ //
152
+ // TODO
153
+ //
154
+ //
155
+ // ## Multi-threading
156
+ //
157
+ // TODO
158
+ //
159
+ //
160
+ // ## Overview of ggml.c
161
+ //
162
+ // TODO
163
+ //
164
+ //
165
+ // ## SIMD optimizations
166
+ //
167
+ // TODO
168
+ //
169
+ //
170
+ // ## Debugging ggml
171
+ //
172
+ // TODO
173
+ //
174
+ //
175
+
176
+ #ifdef GGML_SHARED
177
+ # if defined(_WIN32) && !defined(__MINGW32__)
178
+ # ifdef GGML_BUILD
179
+ # define GGML_API __declspec(dllexport) extern
180
+ # else
181
+ # define GGML_API __declspec(dllimport) extern
182
+ # endif
183
+ # else
184
+ # define GGML_API __attribute__ ((visibility ("default"))) extern
185
+ # endif
186
+ #else
187
+ # define GGML_API extern
188
+ #endif
189
+
190
+ // TODO: support for clang
191
+ #ifdef __GNUC__
192
+ # define GGML_DEPRECATED(func, hint) func __attribute__((deprecated(hint)))
193
+ #elif defined(_MSC_VER)
194
+ # define GGML_DEPRECATED(func, hint) __declspec(deprecated(hint)) func
195
+ #else
196
+ # define GGML_DEPRECATED(func, hint) func
197
+ #endif
198
+
199
+ #ifndef __GNUC__
200
+ # define GGML_ATTRIBUTE_FORMAT(...)
201
+ #elif defined(__MINGW32__) && !defined(__clang__)
202
+ # define GGML_ATTRIBUTE_FORMAT(...) __attribute__((format(gnu_printf, __VA_ARGS__)))
203
+ #else
204
+ # define GGML_ATTRIBUTE_FORMAT(...) __attribute__((format(printf, __VA_ARGS__)))
205
+ #endif
206
+
207
+ #if defined(_WIN32) && !defined(_WIN32_WINNT)
208
+ # define _WIN32_WINNT 0x0A00
209
+ #endif
210
+
211
+ #include <stdbool.h>
212
+ #include <stddef.h>
213
+ #include <stdint.h>
214
+ #include <stdio.h>
215
+
216
+ #define GGML_FILE_MAGIC 0x67676d6c // "ggml"
217
+ #define GGML_FILE_VERSION 2
218
+
219
+ #define GGML_QNT_VERSION 2 // bump this on quantization format changes
220
+ #define GGML_QNT_VERSION_FACTOR 1000 // do not change this
221
+
222
+ #define GGML_MAX_DIMS 4
223
+ #define GGML_MAX_PARAMS 2048
224
+ #define GGML_MAX_SRC 10
225
+ #define GGML_MAX_N_THREADS 512
226
+ #define GGML_MAX_OP_PARAMS 64
227
+
228
+ #ifndef GGML_MAX_NAME
229
+ # define GGML_MAX_NAME 64
230
+ #endif
231
+
232
+ #define GGML_DEFAULT_N_THREADS 4
233
+ #define GGML_DEFAULT_GRAPH_SIZE 2048
234
+
235
+ #if UINTPTR_MAX == 0xFFFFFFFF
236
+ #define GGML_MEM_ALIGN 4
237
+ #elif defined(__EMSCRIPTEN__)
238
+ // emscripten uses max_align_t == 8, so we need GGML_MEM_ALIGN == 8 for 64-bit wasm.
239
+ // (for 32-bit wasm, the first conditional is true and GGML_MEM_ALIGN stays 4.)
240
+ // ref: https://github.com/ggml-org/llama.cpp/pull/18628
241
+ #define GGML_MEM_ALIGN 8
242
+ #else
243
+ #define GGML_MEM_ALIGN 16
244
+ #endif
245
+
246
+ #define GGML_EXIT_SUCCESS 0
247
+ #define GGML_EXIT_ABORTED 1
248
+
249
+ // TODO: convert to enum https://github.com/ggml-org/llama.cpp/pull/16187#discussion_r2388538726
250
+ #define GGML_ROPE_TYPE_NORMAL 0
251
+ #define GGML_ROPE_TYPE_NEOX 2
252
+ #define GGML_ROPE_TYPE_MROPE 8
253
+ #define GGML_ROPE_TYPE_VISION 24
254
+ #define GGML_ROPE_TYPE_IMROPE 40 // binary: 101000
255
+
256
+ #define GGML_MROPE_SECTIONS 4
257
+
258
+ #define GGML_UNUSED(x) (void)(x)
259
+ #ifdef __CUDACC__
260
+ template<typename... Args>
261
+ __host__ __device__ constexpr inline void ggml_unused_vars_impl(Args&&...) noexcept {}
262
+ #define GGML_UNUSED_VARS(...) ggml_unused_vars_impl(__VA_ARGS__)
263
+ #else
264
+ #define GGML_UNUSED_VARS(...) do { (void)sizeof((__VA_ARGS__, 0)); } while(0)
265
+ #endif // __CUDACC__
266
+
267
+ #define GGML_PAD(x, n) (((x) + (n) - 1) & ~((n) - 1))
268
+
269
+ #ifndef NDEBUG
270
+ # define GGML_UNREACHABLE() do { fprintf(stderr, "statement should be unreachable\n"); abort(); } while(0)
271
+ #elif defined(__GNUC__)
272
+ # define GGML_UNREACHABLE() __builtin_unreachable()
273
+ #elif defined(_MSC_VER)
274
+ # define GGML_UNREACHABLE() __assume(0)
275
+ #else
276
+ # define GGML_UNREACHABLE() ((void) 0)
277
+ #endif
278
+
279
+ #ifdef __cplusplus
280
+ # define GGML_NORETURN [[noreturn]]
281
+ #elif defined(_MSC_VER)
282
+ # define GGML_NORETURN __declspec(noreturn)
283
+ #else
284
+ # define GGML_NORETURN _Noreturn
285
+ #endif
286
+
287
+ #define GGML_ABORT(...) ggml_abort(__FILE__, __LINE__, __VA_ARGS__)
288
+ #define GGML_ASSERT(x) if (!(x)) GGML_ABORT("GGML_ASSERT(%s) failed", #x)
289
+
290
+ // used to copy the number of elements and stride in bytes of tensors into local variables.
291
+ // main purpose is to reduce code duplication and improve readability.
292
+ //
293
+ // example:
294
+ //
295
+ // GGML_TENSOR_LOCALS(int64_t, ne1, src1, ne);
296
+ // GGML_TENSOR_LOCALS(size_t, nb1, src1, nb);
297
+ //
298
+ #define GGML_TENSOR_LOCALS_1(type, prefix, pointer, array) \
299
+ const type prefix##0 = (pointer) ? (pointer)->array[0] : 0; \
300
+ GGML_UNUSED(prefix##0);
301
+ #define GGML_TENSOR_LOCALS_2(type, prefix, pointer, array) \
302
+ GGML_TENSOR_LOCALS_1 (type, prefix, pointer, array) \
303
+ const type prefix##1 = (pointer) ? (pointer)->array[1] : 0; \
304
+ GGML_UNUSED(prefix##1);
305
+ #define GGML_TENSOR_LOCALS_3(type, prefix, pointer, array) \
306
+ GGML_TENSOR_LOCALS_2 (type, prefix, pointer, array) \
307
+ const type prefix##2 = (pointer) ? (pointer)->array[2] : 0; \
308
+ GGML_UNUSED(prefix##2);
309
+ #define GGML_TENSOR_LOCALS(type, prefix, pointer, array) \
310
+ GGML_TENSOR_LOCALS_3 (type, prefix, pointer, array) \
311
+ const type prefix##3 = (pointer) ? (pointer)->array[3] : 0; \
312
+ GGML_UNUSED(prefix##3);
313
+
314
+ #define GGML_TENSOR_UNARY_OP_LOCALS \
315
+ GGML_TENSOR_LOCALS(int64_t, ne0, src0, ne) \
316
+ GGML_TENSOR_LOCALS(size_t, nb0, src0, nb) \
317
+ GGML_TENSOR_LOCALS(int64_t, ne, dst, ne) \
318
+ GGML_TENSOR_LOCALS(size_t, nb, dst, nb)
319
+
320
+ #define GGML_TENSOR_BINARY_OP_LOCALS \
321
+ GGML_TENSOR_LOCALS(int64_t, ne0, src0, ne) \
322
+ GGML_TENSOR_LOCALS(size_t, nb0, src0, nb) \
323
+ GGML_TENSOR_LOCALS(int64_t, ne1, src1, ne) \
324
+ GGML_TENSOR_LOCALS(size_t, nb1, src1, nb) \
325
+ GGML_TENSOR_LOCALS(int64_t, ne, dst, ne) \
326
+ GGML_TENSOR_LOCALS(size_t, nb, dst, nb)
327
+
328
+ #define GGML_TENSOR_TERNARY_OP_LOCALS \
329
+ GGML_TENSOR_LOCALS(int64_t, ne0, src0, ne) \
330
+ GGML_TENSOR_LOCALS(size_t, nb0, src0, nb) \
331
+ GGML_TENSOR_LOCALS(int64_t, ne1, src1, ne) \
332
+ GGML_TENSOR_LOCALS(size_t, nb1, src1, nb) \
333
+ GGML_TENSOR_LOCALS(int64_t, ne2, src2, ne) \
334
+ GGML_TENSOR_LOCALS(size_t, nb2, src2, nb) \
335
+ GGML_TENSOR_LOCALS(int64_t, ne, dst, ne) \
336
+ GGML_TENSOR_LOCALS(size_t, nb, dst, nb)
337
+
338
+ #define GGML_TENSOR_BINARY_OP_LOCALS01 \
339
+ GGML_TENSOR_LOCALS(int64_t, ne0, src0, ne) \
340
+ GGML_TENSOR_LOCALS(size_t, nb0, src0, nb) \
341
+ GGML_TENSOR_LOCALS(int64_t, ne1, src1, ne) \
342
+ GGML_TENSOR_LOCALS(size_t, nb1, src1, nb)
343
+
344
+ #ifdef __cplusplus
345
+ extern "C" {
346
+ #endif
347
+
348
+ // Function type used in fatal error callbacks
349
+ typedef void (*ggml_abort_callback_t)(const char * error_message);
350
+
351
+ // Set the abort callback (passing null will restore original abort functionality: printing a message to stdout)
352
+ // Returns the old callback for chaining
353
+ GGML_API ggml_abort_callback_t ggml_set_abort_callback(ggml_abort_callback_t callback);
354
+
355
+ GGML_NORETURN GGML_ATTRIBUTE_FORMAT(3, 4)
356
+ GGML_API void ggml_abort(const char * file, int line, const char * fmt, ...);
357
+
358
+ enum ggml_status {
359
+ GGML_STATUS_ALLOC_FAILED = -2,
360
+ GGML_STATUS_FAILED = -1,
361
+ GGML_STATUS_SUCCESS = 0,
362
+ GGML_STATUS_ABORTED = 1,
363
+ };
364
+
365
+ // get ggml_status name string
366
+ GGML_API const char * ggml_status_to_string(enum ggml_status status);
367
+
368
+ // ieee 754-2008 half-precision float16
369
+ // todo: make this not an integral type
370
+ typedef uint16_t ggml_fp16_t;
371
+ GGML_API float ggml_fp16_to_fp32(ggml_fp16_t);
372
+ GGML_API ggml_fp16_t ggml_fp32_to_fp16(float);
373
+ GGML_API void ggml_fp16_to_fp32_row(const ggml_fp16_t *, float *, int64_t);
374
+ GGML_API void ggml_fp32_to_fp16_row(const float *, ggml_fp16_t *, int64_t);
375
+
376
+ // google brain half-precision bfloat16
377
+ typedef struct { uint16_t bits; } ggml_bf16_t;
378
+ GGML_API ggml_bf16_t ggml_fp32_to_bf16(float);
379
+ GGML_API float ggml_bf16_to_fp32(ggml_bf16_t); // consider just doing << 16
380
+ GGML_API void ggml_bf16_to_fp32_row(const ggml_bf16_t *, float *, int64_t);
381
+ GGML_API void ggml_fp32_to_bf16_row_ref(const float *, ggml_bf16_t *, int64_t);
382
+ GGML_API void ggml_fp32_to_bf16_row(const float *, ggml_bf16_t *, int64_t);
383
+
384
+ struct ggml_object;
385
+ struct ggml_context;
386
+ struct ggml_cgraph;
387
+
388
+ // NOTE: always add types at the end of the enum to keep backward compatibility
389
+ enum ggml_type {
390
+ GGML_TYPE_F32 = 0,
391
+ GGML_TYPE_F16 = 1,
392
+ GGML_TYPE_Q4_0 = 2,
393
+ GGML_TYPE_Q4_1 = 3,
394
+ // GGML_TYPE_Q4_2 = 4, support has been removed
395
+ // GGML_TYPE_Q4_3 = 5, support has been removed
396
+ GGML_TYPE_Q5_0 = 6,
397
+ GGML_TYPE_Q5_1 = 7,
398
+ GGML_TYPE_Q8_0 = 8,
399
+ GGML_TYPE_Q8_1 = 9,
400
+ GGML_TYPE_Q2_K = 10,
401
+ GGML_TYPE_Q3_K = 11,
402
+ GGML_TYPE_Q4_K = 12,
403
+ GGML_TYPE_Q5_K = 13,
404
+ GGML_TYPE_Q6_K = 14,
405
+ GGML_TYPE_Q8_K = 15,
406
+ GGML_TYPE_IQ2_XXS = 16,
407
+ GGML_TYPE_IQ2_XS = 17,
408
+ GGML_TYPE_IQ3_XXS = 18,
409
+ GGML_TYPE_IQ1_S = 19,
410
+ GGML_TYPE_IQ4_NL = 20,
411
+ GGML_TYPE_IQ3_S = 21,
412
+ GGML_TYPE_IQ2_S = 22,
413
+ GGML_TYPE_IQ4_XS = 23,
414
+ GGML_TYPE_I8 = 24,
415
+ GGML_TYPE_I16 = 25,
416
+ GGML_TYPE_I32 = 26,
417
+ GGML_TYPE_I64 = 27,
418
+ GGML_TYPE_F64 = 28,
419
+ GGML_TYPE_IQ1_M = 29,
420
+ GGML_TYPE_BF16 = 30,
421
+ // GGML_TYPE_Q4_0_4_4 = 31, support has been removed from gguf files
422
+ // GGML_TYPE_Q4_0_4_8 = 32,
423
+ // GGML_TYPE_Q4_0_8_8 = 33,
424
+ GGML_TYPE_TQ1_0 = 34,
425
+ GGML_TYPE_TQ2_0 = 35,
426
+ // GGML_TYPE_IQ4_NL_4_4 = 36,
427
+ // GGML_TYPE_IQ4_NL_4_8 = 37,
428
+ // GGML_TYPE_IQ4_NL_8_8 = 38,
429
+ GGML_TYPE_MXFP4 = 39, // MXFP4 (1 block)
430
+ GGML_TYPE_NVFP4 = 40, // NVFP4 (4 blocks, E4M3 scale)
431
+ GGML_TYPE_Q1_0 = 41,
432
+ GGML_TYPE_COUNT = 42,
433
+ };
434
+
435
+ // precision
436
+ enum ggml_prec {
437
+ GGML_PREC_DEFAULT = 0, // stored as ggml_tensor.op_params, 0 by default
438
+ GGML_PREC_F32 = 10,
439
+ };
440
+
441
+ // op hint
442
+ enum ggml_op_hint {
443
+ GGML_HINT_NONE = 0,
444
+ GGML_HINT_SRC0_IS_HADAMARD = 1,
445
+ };
446
+
447
+ // model file types
448
+ enum ggml_ftype {
449
+ GGML_FTYPE_UNKNOWN = -1,
450
+ GGML_FTYPE_ALL_F32 = 0,
451
+ GGML_FTYPE_MOSTLY_F16 = 1, // except 1d tensors
452
+ GGML_FTYPE_MOSTLY_Q4_0 = 2, // except 1d tensors
453
+ GGML_FTYPE_MOSTLY_Q4_1 = 3, // except 1d tensors
454
+ GGML_FTYPE_MOSTLY_Q4_1_SOME_F16 = 4, // tok_embeddings.weight and output.weight are F16
455
+ GGML_FTYPE_MOSTLY_Q8_0 = 7, // except 1d tensors
456
+ GGML_FTYPE_MOSTLY_Q5_0 = 8, // except 1d tensors
457
+ GGML_FTYPE_MOSTLY_Q5_1 = 9, // except 1d tensors
458
+ GGML_FTYPE_MOSTLY_Q2_K = 10, // except 1d tensors
459
+ GGML_FTYPE_MOSTLY_Q3_K = 11, // except 1d tensors
460
+ GGML_FTYPE_MOSTLY_Q4_K = 12, // except 1d tensors
461
+ GGML_FTYPE_MOSTLY_Q5_K = 13, // except 1d tensors
462
+ GGML_FTYPE_MOSTLY_Q6_K = 14, // except 1d tensors
463
+ GGML_FTYPE_MOSTLY_IQ2_XXS = 15, // except 1d tensors
464
+ GGML_FTYPE_MOSTLY_IQ2_XS = 16, // except 1d tensors
465
+ GGML_FTYPE_MOSTLY_IQ3_XXS = 17, // except 1d tensors
466
+ GGML_FTYPE_MOSTLY_IQ1_S = 18, // except 1d tensors
467
+ GGML_FTYPE_MOSTLY_IQ4_NL = 19, // except 1d tensors
468
+ GGML_FTYPE_MOSTLY_IQ3_S = 20, // except 1d tensors
469
+ GGML_FTYPE_MOSTLY_IQ2_S = 21, // except 1d tensors
470
+ GGML_FTYPE_MOSTLY_IQ4_XS = 22, // except 1d tensors
471
+ GGML_FTYPE_MOSTLY_IQ1_M = 23, // except 1d tensors
472
+ GGML_FTYPE_MOSTLY_BF16 = 24, // except 1d tensors
473
+ GGML_FTYPE_MOSTLY_MXFP4 = 25, // except 1d tensors
474
+ GGML_FTYPE_MOSTLY_NVFP4 = 26, // except 1d tensors
475
+ GGML_FTYPE_MOSTLY_Q1_0 = 27, // except 1d tensors
476
+ };
477
+
478
+ // available tensor operations:
479
+ enum ggml_op {
480
+ GGML_OP_NONE = 0,
481
+
482
+ GGML_OP_DUP,
483
+ GGML_OP_ADD,
484
+ GGML_OP_ADD_ID,
485
+ GGML_OP_ADD1,
486
+ GGML_OP_ACC,
487
+ GGML_OP_SUB,
488
+ GGML_OP_MUL,
489
+ GGML_OP_DIV,
490
+ GGML_OP_SQR,
491
+ GGML_OP_SQRT,
492
+ GGML_OP_LOG,
493
+ GGML_OP_SIN,
494
+ GGML_OP_COS,
495
+ GGML_OP_SUM,
496
+ GGML_OP_SUM_ROWS,
497
+ GGML_OP_CUMSUM,
498
+ GGML_OP_MEAN,
499
+ GGML_OP_ARGMAX,
500
+ GGML_OP_COUNT_EQUAL,
501
+ GGML_OP_REPEAT,
502
+ GGML_OP_REPEAT_BACK,
503
+ GGML_OP_CONCAT,
504
+ GGML_OP_SILU_BACK,
505
+ GGML_OP_NORM, // normalize
506
+ GGML_OP_RMS_NORM,
507
+ GGML_OP_RMS_NORM_BACK,
508
+ GGML_OP_GROUP_NORM,
509
+ GGML_OP_L2_NORM,
510
+
511
+ GGML_OP_MUL_MAT,
512
+ GGML_OP_MUL_MAT_ID,
513
+ GGML_OP_OUT_PROD,
514
+
515
+ GGML_OP_SCALE,
516
+ GGML_OP_SET,
517
+ GGML_OP_CPY,
518
+ GGML_OP_CONT,
519
+ GGML_OP_RESHAPE,
520
+ GGML_OP_VIEW,
521
+ GGML_OP_PERMUTE,
522
+ GGML_OP_TRANSPOSE,
523
+ GGML_OP_GET_ROWS,
524
+ GGML_OP_GET_ROWS_BACK,
525
+ GGML_OP_SET_ROWS,
526
+ GGML_OP_DIAG,
527
+ GGML_OP_DIAG_MASK_INF,
528
+ GGML_OP_DIAG_MASK_ZERO,
529
+ GGML_OP_SOFT_MAX,
530
+ GGML_OP_SOFT_MAX_BACK,
531
+ GGML_OP_ROPE,
532
+ GGML_OP_ROPE_BACK,
533
+ GGML_OP_CLAMP,
534
+ GGML_OP_CONV_TRANSPOSE_1D,
535
+ GGML_OP_IM2COL,
536
+ GGML_OP_IM2COL_BACK,
537
+ GGML_OP_IM2COL_3D,
538
+ GGML_OP_CONV_2D,
539
+ GGML_OP_CONV_3D,
540
+ GGML_OP_CONV_2D_DW,
541
+ GGML_OP_CONV_TRANSPOSE_2D,
542
+ GGML_OP_POOL_1D,
543
+ GGML_OP_POOL_2D,
544
+ GGML_OP_POOL_2D_BACK,
545
+ GGML_OP_UPSCALE,
546
+ GGML_OP_PAD,
547
+ GGML_OP_PAD_REFLECT_1D,
548
+ GGML_OP_ROLL,
549
+ GGML_OP_ARANGE,
550
+ GGML_OP_TIMESTEP_EMBEDDING,
551
+ GGML_OP_ARGSORT,
552
+ GGML_OP_TOP_K,
553
+ GGML_OP_LEAKY_RELU,
554
+ GGML_OP_TRI,
555
+ GGML_OP_FILL,
556
+
557
+ GGML_OP_FLASH_ATTN_EXT,
558
+ GGML_OP_FLASH_ATTN_BACK,
559
+ GGML_OP_SSM_CONV,
560
+ GGML_OP_SSM_SCAN,
561
+ GGML_OP_WIN_PART,
562
+ GGML_OP_WIN_UNPART,
563
+ GGML_OP_GET_REL_POS,
564
+ GGML_OP_ADD_REL_POS,
565
+ GGML_OP_RWKV_WKV6,
566
+ GGML_OP_GATED_LINEAR_ATTN,
567
+ GGML_OP_RWKV_WKV7,
568
+ GGML_OP_SOLVE_TRI,
569
+ GGML_OP_GATED_DELTA_NET,
570
+
571
+ GGML_OP_UNARY,
572
+
573
+ GGML_OP_MAP_CUSTOM1,
574
+ GGML_OP_MAP_CUSTOM2,
575
+ GGML_OP_MAP_CUSTOM3,
576
+
577
+ GGML_OP_CUSTOM,
578
+
579
+ GGML_OP_CROSS_ENTROPY_LOSS,
580
+ GGML_OP_CROSS_ENTROPY_LOSS_BACK,
581
+ GGML_OP_OPT_STEP_ADAMW,
582
+ GGML_OP_OPT_STEP_SGD,
583
+
584
+ GGML_OP_GLU,
585
+
586
+ GGML_OP_COUNT,
587
+ };
588
+
589
+ enum ggml_unary_op {
590
+ GGML_UNARY_OP_ABS,
591
+ GGML_UNARY_OP_SGN,
592
+ GGML_UNARY_OP_NEG,
593
+ GGML_UNARY_OP_STEP,
594
+ GGML_UNARY_OP_TANH,
595
+ GGML_UNARY_OP_ELU,
596
+ GGML_UNARY_OP_RELU,
597
+ GGML_UNARY_OP_SIGMOID,
598
+ GGML_UNARY_OP_GELU,
599
+ GGML_UNARY_OP_GELU_QUICK,
600
+ GGML_UNARY_OP_SILU,
601
+ GGML_UNARY_OP_HARDSWISH,
602
+ GGML_UNARY_OP_HARDSIGMOID,
603
+ GGML_UNARY_OP_EXP,
604
+ GGML_UNARY_OP_EXPM1,
605
+ GGML_UNARY_OP_SOFTPLUS,
606
+ GGML_UNARY_OP_GELU_ERF,
607
+ GGML_UNARY_OP_XIELU,
608
+ GGML_UNARY_OP_FLOOR,
609
+ GGML_UNARY_OP_CEIL,
610
+ GGML_UNARY_OP_ROUND,
611
+ GGML_UNARY_OP_TRUNC,
612
+
613
+ GGML_UNARY_OP_COUNT,
614
+ };
615
+
616
+ enum ggml_glu_op {
617
+ GGML_GLU_OP_REGLU,
618
+ GGML_GLU_OP_GEGLU,
619
+ GGML_GLU_OP_SWIGLU,
620
+ GGML_GLU_OP_SWIGLU_OAI,
621
+ GGML_GLU_OP_GEGLU_ERF,
622
+ GGML_GLU_OP_GEGLU_QUICK,
623
+
624
+ GGML_GLU_OP_COUNT,
625
+ };
626
+
627
+ enum ggml_object_type {
628
+ GGML_OBJECT_TYPE_TENSOR,
629
+ GGML_OBJECT_TYPE_GRAPH,
630
+ GGML_OBJECT_TYPE_WORK_BUFFER
631
+ };
632
+
633
+ enum ggml_log_level {
634
+ GGML_LOG_LEVEL_NONE = 0,
635
+ GGML_LOG_LEVEL_DEBUG = 1,
636
+ GGML_LOG_LEVEL_INFO = 2,
637
+ GGML_LOG_LEVEL_WARN = 3,
638
+ GGML_LOG_LEVEL_ERROR = 4,
639
+ GGML_LOG_LEVEL_CONT = 5, // continue previous log
640
+ };
641
+
642
+ // this tensor...
643
+ enum ggml_tensor_flag {
644
+ GGML_TENSOR_FLAG_INPUT = 1, // ...is an input for the GGML compute graph
645
+ GGML_TENSOR_FLAG_OUTPUT = 2, // ...is an output for the GGML compute graph
646
+ GGML_TENSOR_FLAG_PARAM = 4, // ...contains trainable parameters
647
+ GGML_TENSOR_FLAG_LOSS = 8, // ...defines loss for numerical optimization (multiple loss tensors add up)
648
+ GGML_TENSOR_FLAG_COMPUTE = 16, // ...must be computed
649
+ };
650
+
651
+ enum ggml_tri_type {
652
+ GGML_TRI_TYPE_UPPER_DIAG = 0,
653
+ GGML_TRI_TYPE_UPPER = 1,
654
+ GGML_TRI_TYPE_LOWER_DIAG = 2,
655
+ GGML_TRI_TYPE_LOWER = 3
656
+ };
657
+
658
+ struct ggml_init_params {
659
+ // memory pool
660
+ size_t mem_size; // bytes
661
+ void * mem_buffer; // if NULL, memory will be allocated internally
662
+ bool no_alloc; // don't allocate memory for the tensor data
663
+ };
664
+
665
+ // n-dimensional tensor
666
+ struct ggml_tensor {
667
+ enum ggml_type type;
668
+
669
+ struct ggml_backend_buffer * buffer;
670
+
671
+ int64_t ne[GGML_MAX_DIMS]; // number of elements
672
+ size_t nb[GGML_MAX_DIMS]; // stride in bytes:
673
+ // nb[0] = ggml_type_size(type)
674
+ // nb[1] = nb[0] * (ne[0] / ggml_blck_size(type)) + padding
675
+ // nb[i] = nb[i-1] * ne[i-1]
676
+
677
+ // compute data
678
+ enum ggml_op op;
679
+
680
+ // op params - allocated as int32_t for alignment
681
+ int32_t op_params[GGML_MAX_OP_PARAMS / sizeof(int32_t)];
682
+
683
+ int32_t flags;
684
+
685
+ struct ggml_tensor * src[GGML_MAX_SRC];
686
+
687
+ // source tensor and offset for views
688
+ struct ggml_tensor * view_src;
689
+ size_t view_offs;
690
+
691
+ void * data;
692
+
693
+ char name[GGML_MAX_NAME];
694
+
695
+ void * extra; // extra things e.g. for ggml-cuda.cu
696
+
697
+ char padding[8];
698
+ };
699
+
700
+ static const size_t GGML_TENSOR_SIZE = sizeof(struct ggml_tensor);
701
+
702
+ // Abort callback
703
+ // If not NULL, called before ggml computation
704
+ // If it returns true, the computation is aborted
705
+ typedef bool (*ggml_abort_callback)(void * data);
706
+
707
+
708
+ //
709
+ // GUID
710
+ //
711
+
712
+ // GUID types
713
+ typedef uint8_t ggml_guid[16];
714
+ typedef ggml_guid * ggml_guid_t;
715
+
716
+ GGML_API bool ggml_guid_matches(ggml_guid_t guid_a, ggml_guid_t guid_b);
717
+
718
+ // misc
719
+
720
+ GGML_API const char * ggml_version(void);
721
+ GGML_API const char * ggml_commit(void);
722
+
723
+ GGML_API void ggml_time_init(void); // call this once at the beginning of the program
724
+ GGML_API int64_t ggml_time_ms(void);
725
+ GGML_API int64_t ggml_time_us(void);
726
+ GGML_API int64_t ggml_cycles(void);
727
+ GGML_API int64_t ggml_cycles_per_ms(void);
728
+
729
+ // accepts a UTF-8 path, even on Windows
730
+ GGML_API FILE * ggml_fopen(const char * fname, const char * mode);
731
+
732
+ GGML_API void ggml_print_object (const struct ggml_object * obj);
733
+ GGML_API void ggml_print_objects(const struct ggml_context * ctx);
734
+
735
+ GGML_API int64_t ggml_nelements (const struct ggml_tensor * tensor);
736
+ GGML_API int64_t ggml_nrows (const struct ggml_tensor * tensor);
737
+ GGML_API size_t ggml_nbytes (const struct ggml_tensor * tensor);
738
+ GGML_API size_t ggml_nbytes_pad(const struct ggml_tensor * tensor); // same as ggml_nbytes() but padded to GGML_MEM_ALIGN
739
+
740
+ GGML_API int64_t ggml_blck_size(enum ggml_type type);
741
+ GGML_API size_t ggml_type_size(enum ggml_type type); // size in bytes for all elements in a block
742
+ GGML_API size_t ggml_row_size (enum ggml_type type, int64_t ne); // size in bytes for all elements in a row
743
+
744
+ GGML_DEPRECATED(
745
+ GGML_API double ggml_type_sizef(enum ggml_type type), // ggml_type_size()/ggml_blck_size() as float
746
+ "use ggml_row_size() instead");
747
+
748
+ GGML_API const char * ggml_type_name(enum ggml_type type);
749
+ GGML_API const char * ggml_op_name (enum ggml_op op);
750
+ GGML_API const char * ggml_op_symbol(enum ggml_op op);
751
+
752
+ GGML_API const char * ggml_unary_op_name(enum ggml_unary_op op);
753
+ GGML_API const char * ggml_glu_op_name(enum ggml_glu_op op);
754
+ GGML_API const char * ggml_op_desc(const struct ggml_tensor * t); // unary or op name
755
+
756
+ GGML_API size_t ggml_element_size(const struct ggml_tensor * tensor);
757
+
758
+ GGML_API bool ggml_is_quantized(enum ggml_type type);
759
+
760
+ // TODO: temporary until model loading of ggml examples is refactored
761
+ GGML_API enum ggml_type ggml_ftype_to_ggml_type(enum ggml_ftype ftype);
762
+
763
+ GGML_API bool ggml_is_transposed(const struct ggml_tensor * tensor);
764
+ GGML_API bool ggml_is_permuted (const struct ggml_tensor * tensor);
765
+ GGML_API bool ggml_is_empty (const struct ggml_tensor * tensor);
766
+ GGML_API bool ggml_is_view (const struct ggml_tensor * tensor);
767
+ GGML_API bool ggml_is_scalar (const struct ggml_tensor * tensor);
768
+ GGML_API bool ggml_is_vector (const struct ggml_tensor * tensor);
769
+ GGML_API bool ggml_is_matrix (const struct ggml_tensor * tensor);
770
+ GGML_API bool ggml_is_3d (const struct ggml_tensor * tensor);
771
+ GGML_API int ggml_n_dims (const struct ggml_tensor * tensor); // returns 1 for scalars
772
+
773
+ // returns whether the tensor elements can be iterated over with a flattened index (no gaps, no permutation)
774
+ GGML_API bool ggml_is_contiguous (const struct ggml_tensor * tensor);
775
+ GGML_API bool ggml_is_contiguous_0(const struct ggml_tensor * tensor); // same as ggml_is_contiguous()
776
+ GGML_API bool ggml_is_contiguous_1(const struct ggml_tensor * tensor); // contiguous for dims >= 1
777
+ GGML_API bool ggml_is_contiguous_2(const struct ggml_tensor * tensor); // contiguous for dims >= 2
778
+
779
+ // returns whether the tensor elements are allocated as one contiguous block of memory (no gaps, but permutation ok)
780
+ GGML_API bool ggml_is_contiguously_allocated(const struct ggml_tensor * tensor);
781
+
782
+ // true for tensor that is stored in memory as CxWxHxN and has been permuted to WxHxCxN
783
+ GGML_API bool ggml_is_contiguous_channels(const struct ggml_tensor * tensor);
784
+
785
+ // true if the elements in dimension 0 are contiguous, or there is just 1 block of elements
786
+ GGML_API bool ggml_is_contiguous_rows(const struct ggml_tensor * tensor);
787
+
788
+ GGML_API bool ggml_are_same_shape (const struct ggml_tensor * t0, const struct ggml_tensor * t1);
789
+ GGML_API bool ggml_are_same_stride(const struct ggml_tensor * t0, const struct ggml_tensor * t1);
790
+
791
+ GGML_API bool ggml_can_repeat(const struct ggml_tensor * t0, const struct ggml_tensor * t1);
792
+
793
+ // use this to compute the memory overhead of a tensor
794
+ GGML_API size_t ggml_tensor_overhead(void);
795
+
796
+ GGML_API bool ggml_validate_row_data(enum ggml_type type, const void * data, size_t nbytes);
797
+
798
+ // main
799
+
800
+ GGML_API struct ggml_context * ggml_init (struct ggml_init_params params);
801
+ GGML_API void ggml_reset(struct ggml_context * ctx);
802
+ GGML_API void ggml_free (struct ggml_context * ctx);
803
+
804
+ GGML_API size_t ggml_used_mem(const struct ggml_context * ctx);
805
+
806
+ GGML_API bool ggml_get_no_alloc(struct ggml_context * ctx);
807
+ GGML_API void ggml_set_no_alloc(struct ggml_context * ctx, bool no_alloc);
808
+
809
+ GGML_API void * ggml_get_mem_buffer (const struct ggml_context * ctx);
810
+ GGML_API size_t ggml_get_mem_size (const struct ggml_context * ctx);
811
+ GGML_API size_t ggml_get_max_tensor_size(const struct ggml_context * ctx);
812
+
813
+ GGML_API struct ggml_tensor * ggml_new_tensor(
814
+ struct ggml_context * ctx,
815
+ enum ggml_type type,
816
+ int n_dims,
817
+ const int64_t *ne);
818
+
819
+ GGML_API struct ggml_tensor * ggml_new_tensor_1d(
820
+ struct ggml_context * ctx,
821
+ enum ggml_type type,
822
+ int64_t ne0);
823
+
824
+ GGML_API struct ggml_tensor * ggml_new_tensor_2d(
825
+ struct ggml_context * ctx,
826
+ enum ggml_type type,
827
+ int64_t ne0,
828
+ int64_t ne1);
829
+
830
+ GGML_API struct ggml_tensor * ggml_new_tensor_3d(
831
+ struct ggml_context * ctx,
832
+ enum ggml_type type,
833
+ int64_t ne0,
834
+ int64_t ne1,
835
+ int64_t ne2);
836
+
837
+ GGML_API struct ggml_tensor * ggml_new_tensor_4d(
838
+ struct ggml_context * ctx,
839
+ enum ggml_type type,
840
+ int64_t ne0,
841
+ int64_t ne1,
842
+ int64_t ne2,
843
+ int64_t ne3);
844
+
845
+ GGML_API void * ggml_new_buffer(struct ggml_context * ctx, size_t nbytes);
846
+
847
+ GGML_API struct ggml_tensor * ggml_dup_tensor (struct ggml_context * ctx, const struct ggml_tensor * src);
848
+ GGML_API struct ggml_tensor * ggml_view_tensor(struct ggml_context * ctx, struct ggml_tensor * src);
849
+
850
+ // Context tensor enumeration and lookup
851
+ GGML_API struct ggml_tensor * ggml_get_first_tensor(const struct ggml_context * ctx);
852
+ GGML_API struct ggml_tensor * ggml_get_next_tensor (const struct ggml_context * ctx, struct ggml_tensor * tensor);
853
+ GGML_API struct ggml_tensor * ggml_get_tensor(struct ggml_context * ctx, const char * name);
854
+
855
+ // Converts a flat index into coordinates
856
+ GGML_API void ggml_unravel_index(const struct ggml_tensor * tensor, int64_t i, int64_t * i0, int64_t * i1, int64_t * i2, int64_t * i3);
857
+
858
+ GGML_API enum ggml_unary_op ggml_get_unary_op(const struct ggml_tensor * tensor);
859
+ GGML_API enum ggml_glu_op ggml_get_glu_op(const struct ggml_tensor * tensor);
860
+
861
+ GGML_API void * ggml_get_data (const struct ggml_tensor * tensor);
862
+ GGML_API float * ggml_get_data_f32(const struct ggml_tensor * tensor);
863
+
864
+ GGML_API const char * ggml_get_name (const struct ggml_tensor * tensor);
865
+ GGML_API struct ggml_tensor * ggml_set_name ( struct ggml_tensor * tensor, const char * name);
866
+ GGML_ATTRIBUTE_FORMAT(2, 3)
867
+ GGML_API struct ggml_tensor * ggml_format_name( struct ggml_tensor * tensor, const char * fmt, ...);
868
+
869
+ // Tensor flags
870
+ GGML_API void ggml_set_input(struct ggml_tensor * tensor);
871
+ GGML_API void ggml_set_output(struct ggml_tensor * tensor);
872
+ GGML_API void ggml_set_param(struct ggml_tensor * tensor);
873
+ GGML_API void ggml_set_loss(struct ggml_tensor * tensor);
874
+
875
+ //
876
+ // operations on tensors with backpropagation
877
+ //
878
+
879
+ GGML_API struct ggml_tensor * ggml_dup(
880
+ struct ggml_context * ctx,
881
+ struct ggml_tensor * a);
882
+
883
+ // in-place, returns view(a)
884
+ GGML_API struct ggml_tensor * ggml_dup_inplace(
885
+ struct ggml_context * ctx,
886
+ struct ggml_tensor * a);
887
+
888
+ GGML_API struct ggml_tensor * ggml_add(
889
+ struct ggml_context * ctx,
890
+ struct ggml_tensor * a,
891
+ struct ggml_tensor * b);
892
+
893
+ GGML_API struct ggml_tensor * ggml_add_inplace(
894
+ struct ggml_context * ctx,
895
+ struct ggml_tensor * a,
896
+ struct ggml_tensor * b);
897
+
898
+ GGML_API struct ggml_tensor * ggml_add_cast(
899
+ struct ggml_context * ctx,
900
+ struct ggml_tensor * a,
901
+ struct ggml_tensor * b,
902
+ enum ggml_type type);
903
+
904
+ // dst[i0, i1, i2] = a[i0, i1, i2] + b[i0, ids[i1, i2]]
905
+ GGML_API struct ggml_tensor * ggml_add_id(
906
+ struct ggml_context * ctx,
907
+ struct ggml_tensor * a,
908
+ struct ggml_tensor * b,
909
+ struct ggml_tensor * ids);
910
+
911
+ GGML_DEPRECATED(GGML_API struct ggml_tensor * ggml_add1(
912
+ struct ggml_context * ctx,
913
+ struct ggml_tensor * a,
914
+ struct ggml_tensor * b),
915
+ "use ggml_add instead");
916
+
917
+ GGML_DEPRECATED(GGML_API struct ggml_tensor * ggml_add1_inplace(
918
+ struct ggml_context * ctx,
919
+ struct ggml_tensor * a,
920
+ struct ggml_tensor * b),
921
+ "use ggml_add_inplace instead");
922
+
923
+ // dst = a
924
+ // view(dst, nb1, nb2, nb3, offset) += b
925
+ // return dst
926
+ GGML_API struct ggml_tensor * ggml_acc(
927
+ struct ggml_context * ctx,
928
+ struct ggml_tensor * a,
929
+ struct ggml_tensor * b,
930
+ size_t nb1,
931
+ size_t nb2,
932
+ size_t nb3,
933
+ size_t offset);
934
+
935
+ GGML_API struct ggml_tensor * ggml_acc_inplace(
936
+ struct ggml_context * ctx,
937
+ struct ggml_tensor * a,
938
+ struct ggml_tensor * b,
939
+ size_t nb1,
940
+ size_t nb2,
941
+ size_t nb3,
942
+ size_t offset);
943
+
944
+ GGML_API struct ggml_tensor * ggml_sub(
945
+ struct ggml_context * ctx,
946
+ struct ggml_tensor * a,
947
+ struct ggml_tensor * b);
948
+
949
+ GGML_API struct ggml_tensor * ggml_sub_inplace(
950
+ struct ggml_context * ctx,
951
+ struct ggml_tensor * a,
952
+ struct ggml_tensor * b);
953
+
954
+ GGML_API struct ggml_tensor * ggml_mul(
955
+ struct ggml_context * ctx,
956
+ struct ggml_tensor * a,
957
+ struct ggml_tensor * b);
958
+
959
+ GGML_API struct ggml_tensor * ggml_mul_inplace(
960
+ struct ggml_context * ctx,
961
+ struct ggml_tensor * a,
962
+ struct ggml_tensor * b);
963
+
964
+ GGML_API struct ggml_tensor * ggml_div(
965
+ struct ggml_context * ctx,
966
+ struct ggml_tensor * a,
967
+ struct ggml_tensor * b);
968
+
969
+ GGML_API struct ggml_tensor * ggml_div_inplace(
970
+ struct ggml_context * ctx,
971
+ struct ggml_tensor * a,
972
+ struct ggml_tensor * b);
973
+
974
+ GGML_API struct ggml_tensor * ggml_sqr(
975
+ struct ggml_context * ctx,
976
+ struct ggml_tensor * a);
977
+
978
+ GGML_API struct ggml_tensor * ggml_sqr_inplace(
979
+ struct ggml_context * ctx,
980
+ struct ggml_tensor * a);
981
+
982
+ GGML_API struct ggml_tensor * ggml_sqrt(
983
+ struct ggml_context * ctx,
984
+ struct ggml_tensor * a);
985
+
986
+ GGML_API struct ggml_tensor * ggml_sqrt_inplace(
987
+ struct ggml_context * ctx,
988
+ struct ggml_tensor * a);
989
+
990
+ GGML_API struct ggml_tensor * ggml_log(
991
+ struct ggml_context * ctx,
992
+ struct ggml_tensor * a);
993
+
994
+ GGML_API struct ggml_tensor * ggml_log_inplace(
995
+ struct ggml_context * ctx,
996
+ struct ggml_tensor * a);
997
+
998
+ GGML_API struct ggml_tensor * ggml_expm1(
999
+ struct ggml_context * ctx,
1000
+ struct ggml_tensor * a);
1001
+
1002
+ GGML_API struct ggml_tensor * ggml_expm1_inplace(
1003
+ struct ggml_context * ctx,
1004
+ struct ggml_tensor * a);
1005
+
1006
+ GGML_API struct ggml_tensor * ggml_softplus(
1007
+ struct ggml_context * ctx,
1008
+ struct ggml_tensor * a);
1009
+
1010
+ GGML_API struct ggml_tensor * ggml_softplus_inplace(
1011
+ struct ggml_context * ctx,
1012
+ struct ggml_tensor * a);
1013
+
1014
+ GGML_API struct ggml_tensor * ggml_sin(
1015
+ struct ggml_context * ctx,
1016
+ struct ggml_tensor * a);
1017
+
1018
+ GGML_API struct ggml_tensor * ggml_sin_inplace(
1019
+ struct ggml_context * ctx,
1020
+ struct ggml_tensor * a);
1021
+
1022
+ GGML_API struct ggml_tensor * ggml_cos(
1023
+ struct ggml_context * ctx,
1024
+ struct ggml_tensor * a);
1025
+
1026
+ GGML_API struct ggml_tensor * ggml_cos_inplace(
1027
+ struct ggml_context * ctx,
1028
+ struct ggml_tensor * a);
1029
+
1030
+ // return scalar
1031
+ GGML_API struct ggml_tensor * ggml_sum(
1032
+ struct ggml_context * ctx,
1033
+ struct ggml_tensor * a);
1034
+
1035
+ // sums along rows, with input shape [a,b,c,d] return shape [1,b,c,d]
1036
+ GGML_API struct ggml_tensor * ggml_sum_rows(
1037
+ struct ggml_context * ctx,
1038
+ struct ggml_tensor * a);
1039
+
1040
+ GGML_API struct ggml_tensor * ggml_cumsum(
1041
+ struct ggml_context * ctx,
1042
+ struct ggml_tensor * a);
1043
+
1044
+ // mean along rows
1045
+ GGML_API struct ggml_tensor * ggml_mean(
1046
+ struct ggml_context * ctx,
1047
+ struct ggml_tensor * a);
1048
+
1049
+ // argmax along rows
1050
+ GGML_API struct ggml_tensor * ggml_argmax(
1051
+ struct ggml_context * ctx,
1052
+ struct ggml_tensor * a);
1053
+
1054
+ // count number of equal elements in a and b
1055
+ GGML_API struct ggml_tensor * ggml_count_equal(
1056
+ struct ggml_context * ctx,
1057
+ struct ggml_tensor * a,
1058
+ struct ggml_tensor * b);
1059
+
1060
+ // if a is the same shape as b, and a is not parameter, return a
1061
+ // otherwise, return a new tensor: repeat(a) to fit in b
1062
+ GGML_API struct ggml_tensor * ggml_repeat(
1063
+ struct ggml_context * ctx,
1064
+ struct ggml_tensor * a,
1065
+ struct ggml_tensor * b);
1066
+
1067
+ // repeat a to the specified shape
1068
+ GGML_API struct ggml_tensor * ggml_repeat_4d(
1069
+ struct ggml_context * ctx,
1070
+ struct ggml_tensor * a,
1071
+ int64_t ne0,
1072
+ int64_t ne1,
1073
+ int64_t ne2,
1074
+ int64_t ne3);
1075
+
1076
+ // sums repetitions in a into shape of b
1077
+ GGML_API struct ggml_tensor * ggml_repeat_back(
1078
+ struct ggml_context * ctx,
1079
+ struct ggml_tensor * a,
1080
+ struct ggml_tensor * b); // sum up values that are adjacent in dims > 0 instead of repeated with same stride
1081
+
1082
+ // concat a and b along dim
1083
+ // used in stable-diffusion
1084
+ GGML_API struct ggml_tensor * ggml_concat(
1085
+ struct ggml_context * ctx,
1086
+ struct ggml_tensor * a,
1087
+ struct ggml_tensor * b,
1088
+ int dim);
1089
+
1090
+ GGML_API struct ggml_tensor * ggml_abs(
1091
+ struct ggml_context * ctx,
1092
+ struct ggml_tensor * a);
1093
+
1094
+ GGML_API struct ggml_tensor * ggml_abs_inplace(
1095
+ struct ggml_context * ctx,
1096
+ struct ggml_tensor * a);
1097
+
1098
+ GGML_API struct ggml_tensor * ggml_sgn(
1099
+ struct ggml_context * ctx,
1100
+ struct ggml_tensor * a);
1101
+
1102
+ GGML_API struct ggml_tensor * ggml_sgn_inplace(
1103
+ struct ggml_context * ctx,
1104
+ struct ggml_tensor * a);
1105
+
1106
+ GGML_API struct ggml_tensor * ggml_neg(
1107
+ struct ggml_context * ctx,
1108
+ struct ggml_tensor * a);
1109
+
1110
+ GGML_API struct ggml_tensor * ggml_neg_inplace(
1111
+ struct ggml_context * ctx,
1112
+ struct ggml_tensor * a);
1113
+
1114
+ GGML_API struct ggml_tensor * ggml_step(
1115
+ struct ggml_context * ctx,
1116
+ struct ggml_tensor * a);
1117
+
1118
+ GGML_API struct ggml_tensor * ggml_step_inplace(
1119
+ struct ggml_context * ctx,
1120
+ struct ggml_tensor * a);
1121
+
1122
+ GGML_API struct ggml_tensor * ggml_tanh(
1123
+ struct ggml_context * ctx,
1124
+ struct ggml_tensor * a);
1125
+
1126
+ GGML_API struct ggml_tensor * ggml_tanh_inplace(
1127
+ struct ggml_context * ctx,
1128
+ struct ggml_tensor * a);
1129
+
1130
+ GGML_API struct ggml_tensor * ggml_elu(
1131
+ struct ggml_context * ctx,
1132
+ struct ggml_tensor * a);
1133
+
1134
+ GGML_API struct ggml_tensor * ggml_elu_inplace(
1135
+ struct ggml_context * ctx,
1136
+ struct ggml_tensor * a);
1137
+
1138
+ GGML_API struct ggml_tensor * ggml_relu(
1139
+ struct ggml_context * ctx,
1140
+ struct ggml_tensor * a);
1141
+
1142
+ GGML_API struct ggml_tensor * ggml_leaky_relu(
1143
+ struct ggml_context * ctx,
1144
+ struct ggml_tensor * a, float negative_slope, bool inplace);
1145
+
1146
+ GGML_API struct ggml_tensor * ggml_relu_inplace(
1147
+ struct ggml_context * ctx,
1148
+ struct ggml_tensor * a);
1149
+
1150
+ GGML_API struct ggml_tensor * ggml_sigmoid(
1151
+ struct ggml_context * ctx,
1152
+ struct ggml_tensor * a);
1153
+
1154
+ GGML_API struct ggml_tensor * ggml_sigmoid_inplace(
1155
+ struct ggml_context * ctx,
1156
+ struct ggml_tensor * a);
1157
+
1158
+ GGML_API struct ggml_tensor * ggml_gelu(
1159
+ struct ggml_context * ctx,
1160
+ struct ggml_tensor * a);
1161
+
1162
+ GGML_API struct ggml_tensor * ggml_gelu_inplace(
1163
+ struct ggml_context * ctx,
1164
+ struct ggml_tensor * a);
1165
+
1166
+ // GELU using erf (error function) when possible
1167
+ // some backends may fallback to approximation based on Abramowitz and Stegun formula
1168
+ GGML_API struct ggml_tensor * ggml_gelu_erf(
1169
+ struct ggml_context * ctx,
1170
+ struct ggml_tensor * a);
1171
+
1172
+ GGML_API struct ggml_tensor * ggml_gelu_erf_inplace(
1173
+ struct ggml_context * ctx,
1174
+ struct ggml_tensor * a);
1175
+
1176
+ GGML_API struct ggml_tensor * ggml_gelu_quick(
1177
+ struct ggml_context * ctx,
1178
+ struct ggml_tensor * a);
1179
+
1180
+ GGML_API struct ggml_tensor * ggml_gelu_quick_inplace(
1181
+ struct ggml_context * ctx,
1182
+ struct ggml_tensor * a);
1183
+
1184
+ GGML_API struct ggml_tensor * ggml_silu(
1185
+ struct ggml_context * ctx,
1186
+ struct ggml_tensor * a);
1187
+
1188
+ GGML_API struct ggml_tensor * ggml_silu_inplace(
1189
+ struct ggml_context * ctx,
1190
+ struct ggml_tensor * a);
1191
+
1192
+ // a - dy
1193
+ // b - x
1194
+ GGML_API struct ggml_tensor * ggml_silu_back(
1195
+ struct ggml_context * ctx,
1196
+ struct ggml_tensor * a,
1197
+ struct ggml_tensor * b);
1198
+
1199
+ // hardswish(x) = x * relu6(x + 3) / 6
1200
+ GGML_API struct ggml_tensor * ggml_hardswish(
1201
+ struct ggml_context * ctx,
1202
+ struct ggml_tensor * a);
1203
+
1204
+ // hardsigmoid(x) = relu6(x + 3) / 6
1205
+ GGML_API struct ggml_tensor * ggml_hardsigmoid(
1206
+ struct ggml_context * ctx,
1207
+ struct ggml_tensor * a);
1208
+
1209
+ GGML_API struct ggml_tensor * ggml_exp(
1210
+ struct ggml_context * ctx,
1211
+ struct ggml_tensor * a);
1212
+
1213
+ GGML_API struct ggml_tensor * ggml_exp_inplace(
1214
+ struct ggml_context * ctx,
1215
+ struct ggml_tensor * a);
1216
+
1217
+ GGML_API struct ggml_tensor * ggml_floor(
1218
+ struct ggml_context * ctx,
1219
+ struct ggml_tensor * a);
1220
+
1221
+ GGML_API struct ggml_tensor * ggml_floor_inplace(
1222
+ struct ggml_context * ctx,
1223
+ struct ggml_tensor * a);
1224
+
1225
+ GGML_API struct ggml_tensor * ggml_ceil(
1226
+ struct ggml_context * ctx,
1227
+ struct ggml_tensor * a);
1228
+
1229
+ GGML_API struct ggml_tensor * ggml_ceil_inplace(
1230
+ struct ggml_context * ctx,
1231
+ struct ggml_tensor * a);
1232
+
1233
+ GGML_API struct ggml_tensor * ggml_round(
1234
+ struct ggml_context * ctx,
1235
+ struct ggml_tensor * a);
1236
+
1237
+ GGML_API struct ggml_tensor * ggml_round_inplace(
1238
+ struct ggml_context * ctx,
1239
+ struct ggml_tensor * a);
1240
+
1241
+ /**
1242
+ * Truncates the fractional part of each element in the tensor (towards zero).
1243
+ * For example: trunc(3.7) = 3.0, trunc(-2.9) = -2.0
1244
+ * Similar to std::trunc in C/C++.
1245
+ */
1246
+
1247
+ GGML_API struct ggml_tensor * ggml_trunc(
1248
+ struct ggml_context * ctx,
1249
+ struct ggml_tensor * a);
1250
+
1251
+ GGML_API struct ggml_tensor * ggml_trunc_inplace(
1252
+ struct ggml_context * ctx,
1253
+ struct ggml_tensor * a);
1254
+
1255
+
1256
+
1257
+ // xIELU activation function
1258
+ // x = x * (c_a(alpha_n) + c_b(alpha_p, beta) * sigmoid(beta * x)) + eps * (x > 0)
1259
+ // where c_a = softplus and c_b(a, b) = softplus(a) + b are constraining functions
1260
+ // that constrain the positive and negative source alpha values respectively
1261
+ GGML_API struct ggml_tensor * ggml_xielu(
1262
+ struct ggml_context * ctx,
1263
+ struct ggml_tensor * a,
1264
+ float alpha_n,
1265
+ float alpha_p,
1266
+ float beta,
1267
+ float eps);
1268
+
1269
+ // gated linear unit ops
1270
+ // A: n columns, r rows,
1271
+ // result is n / 2 columns, r rows,
1272
+ // expects gate in second half of row, unless swapped is true
1273
+ GGML_API struct ggml_tensor * ggml_glu(
1274
+ struct ggml_context * ctx,
1275
+ struct ggml_tensor * a,
1276
+ enum ggml_glu_op op,
1277
+ bool swapped);
1278
+
1279
+ GGML_API struct ggml_tensor * ggml_reglu(
1280
+ struct ggml_context * ctx,
1281
+ struct ggml_tensor * a);
1282
+
1283
+ GGML_API struct ggml_tensor * ggml_reglu_swapped(
1284
+ struct ggml_context * ctx,
1285
+ struct ggml_tensor * a);
1286
+
1287
+ GGML_API struct ggml_tensor * ggml_geglu(
1288
+ struct ggml_context * ctx,
1289
+ struct ggml_tensor * a);
1290
+
1291
+ GGML_API struct ggml_tensor * ggml_geglu_swapped(
1292
+ struct ggml_context * ctx,
1293
+ struct ggml_tensor * a);
1294
+
1295
+ GGML_API struct ggml_tensor * ggml_swiglu(
1296
+ struct ggml_context * ctx,
1297
+ struct ggml_tensor * a);
1298
+
1299
+ GGML_API struct ggml_tensor * ggml_swiglu_swapped(
1300
+ struct ggml_context * ctx,
1301
+ struct ggml_tensor * a);
1302
+
1303
+ GGML_API struct ggml_tensor * ggml_geglu_erf(
1304
+ struct ggml_context * ctx,
1305
+ struct ggml_tensor * a);
1306
+
1307
+ GGML_API struct ggml_tensor * ggml_geglu_erf_swapped(
1308
+ struct ggml_context * ctx,
1309
+ struct ggml_tensor * a);
1310
+
1311
+ GGML_API struct ggml_tensor * ggml_geglu_quick(
1312
+ struct ggml_context * ctx,
1313
+ struct ggml_tensor * a);
1314
+
1315
+ GGML_API struct ggml_tensor * ggml_geglu_quick_swapped(
1316
+ struct ggml_context * ctx,
1317
+ struct ggml_tensor * a);
1318
+
1319
+ // A: n columns, r rows,
1320
+ // B: n columns, r rows,
1321
+ GGML_API struct ggml_tensor * ggml_glu_split(
1322
+ struct ggml_context * ctx,
1323
+ struct ggml_tensor * a,
1324
+ struct ggml_tensor * b,
1325
+ enum ggml_glu_op op);
1326
+
1327
+ GGML_API struct ggml_tensor * ggml_reglu_split(
1328
+ struct ggml_context * ctx,
1329
+ struct ggml_tensor * a,
1330
+ struct ggml_tensor * b);
1331
+
1332
+ GGML_API struct ggml_tensor * ggml_geglu_split(
1333
+ struct ggml_context * ctx,
1334
+ struct ggml_tensor * a,
1335
+ struct ggml_tensor * b);
1336
+
1337
+ GGML_API struct ggml_tensor * ggml_swiglu_split(
1338
+ struct ggml_context * ctx,
1339
+ struct ggml_tensor * a,
1340
+ struct ggml_tensor * b);
1341
+
1342
+ GGML_API struct ggml_tensor * ggml_geglu_erf_split(
1343
+ struct ggml_context * ctx,
1344
+ struct ggml_tensor * a,
1345
+ struct ggml_tensor * b);
1346
+
1347
+ GGML_API struct ggml_tensor * ggml_geglu_quick_split(
1348
+ struct ggml_context * ctx,
1349
+ struct ggml_tensor * a,
1350
+ struct ggml_tensor * b);
1351
+
1352
+ GGML_API struct ggml_tensor * ggml_swiglu_oai(
1353
+ struct ggml_context * ctx,
1354
+ struct ggml_tensor * a,
1355
+ struct ggml_tensor * b,
1356
+ float alpha,
1357
+ float limit);
1358
+
1359
+ // normalize along rows
1360
+ GGML_API struct ggml_tensor * ggml_norm(
1361
+ struct ggml_context * ctx,
1362
+ struct ggml_tensor * a,
1363
+ float eps);
1364
+
1365
+ GGML_API struct ggml_tensor * ggml_norm_inplace(
1366
+ struct ggml_context * ctx,
1367
+ struct ggml_tensor * a,
1368
+ float eps);
1369
+
1370
+ GGML_API struct ggml_tensor * ggml_rms_norm(
1371
+ struct ggml_context * ctx,
1372
+ struct ggml_tensor * a,
1373
+ float eps);
1374
+
1375
+ GGML_API struct ggml_tensor * ggml_rms_norm_inplace(
1376
+ struct ggml_context * ctx,
1377
+ struct ggml_tensor * a,
1378
+ float eps);
1379
+
1380
+ // group normalize along ne0*ne1*n_groups
1381
+ // used in stable-diffusion
1382
+ GGML_API struct ggml_tensor * ggml_group_norm(
1383
+ struct ggml_context * ctx,
1384
+ struct ggml_tensor * a,
1385
+ int n_groups,
1386
+ float eps);
1387
+
1388
+ GGML_API struct ggml_tensor * ggml_group_norm_inplace(
1389
+ struct ggml_context * ctx,
1390
+ struct ggml_tensor * a,
1391
+ int n_groups,
1392
+ float eps);
1393
+
1394
+ // l2 normalize along rows
1395
+ // used in rwkv v7
1396
+ GGML_API struct ggml_tensor * ggml_l2_norm(
1397
+ struct ggml_context * ctx,
1398
+ struct ggml_tensor * a,
1399
+ float eps);
1400
+
1401
+ GGML_API struct ggml_tensor * ggml_l2_norm_inplace(
1402
+ struct ggml_context * ctx,
1403
+ struct ggml_tensor * a,
1404
+ float eps);
1405
+
1406
+ // a - x
1407
+ // b - dy
1408
+ GGML_API struct ggml_tensor * ggml_rms_norm_back(
1409
+ struct ggml_context * ctx,
1410
+ struct ggml_tensor * a,
1411
+ struct ggml_tensor * b,
1412
+ float eps);
1413
+
1414
+ // A: k columns, n rows => [ne03, ne02, n, k]
1415
+ // B: k columns, m rows (i.e. we transpose it internally) => [ne03 * x, ne02 * y, m, k]
1416
+ // result is n columns, m rows => [ne03 * x, ne02 * y, m, n]
1417
+ GGML_API struct ggml_tensor * ggml_mul_mat(
1418
+ struct ggml_context * ctx,
1419
+ struct ggml_tensor * a,
1420
+ struct ggml_tensor * b);
1421
+
1422
+ // change the precision of a matrix multiplication
1423
+ // set to GGML_PREC_F32 for higher precision (useful for phi-2)
1424
+ GGML_API void ggml_mul_mat_set_prec(
1425
+ struct ggml_tensor * a,
1426
+ enum ggml_prec prec);
1427
+
1428
+ // change the hint of a matrix multiplication
1429
+ GGML_API void ggml_mul_mat_set_hint(
1430
+ struct ggml_tensor * a,
1431
+ enum ggml_op_hint hint);
1432
+
1433
+ // indirect matrix multiplication
1434
+ GGML_API struct ggml_tensor * ggml_mul_mat_id(
1435
+ struct ggml_context * ctx,
1436
+ struct ggml_tensor * as,
1437
+ struct ggml_tensor * b,
1438
+ struct ggml_tensor * ids);
1439
+
1440
+ // A: m columns, n rows,
1441
+ // B: p columns, n rows,
1442
+ // result is m columns, p rows
1443
+ GGML_API struct ggml_tensor * ggml_out_prod(
1444
+ struct ggml_context * ctx,
1445
+ struct ggml_tensor * a,
1446
+ struct ggml_tensor * b);
1447
+
1448
+ //
1449
+ // operations on tensors without backpropagation
1450
+ //
1451
+
1452
+ GGML_API struct ggml_tensor * ggml_scale(
1453
+ struct ggml_context * ctx,
1454
+ struct ggml_tensor * a,
1455
+ float s);
1456
+
1457
+ // in-place, returns view(a)
1458
+ GGML_API struct ggml_tensor * ggml_scale_inplace(
1459
+ struct ggml_context * ctx,
1460
+ struct ggml_tensor * a,
1461
+ float s);
1462
+
1463
+ // x = s * a + b
1464
+ GGML_API struct ggml_tensor * ggml_scale_bias(
1465
+ struct ggml_context * ctx,
1466
+ struct ggml_tensor * a,
1467
+ float s,
1468
+ float b);
1469
+
1470
+ GGML_API struct ggml_tensor * ggml_scale_bias_inplace(
1471
+ struct ggml_context * ctx,
1472
+ struct ggml_tensor * a,
1473
+ float s,
1474
+ float b);
1475
+
1476
+ // b -> view(a,offset,nb1,nb2,3), return modified a
1477
+ GGML_API struct ggml_tensor * ggml_set(
1478
+ struct ggml_context * ctx,
1479
+ struct ggml_tensor * a,
1480
+ struct ggml_tensor * b,
1481
+ size_t nb1,
1482
+ size_t nb2,
1483
+ size_t nb3,
1484
+ size_t offset); // in bytes
1485
+
1486
+ // b -> view(a,offset,nb1,nb2,3), return view(a)
1487
+ GGML_API struct ggml_tensor * ggml_set_inplace(
1488
+ struct ggml_context * ctx,
1489
+ struct ggml_tensor * a,
1490
+ struct ggml_tensor * b,
1491
+ size_t nb1,
1492
+ size_t nb2,
1493
+ size_t nb3,
1494
+ size_t offset); // in bytes
1495
+
1496
+ GGML_API struct ggml_tensor * ggml_set_1d(
1497
+ struct ggml_context * ctx,
1498
+ struct ggml_tensor * a,
1499
+ struct ggml_tensor * b,
1500
+ size_t offset); // in bytes
1501
+
1502
+ GGML_API struct ggml_tensor * ggml_set_1d_inplace(
1503
+ struct ggml_context * ctx,
1504
+ struct ggml_tensor * a,
1505
+ struct ggml_tensor * b,
1506
+ size_t offset); // in bytes
1507
+
1508
+ // b -> view(a,offset,nb1,nb2,3), return modified a
1509
+ GGML_API struct ggml_tensor * ggml_set_2d(
1510
+ struct ggml_context * ctx,
1511
+ struct ggml_tensor * a,
1512
+ struct ggml_tensor * b,
1513
+ size_t nb1,
1514
+ size_t offset); // in bytes
1515
+
1516
+ // b -> view(a,offset,nb1,nb2,3), return view(a)
1517
+ GGML_API struct ggml_tensor * ggml_set_2d_inplace(
1518
+ struct ggml_context * ctx,
1519
+ struct ggml_tensor * a,
1520
+ struct ggml_tensor * b,
1521
+ size_t nb1,
1522
+ size_t offset); // in bytes
1523
+
1524
+ // a -> b, return view(b)
1525
+ GGML_API struct ggml_tensor * ggml_cpy(
1526
+ struct ggml_context * ctx,
1527
+ struct ggml_tensor * a,
1528
+ struct ggml_tensor * b);
1529
+
1530
+ // note: casting from f32 to i32 will discard the fractional part
1531
+ GGML_API struct ggml_tensor * ggml_cast(
1532
+ struct ggml_context * ctx,
1533
+ struct ggml_tensor * a,
1534
+ enum ggml_type type);
1535
+
1536
+ // make contiguous
1537
+ GGML_API struct ggml_tensor * ggml_cont(
1538
+ struct ggml_context * ctx,
1539
+ struct ggml_tensor * a);
1540
+
1541
+ // make contiguous, with new shape
1542
+ GGML_API struct ggml_tensor * ggml_cont_1d(
1543
+ struct ggml_context * ctx,
1544
+ struct ggml_tensor * a,
1545
+ int64_t ne0);
1546
+
1547
+ GGML_API struct ggml_tensor * ggml_cont_2d(
1548
+ struct ggml_context * ctx,
1549
+ struct ggml_tensor * a,
1550
+ int64_t ne0,
1551
+ int64_t ne1);
1552
+
1553
+ GGML_API struct ggml_tensor * ggml_cont_3d(
1554
+ struct ggml_context * ctx,
1555
+ struct ggml_tensor * a,
1556
+ int64_t ne0,
1557
+ int64_t ne1,
1558
+ int64_t ne2);
1559
+
1560
+ GGML_API struct ggml_tensor * ggml_cont_4d(
1561
+ struct ggml_context * ctx,
1562
+ struct ggml_tensor * a,
1563
+ int64_t ne0,
1564
+ int64_t ne1,
1565
+ int64_t ne2,
1566
+ int64_t ne3);
1567
+
1568
+ // return view(a), b specifies the new shape
1569
+ // TODO: when we start computing gradient, make a copy instead of view
1570
+ GGML_API struct ggml_tensor * ggml_reshape(
1571
+ struct ggml_context * ctx,
1572
+ struct ggml_tensor * a,
1573
+ struct ggml_tensor * b);
1574
+
1575
+ // return view(a)
1576
+ // TODO: when we start computing gradient, make a copy instead of view
1577
+ GGML_API struct ggml_tensor * ggml_reshape_1d(
1578
+ struct ggml_context * ctx,
1579
+ struct ggml_tensor * a,
1580
+ int64_t ne0);
1581
+
1582
+ GGML_API struct ggml_tensor * ggml_reshape_2d(
1583
+ struct ggml_context * ctx,
1584
+ struct ggml_tensor * a,
1585
+ int64_t ne0,
1586
+ int64_t ne1);
1587
+
1588
+ // return view(a)
1589
+ // TODO: when we start computing gradient, make a copy instead of view
1590
+ GGML_API struct ggml_tensor * ggml_reshape_3d(
1591
+ struct ggml_context * ctx,
1592
+ struct ggml_tensor * a,
1593
+ int64_t ne0,
1594
+ int64_t ne1,
1595
+ int64_t ne2);
1596
+
1597
+ GGML_API struct ggml_tensor * ggml_reshape_4d(
1598
+ struct ggml_context * ctx,
1599
+ struct ggml_tensor * a,
1600
+ int64_t ne0,
1601
+ int64_t ne1,
1602
+ int64_t ne2,
1603
+ int64_t ne3);
1604
+
1605
+ // offset in bytes
1606
+ GGML_API struct ggml_tensor * ggml_view_1d(
1607
+ struct ggml_context * ctx,
1608
+ struct ggml_tensor * a,
1609
+ int64_t ne0,
1610
+ size_t offset);
1611
+
1612
+ GGML_API struct ggml_tensor * ggml_view_2d(
1613
+ struct ggml_context * ctx,
1614
+ struct ggml_tensor * a,
1615
+ int64_t ne0,
1616
+ int64_t ne1,
1617
+ size_t nb1, // row stride in bytes
1618
+ size_t offset);
1619
+
1620
+ GGML_API struct ggml_tensor * ggml_view_3d(
1621
+ struct ggml_context * ctx,
1622
+ struct ggml_tensor * a,
1623
+ int64_t ne0,
1624
+ int64_t ne1,
1625
+ int64_t ne2,
1626
+ size_t nb1, // row stride in bytes
1627
+ size_t nb2, // slice stride in bytes
1628
+ size_t offset);
1629
+
1630
+ GGML_API struct ggml_tensor * ggml_view_4d(
1631
+ struct ggml_context * ctx,
1632
+ struct ggml_tensor * a,
1633
+ int64_t ne0,
1634
+ int64_t ne1,
1635
+ int64_t ne2,
1636
+ int64_t ne3,
1637
+ size_t nb1, // row stride in bytes
1638
+ size_t nb2, // slice stride in bytes
1639
+ size_t nb3,
1640
+ size_t offset);
1641
+
1642
+ GGML_API struct ggml_tensor * ggml_permute(
1643
+ struct ggml_context * ctx,
1644
+ struct ggml_tensor * a,
1645
+ int axis0,
1646
+ int axis1,
1647
+ int axis2,
1648
+ int axis3);
1649
+
1650
+ // alias for ggml_permute(ctx, a, 1, 0, 2, 3)
1651
+ GGML_API struct ggml_tensor * ggml_transpose(
1652
+ struct ggml_context * ctx,
1653
+ struct ggml_tensor * a);
1654
+
1655
+ // supports 4D a:
1656
+ // a [n_embd, ne1, ne2, ne3]
1657
+ // b I32 [n_rows, ne2, ne3, 1]
1658
+ //
1659
+ // return [n_embd, n_rows, ne2, ne3]
1660
+ GGML_API struct ggml_tensor * ggml_get_rows(
1661
+ struct ggml_context * ctx,
1662
+ struct ggml_tensor * a, // data
1663
+ struct ggml_tensor * b); // row indices
1664
+
1665
+ GGML_API struct ggml_tensor * ggml_get_rows_back(
1666
+ struct ggml_context * ctx,
1667
+ struct ggml_tensor * a, // gradients of ggml_get_rows result
1668
+ struct ggml_tensor * b, // row indices
1669
+ struct ggml_tensor * c); // data for ggml_get_rows, only used for its shape
1670
+
1671
+ // a TD [n_embd, ne1, ne2, ne3]
1672
+ // b TS [n_embd, n_rows, ne02, ne03] | ne02 == ne2, ne03 == ne3
1673
+ // c I64 [n_rows, ne11, ne12, 1] | c[i] in [0, ne1)
1674
+ //
1675
+ // undefined behavior if destination rows overlap
1676
+ //
1677
+ // broadcast:
1678
+ // ne2 % ne11 == 0
1679
+ // ne3 % ne12 == 0
1680
+ //
1681
+ // return view(a)
1682
+ GGML_API struct ggml_tensor * ggml_set_rows(
1683
+ struct ggml_context * ctx,
1684
+ struct ggml_tensor * a, // destination
1685
+ struct ggml_tensor * b, // source
1686
+ struct ggml_tensor * c); // row indices
1687
+
1688
+ GGML_API struct ggml_tensor * ggml_diag(
1689
+ struct ggml_context * ctx,
1690
+ struct ggml_tensor * a);
1691
+
1692
+ // set elements above the diagonal to -INF
1693
+ GGML_API struct ggml_tensor * ggml_diag_mask_inf(
1694
+ struct ggml_context * ctx,
1695
+ struct ggml_tensor * a,
1696
+ int n_past);
1697
+
1698
+ // in-place, returns view(a)
1699
+ GGML_API struct ggml_tensor * ggml_diag_mask_inf_inplace(
1700
+ struct ggml_context * ctx,
1701
+ struct ggml_tensor * a,
1702
+ int n_past);
1703
+
1704
+ // set elements above the diagonal to 0
1705
+ GGML_API struct ggml_tensor * ggml_diag_mask_zero(
1706
+ struct ggml_context * ctx,
1707
+ struct ggml_tensor * a,
1708
+ int n_past);
1709
+
1710
+ // in-place, returns view(a)
1711
+ GGML_API struct ggml_tensor * ggml_diag_mask_zero_inplace(
1712
+ struct ggml_context * ctx,
1713
+ struct ggml_tensor * a,
1714
+ int n_past);
1715
+
1716
+ GGML_API struct ggml_tensor * ggml_soft_max(
1717
+ struct ggml_context * ctx,
1718
+ struct ggml_tensor * a);
1719
+
1720
+ // in-place, returns view(a)
1721
+ GGML_API struct ggml_tensor * ggml_soft_max_inplace(
1722
+ struct ggml_context * ctx,
1723
+ struct ggml_tensor * a);
1724
+
1725
+ // a [ne0, ne01, ne02, ne03]
1726
+ // mask [ne0, ne11, ne12, ne13] | ne11 >= ne01, F16 or F32, optional
1727
+ //
1728
+ // broadcast:
1729
+ // ne02 % ne12 == 0
1730
+ // ne03 % ne13 == 0
1731
+ //
1732
+ // fused soft_max(a*scale + mask*(ALiBi slope))
1733
+ // max_bias = 0.0f for no ALiBi
1734
+ GGML_API struct ggml_tensor * ggml_soft_max_ext(
1735
+ struct ggml_context * ctx,
1736
+ struct ggml_tensor * a,
1737
+ struct ggml_tensor * mask,
1738
+ float scale,
1739
+ float max_bias);
1740
+
1741
+ GGML_API struct ggml_tensor * ggml_soft_max_ext_inplace(
1742
+ struct ggml_context * ctx,
1743
+ struct ggml_tensor * a,
1744
+ struct ggml_tensor * mask,
1745
+ float scale,
1746
+ float max_bias);
1747
+
1748
+ GGML_API void ggml_soft_max_add_sinks(
1749
+ struct ggml_tensor * a,
1750
+ struct ggml_tensor * sinks);
1751
+
1752
+ GGML_API struct ggml_tensor * ggml_soft_max_ext_back(
1753
+ struct ggml_context * ctx,
1754
+ struct ggml_tensor * a,
1755
+ struct ggml_tensor * b,
1756
+ float scale,
1757
+ float max_bias);
1758
+
1759
+ // in-place, returns view(a)
1760
+ GGML_API struct ggml_tensor * ggml_soft_max_ext_back_inplace(
1761
+ struct ggml_context * ctx,
1762
+ struct ggml_tensor * a,
1763
+ struct ggml_tensor * b,
1764
+ float scale,
1765
+ float max_bias);
1766
+
1767
+ // rotary position embedding
1768
+ // if (mode & 1) - skip n_past elements (NOT SUPPORTED)
1769
+ // if (mode & GGML_ROPE_TYPE_NEOX) - GPT-NeoX style
1770
+ //
1771
+ // b is an int32 vector with size a->ne[2], it contains the positions
1772
+ GGML_API struct ggml_tensor * ggml_rope(
1773
+ struct ggml_context * ctx,
1774
+ struct ggml_tensor * a,
1775
+ struct ggml_tensor * b,
1776
+ int n_dims,
1777
+ int mode);
1778
+
1779
+ // in-place, returns view(a)
1780
+ GGML_API struct ggml_tensor * ggml_rope_inplace(
1781
+ struct ggml_context * ctx,
1782
+ struct ggml_tensor * a,
1783
+ struct ggml_tensor * b,
1784
+ int n_dims,
1785
+ int mode);
1786
+
1787
+ // RoPE operations with extended options
1788
+ // a is the input tensor to apply RoPE to, shape [n_embd, n_head, n_token]
1789
+ // b is an int32 vector with size n_token
1790
+ // c is freq factors (e.g. phi3-128k), (optional)
1791
+ // mode can be GGML_ROPE_TYPE_NORMAL or NEOX; for MROPE and VISION mode, use ggml_rope_multi
1792
+ //
1793
+ // pseudo-code for computing theta:
1794
+ // for i in [0, n_dims/2):
1795
+ // theta[i] = b[i] * powf(freq_base, -2.0 * i / n_dims);
1796
+ // theta[i] = theta[i] / c[i]; # if c is provided, divide theta by c
1797
+ // theta[i] = rope_yarn(theta[i], ...); # note: theta = theta * freq_scale is applied here
1798
+ //
1799
+ // other params are used by YaRN RoPE scaling, these default values will disable YaRN:
1800
+ // freq_scale = 1.0f
1801
+ // ext_factor = 0.0f
1802
+ // attn_factor = 1.0f
1803
+ // beta_fast = 0.0f
1804
+ // beta_slow = 0.0f
1805
+ //
1806
+ // example:
1807
+ // (marking: c = cos, s = sin, 0 = unrotated)
1808
+ // given a single head with size = 8 --> [00000000]
1809
+ // GGML_ROPE_TYPE_NORMAL n_dims = 4 --> [cscs0000]
1810
+ // GGML_ROPE_TYPE_NORMAL n_dims = 8 --> [cscscscs]
1811
+ // GGML_ROPE_TYPE_NEOX n_dims = 4 --> [ccss0000]
1812
+ // GGML_ROPE_TYPE_NEOX n_dims = 8 --> [ccccssss]
1813
+ GGML_API struct ggml_tensor * ggml_rope_ext(
1814
+ struct ggml_context * ctx,
1815
+ struct ggml_tensor * a,
1816
+ struct ggml_tensor * b,
1817
+ struct ggml_tensor * c,
1818
+ int n_dims,
1819
+ int mode,
1820
+ int n_ctx_orig,
1821
+ float freq_base,
1822
+ float freq_scale,
1823
+ float ext_factor,
1824
+ float attn_factor,
1825
+ float beta_fast,
1826
+ float beta_slow);
1827
+
1828
+ // multi-dimensional RoPE, for Qwen-VL and similar vision models
1829
+ // mode can be either VISION, MROPE, IMROPE, cannot be combined with NORMAL or NEOX
1830
+ // sections specify how many dimensions to rotate in each section:
1831
+ // section length is equivalent to number of cos/sin pairs, NOT the number of dims
1832
+ // (i.e. sum of 4 sections are expected to be n_dims/2)
1833
+ // last sections can be 0, means ignored
1834
+ // all other options are identical to ggml_rope_ext
1835
+ //
1836
+ // important note:
1837
+ // - NEOX ordering is automatically applied and cannot be disabled for MROPE and VISION
1838
+ // if you need normal ordering, there are 2 methods:
1839
+ // (1) split the tensor manually using ggml_view
1840
+ // (2) permute the weight upon conversion
1841
+ // - for VISION, n_dims must be head_size/2
1842
+ //
1843
+ // example M-RoPE:
1844
+ // given sections = [t=4, y=2, x=2, 0]
1845
+ // given a single head with size = 18 --> [000000000000000000]
1846
+ // GGML_ROPE_TYPE_MROPE n_dims = 16 --> [ttttyyxxttttyyxx00] (cos/sin are applied in NEOX ordering)
1847
+ // GGML_ROPE_TYPE_IMROPE n_dims = 16 --> [ttyxttyxttyxttyx00] (interleaved M-RoPE, still NEOX ordering)
1848
+ // note: the theta for each dim is computed the same way as ggml_rope_ext, no matter the section
1849
+ // in other words, idx used for theta: [0123456789... until n_dims/2], not reset for each section
1850
+ //
1851
+ // example vision RoPE:
1852
+ // given sections = [y=4, x=4, 0, 0] (last 2 sections are ignored)
1853
+ // given a single head with size = 8 --> [00000000]
1854
+ // GGML_ROPE_TYPE_VISION n_dims = 4 --> [yyyyxxxx]
1855
+ // other values of n_dims are untested and is undefined behavior
1856
+ // note: unlike MROPE, the theta for each dim is computed differently for each section
1857
+ // in other words, idx used for theta: [0123] for y section, then [0123] for x section
1858
+ GGML_API struct ggml_tensor * ggml_rope_multi(
1859
+ struct ggml_context * ctx,
1860
+ struct ggml_tensor * a,
1861
+ struct ggml_tensor * b,
1862
+ struct ggml_tensor * c,
1863
+ int n_dims,
1864
+ int sections[GGML_MROPE_SECTIONS],
1865
+ int mode,
1866
+ int n_ctx_orig,
1867
+ float freq_base,
1868
+ float freq_scale,
1869
+ float ext_factor,
1870
+ float attn_factor,
1871
+ float beta_fast,
1872
+ float beta_slow);
1873
+
1874
+ // in-place, returns view(a)
1875
+ GGML_API struct ggml_tensor * ggml_rope_ext_inplace(
1876
+ struct ggml_context * ctx,
1877
+ struct ggml_tensor * a,
1878
+ struct ggml_tensor * b,
1879
+ struct ggml_tensor * c,
1880
+ int n_dims,
1881
+ int mode,
1882
+ int n_ctx_orig,
1883
+ float freq_base,
1884
+ float freq_scale,
1885
+ float ext_factor,
1886
+ float attn_factor,
1887
+ float beta_fast,
1888
+ float beta_slow);
1889
+
1890
+ GGML_API struct ggml_tensor * ggml_rope_multi_inplace(
1891
+ struct ggml_context * ctx,
1892
+ struct ggml_tensor * a,
1893
+ struct ggml_tensor * b,
1894
+ struct ggml_tensor * c,
1895
+ int n_dims,
1896
+ int sections[GGML_MROPE_SECTIONS],
1897
+ int mode,
1898
+ int n_ctx_orig,
1899
+ float freq_base,
1900
+ float freq_scale,
1901
+ float ext_factor,
1902
+ float attn_factor,
1903
+ float beta_fast,
1904
+ float beta_slow);
1905
+
1906
+ GGML_DEPRECATED(GGML_API struct ggml_tensor * ggml_rope_custom(
1907
+ struct ggml_context * ctx,
1908
+ struct ggml_tensor * a,
1909
+ struct ggml_tensor * b,
1910
+ int n_dims,
1911
+ int mode,
1912
+ int n_ctx_orig,
1913
+ float freq_base,
1914
+ float freq_scale,
1915
+ float ext_factor,
1916
+ float attn_factor,
1917
+ float beta_fast,
1918
+ float beta_slow),
1919
+ "use ggml_rope_ext instead");
1920
+
1921
+ GGML_DEPRECATED(GGML_API struct ggml_tensor * ggml_rope_custom_inplace(
1922
+ struct ggml_context * ctx,
1923
+ struct ggml_tensor * a,
1924
+ struct ggml_tensor * b,
1925
+ int n_dims,
1926
+ int mode,
1927
+ int n_ctx_orig,
1928
+ float freq_base,
1929
+ float freq_scale,
1930
+ float ext_factor,
1931
+ float attn_factor,
1932
+ float beta_fast,
1933
+ float beta_slow),
1934
+ "use ggml_rope_ext_inplace instead");
1935
+
1936
+ // compute correction dims for YaRN RoPE scaling
1937
+ GGML_API void ggml_rope_yarn_corr_dims(
1938
+ int n_dims, int n_ctx_orig, float freq_base, float beta_fast, float beta_slow, float dims[2]);
1939
+
1940
+ // rotary position embedding backward, i.e compute dx from dy
1941
+ // a - dy
1942
+ GGML_API struct ggml_tensor * ggml_rope_ext_back(
1943
+ struct ggml_context * ctx,
1944
+ struct ggml_tensor * a, // gradients of ggml_rope result
1945
+ struct ggml_tensor * b, // positions
1946
+ struct ggml_tensor * c, // freq factors
1947
+ int n_dims,
1948
+ int mode,
1949
+ int n_ctx_orig,
1950
+ float freq_base,
1951
+ float freq_scale,
1952
+ float ext_factor,
1953
+ float attn_factor,
1954
+ float beta_fast,
1955
+ float beta_slow);
1956
+
1957
+ GGML_API struct ggml_tensor * ggml_rope_multi_back(
1958
+ struct ggml_context * ctx,
1959
+ struct ggml_tensor * a,
1960
+ struct ggml_tensor * b,
1961
+ struct ggml_tensor * c,
1962
+ int n_dims,
1963
+ int sections[4],
1964
+ int mode,
1965
+ int n_ctx_orig,
1966
+ float freq_base,
1967
+ float freq_scale,
1968
+ float ext_factor,
1969
+ float attn_factor,
1970
+ float beta_fast,
1971
+ float beta_slow);
1972
+
1973
+
1974
+ // clamp
1975
+ // in-place, returns view(a)
1976
+ GGML_API struct ggml_tensor * ggml_clamp(
1977
+ struct ggml_context * ctx,
1978
+ struct ggml_tensor * a,
1979
+ float min,
1980
+ float max);
1981
+
1982
+ // im2col
1983
+ // converts data into a format that effectively results in a convolution when combined with matrix multiplication
1984
+ GGML_API struct ggml_tensor * ggml_im2col(
1985
+ struct ggml_context * ctx,
1986
+ struct ggml_tensor * a, // convolution kernel
1987
+ struct ggml_tensor * b, // data
1988
+ int s0, // stride dimension 0
1989
+ int s1, // stride dimension 1
1990
+ int p0, // padding dimension 0
1991
+ int p1, // padding dimension 1
1992
+ int d0, // dilation dimension 0
1993
+ int d1, // dilation dimension 1
1994
+ bool is_2D,
1995
+ enum ggml_type dst_type);
1996
+
1997
+ GGML_API struct ggml_tensor * ggml_im2col_back(
1998
+ struct ggml_context * ctx,
1999
+ struct ggml_tensor * a, // convolution kernel
2000
+ struct ggml_tensor * b, // gradient of im2col output
2001
+ int64_t * ne, // shape of im2col input
2002
+ int s0, // stride dimension 0
2003
+ int s1, // stride dimension 1
2004
+ int p0, // padding dimension 0
2005
+ int p1, // padding dimension 1
2006
+ int d0, // dilation dimension 0
2007
+ int d1, // dilation dimension 1
2008
+ bool is_2D);
2009
+
2010
+ GGML_API struct ggml_tensor * ggml_conv_1d(
2011
+ struct ggml_context * ctx,
2012
+ struct ggml_tensor * a, // convolution kernel
2013
+ struct ggml_tensor * b, // data
2014
+ int s0, // stride
2015
+ int p0, // padding
2016
+ int d0); // dilation
2017
+
2018
+ // conv_1d with padding = half
2019
+ // alias for ggml_conv_1d(a, b, s, a->ne[0]/2, d)
2020
+ GGML_API struct ggml_tensor* ggml_conv_1d_ph(
2021
+ struct ggml_context * ctx,
2022
+ struct ggml_tensor * a, // convolution kernel
2023
+ struct ggml_tensor * b, // data
2024
+ int s, // stride
2025
+ int d); // dilation
2026
+
2027
+ // depthwise
2028
+ // TODO: this is very likely wrong for some cases! - needs more testing
2029
+ GGML_API struct ggml_tensor * ggml_conv_1d_dw(
2030
+ struct ggml_context * ctx,
2031
+ struct ggml_tensor * a, // convolution kernel
2032
+ struct ggml_tensor * b, // data
2033
+ int s0, // stride
2034
+ int p0, // padding
2035
+ int d0); // dilation
2036
+
2037
+ GGML_API struct ggml_tensor * ggml_conv_1d_dw_ph(
2038
+ struct ggml_context * ctx,
2039
+ struct ggml_tensor * a, // convolution kernel
2040
+ struct ggml_tensor * b, // data
2041
+ int s0, // stride
2042
+ int d0); // dilation
2043
+
2044
+ GGML_API struct ggml_tensor * ggml_conv_transpose_1d(
2045
+ struct ggml_context * ctx,
2046
+ struct ggml_tensor * a, // convolution kernel
2047
+ struct ggml_tensor * b, // data
2048
+ int s0, // stride
2049
+ int p0, // padding
2050
+ int d0); // dilation
2051
+
2052
+ GGML_API struct ggml_tensor * ggml_conv_2d(
2053
+ struct ggml_context * ctx,
2054
+ struct ggml_tensor * a, // convolution kernel
2055
+ struct ggml_tensor * b, // data
2056
+ int s0, // stride dimension 0
2057
+ int s1, // stride dimension 1
2058
+ int p0, // padding dimension 0
2059
+ int p1, // padding dimension 1
2060
+ int d0, // dilation dimension 0
2061
+ int d1); // dilation dimension 1
2062
+
2063
+ GGML_API struct ggml_tensor * ggml_im2col_3d(
2064
+ struct ggml_context * ctx,
2065
+ struct ggml_tensor * a,
2066
+ struct ggml_tensor * b,
2067
+ int64_t IC,
2068
+ int s0, // stride width
2069
+ int s1, // stride height
2070
+ int s2, // stride depth
2071
+ int p0, // padding width
2072
+ int p1, // padding height
2073
+ int p2, // padding depth
2074
+ int d0, // dilation width
2075
+ int d1, // dilation height
2076
+ int d2, // dilation depth
2077
+ enum ggml_type dst_type);
2078
+
2079
+ // a: [OC*IC, KD, KH, KW]
2080
+ // b: [N*IC, ID, IH, IW]
2081
+ // result: [N*OC, OD, OH, OW]
2082
+ GGML_API struct ggml_tensor * ggml_conv_3d(
2083
+ struct ggml_context * ctx,
2084
+ struct ggml_tensor * a,
2085
+ struct ggml_tensor * b,
2086
+ int64_t IC,
2087
+ int s0, // stride width
2088
+ int s1, // stride height
2089
+ int s2, // stride depth
2090
+ int p0, // padding width
2091
+ int p1, // padding height
2092
+ int p2, // padding depth
2093
+ int d0, // dilation width
2094
+ int d1, // dilation height
2095
+ int d2 // dilation depth
2096
+ );
2097
+
2098
+ // kernel size is a->ne[0] x a->ne[1]
2099
+ // stride is equal to kernel size
2100
+ // padding is zero
2101
+ // example:
2102
+ // a: 16 16 3 768
2103
+ // b: 1024 1024 3 1
2104
+ // res: 64 64 768 1
2105
+ // used in sam
2106
+ GGML_API struct ggml_tensor * ggml_conv_2d_sk_p0(
2107
+ struct ggml_context * ctx,
2108
+ struct ggml_tensor * a,
2109
+ struct ggml_tensor * b);
2110
+
2111
+ // kernel size is a->ne[0] x a->ne[1]
2112
+ // stride is 1
2113
+ // padding is half
2114
+ // example:
2115
+ // a: 3 3 256 256
2116
+ // b: 64 64 256 1
2117
+ // res: 64 64 256 1
2118
+ // used in sam
2119
+ GGML_API struct ggml_tensor * ggml_conv_2d_s1_ph(
2120
+ struct ggml_context * ctx,
2121
+ struct ggml_tensor * a,
2122
+ struct ggml_tensor * b);
2123
+
2124
+ // depthwise (via im2col and mul_mat)
2125
+ GGML_API struct ggml_tensor * ggml_conv_2d_dw(
2126
+ struct ggml_context * ctx,
2127
+ struct ggml_tensor * a, // convolution kernel
2128
+ struct ggml_tensor * b, // data
2129
+ int s0, // stride dimension 0
2130
+ int s1, // stride dimension 1
2131
+ int p0, // padding dimension 0
2132
+ int p1, // padding dimension 1
2133
+ int d0, // dilation dimension 0
2134
+ int d1); // dilation dimension 1
2135
+
2136
+ // Depthwise 2D convolution
2137
+ // may be faster than ggml_conv_2d_dw, but not available in all backends
2138
+ // a: KW KH 1 C convolution kernel
2139
+ // b: W H C N input data
2140
+ // res: W_out H_out C N
2141
+ GGML_API struct ggml_tensor * ggml_conv_2d_dw_direct(
2142
+ struct ggml_context * ctx,
2143
+ struct ggml_tensor * a,
2144
+ struct ggml_tensor * b,
2145
+ int stride0,
2146
+ int stride1,
2147
+ int pad0,
2148
+ int pad1,
2149
+ int dilation0,
2150
+ int dilation1);
2151
+
2152
+ GGML_API struct ggml_tensor * ggml_conv_transpose_2d_p0(
2153
+ struct ggml_context * ctx,
2154
+ struct ggml_tensor * a,
2155
+ struct ggml_tensor * b,
2156
+ int stride);
2157
+
2158
+ GGML_API struct ggml_tensor * ggml_conv_2d_direct(
2159
+ struct ggml_context * ctx,
2160
+ struct ggml_tensor * a, // convolution kernel [KW, KH, IC, OC]
2161
+ struct ggml_tensor * b, // input data [W, H, C, N]
2162
+ int s0, // stride dimension 0
2163
+ int s1, // stride dimension 1
2164
+ int p0, // padding dimension 0
2165
+ int p1, // padding dimension 1
2166
+ int d0, // dilation dimension 0
2167
+ int d1); // dilation dimension 1
2168
+
2169
+ GGML_API struct ggml_tensor * ggml_conv_3d_direct(
2170
+ struct ggml_context * ctx,
2171
+ struct ggml_tensor * a, // kernel [KW, KH, KD, IC * OC]
2172
+ struct ggml_tensor * b, // input [W, H, D, C * N]
2173
+ int s0, // stride
2174
+ int s1,
2175
+ int s2,
2176
+ int p0, // padding
2177
+ int p1,
2178
+ int p2,
2179
+ int d0, // dilation
2180
+ int d1,
2181
+ int d2,
2182
+ int n_channels,
2183
+ int n_batch,
2184
+ int n_channels_out);
2185
+
2186
+ enum ggml_op_pool {
2187
+ GGML_OP_POOL_MAX,
2188
+ GGML_OP_POOL_AVG,
2189
+ GGML_OP_POOL_COUNT,
2190
+ };
2191
+
2192
+ GGML_API struct ggml_tensor * ggml_pool_1d(
2193
+ struct ggml_context * ctx,
2194
+ struct ggml_tensor * a,
2195
+ enum ggml_op_pool op,
2196
+ int k0, // kernel size
2197
+ int s0, // stride
2198
+ int p0); // padding
2199
+
2200
+ // the result will have 2*p0 padding for the first dimension
2201
+ // and 2*p1 padding for the second dimension
2202
+ GGML_API struct ggml_tensor * ggml_pool_2d(
2203
+ struct ggml_context * ctx,
2204
+ struct ggml_tensor * a,
2205
+ enum ggml_op_pool op,
2206
+ int k0,
2207
+ int k1,
2208
+ int s0,
2209
+ int s1,
2210
+ float p0,
2211
+ float p1);
2212
+
2213
+ GGML_API struct ggml_tensor * ggml_pool_2d_back(
2214
+ struct ggml_context * ctx,
2215
+ struct ggml_tensor * a,
2216
+ struct ggml_tensor * af, // "a"/input used in forward pass
2217
+ enum ggml_op_pool op,
2218
+ int k0,
2219
+ int k1,
2220
+ int s0,
2221
+ int s1,
2222
+ float p0,
2223
+ float p1);
2224
+
2225
+ enum ggml_scale_mode {
2226
+ GGML_SCALE_MODE_NEAREST = 0,
2227
+ GGML_SCALE_MODE_BILINEAR = 1,
2228
+ GGML_SCALE_MODE_BICUBIC = 2,
2229
+
2230
+ GGML_SCALE_MODE_COUNT
2231
+ };
2232
+
2233
+ enum ggml_scale_flag {
2234
+ GGML_SCALE_FLAG_ALIGN_CORNERS = (1 << 8),
2235
+ GGML_SCALE_FLAG_ANTIALIAS = (1 << 9),
2236
+ };
2237
+
2238
+ // interpolate
2239
+ // multiplies ne0 and ne1 by scale factor
2240
+ GGML_API struct ggml_tensor * ggml_upscale(
2241
+ struct ggml_context * ctx,
2242
+ struct ggml_tensor * a,
2243
+ int scale_factor,
2244
+ enum ggml_scale_mode mode);
2245
+
2246
+ // interpolate
2247
+ // interpolate scale to specified dimensions
2248
+ GGML_DEPRECATED(GGML_API struct ggml_tensor * ggml_upscale_ext(
2249
+ struct ggml_context * ctx,
2250
+ struct ggml_tensor * a,
2251
+ int ne0,
2252
+ int ne1,
2253
+ int ne2,
2254
+ int ne3,
2255
+ enum ggml_scale_mode mode),
2256
+ "use ggml_interpolate instead");
2257
+
2258
+ // Up- or downsamples the input to the specified size.
2259
+ // 2D scale modes (eg. bilinear) are applied to the first two dimensions.
2260
+ GGML_API struct ggml_tensor * ggml_interpolate(
2261
+ struct ggml_context * ctx,
2262
+ struct ggml_tensor * a,
2263
+ int64_t ne0,
2264
+ int64_t ne1,
2265
+ int64_t ne2,
2266
+ int64_t ne3,
2267
+ uint32_t mode); // ggml_scale_mode [ | ggml_scale_flag...]
2268
+
2269
+ // pad each dimension with zeros: [x, ..., x] -> [x, ..., x, 0, ..., 0]
2270
+ GGML_API struct ggml_tensor * ggml_pad(
2271
+ struct ggml_context * ctx,
2272
+ struct ggml_tensor * a,
2273
+ int p0,
2274
+ int p1,
2275
+ int p2,
2276
+ int p3);
2277
+
2278
+ // pad each dimension with values on the other side of the torus (looping around)
2279
+ GGML_API struct ggml_tensor * ggml_pad_circular(
2280
+ struct ggml_context * ctx,
2281
+ struct ggml_tensor * a,
2282
+ int p0,
2283
+ int p1,
2284
+ int p2,
2285
+ int p3);
2286
+
2287
+ GGML_API struct ggml_tensor * ggml_pad_ext(
2288
+ struct ggml_context * ctx,
2289
+ struct ggml_tensor * a,
2290
+ int lp0,
2291
+ int rp0,
2292
+ int lp1,
2293
+ int rp1,
2294
+ int lp2,
2295
+ int rp2,
2296
+ int lp3,
2297
+ int rp3
2298
+ );
2299
+
2300
+ // pad each dimension with values on the other side of the torus (looping around)
2301
+ GGML_API struct ggml_tensor * ggml_pad_ext_circular(
2302
+ struct ggml_context * ctx,
2303
+ struct ggml_tensor * a,
2304
+ int lp0,
2305
+ int rp0,
2306
+ int lp1,
2307
+ int rp1,
2308
+ int lp2,
2309
+ int rp2,
2310
+ int lp3,
2311
+ int rp3);
2312
+
2313
+ // pad each dimension with reflection: [a, b, c, d] -> [b, a, b, c, d, c]
2314
+ GGML_API struct ggml_tensor * ggml_pad_reflect_1d(
2315
+ struct ggml_context * ctx,
2316
+ struct ggml_tensor * a,
2317
+ int p0,
2318
+ int p1);
2319
+
2320
+ // Move tensor elements by an offset given for each dimension. Elements that
2321
+ // are shifted beyond the last position are wrapped around to the beginning.
2322
+ GGML_API struct ggml_tensor * ggml_roll(
2323
+ struct ggml_context * ctx,
2324
+ struct ggml_tensor * a,
2325
+ int shift0,
2326
+ int shift1,
2327
+ int shift2,
2328
+ int shift3);
2329
+
2330
+ // Convert matrix into a triangular one (upper, strict upper, lower or strict lower) by writing
2331
+ // zeroes everywhere outside the masked area
2332
+ GGML_API struct ggml_tensor * ggml_tri(
2333
+ struct ggml_context * ctx,
2334
+ struct ggml_tensor * a,
2335
+ enum ggml_tri_type type);
2336
+
2337
+ // Fill tensor a with constant c
2338
+ GGML_API struct ggml_tensor * ggml_fill(
2339
+ struct ggml_context * ctx,
2340
+ struct ggml_tensor * a,
2341
+ float c);
2342
+
2343
+ GGML_API struct ggml_tensor * ggml_fill_inplace(
2344
+ struct ggml_context * ctx,
2345
+ struct ggml_tensor * a,
2346
+ float c);
2347
+
2348
+ // Ref: https://github.com/CompVis/stable-diffusion/blob/main/ldm/modules/diffusionmodules/util.py#L151
2349
+ // timesteps: [N,]
2350
+ // return: [N, dim]
2351
+ GGML_API struct ggml_tensor * ggml_timestep_embedding(
2352
+ struct ggml_context * ctx,
2353
+ struct ggml_tensor * timesteps,
2354
+ int dim,
2355
+ int max_period);
2356
+
2357
+ // sort rows
2358
+ enum ggml_sort_order {
2359
+ GGML_SORT_ORDER_ASC,
2360
+ GGML_SORT_ORDER_DESC,
2361
+ };
2362
+
2363
+ GGML_API struct ggml_tensor * ggml_argsort(
2364
+ struct ggml_context * ctx,
2365
+ struct ggml_tensor * a,
2366
+ enum ggml_sort_order order);
2367
+
2368
+ // similar to ggml_top_k but implemented as `argsort` + `view`
2369
+ GGML_API struct ggml_tensor * ggml_argsort_top_k(
2370
+ struct ggml_context * ctx,
2371
+ struct ggml_tensor * a,
2372
+ int k);
2373
+
2374
+ // top k elements per row
2375
+ // note: the resulting top k indices are in no particular order
2376
+ GGML_API struct ggml_tensor * ggml_top_k(
2377
+ struct ggml_context * ctx,
2378
+ struct ggml_tensor * a,
2379
+ int k);
2380
+
2381
+ GGML_API struct ggml_tensor * ggml_arange(
2382
+ struct ggml_context * ctx,
2383
+ float start,
2384
+ float stop,
2385
+ float step);
2386
+
2387
+ // q: [n_embd_k, n_batch, n_head, ne3 ]
2388
+ // k: [n_embd_k, n_kv, n_head_kv, ne3 ]
2389
+ // v: [n_embd_v, n_kv, n_head_kv, ne3 ] !! not transposed !!
2390
+ // mask: [n_kv, n_batch, ne32, ne33]
2391
+ // res: [n_embd_v, n_head, n_batch, ne3 ] !! permuted !!
2392
+ //
2393
+ // broadcast:
2394
+ // n_head % n_head_kv == 0
2395
+ // n_head % ne32 == 0
2396
+ // ne3 % ne33 == 0
2397
+ //
2398
+ GGML_API struct ggml_tensor * ggml_flash_attn_ext(
2399
+ struct ggml_context * ctx,
2400
+ struct ggml_tensor * q,
2401
+ struct ggml_tensor * k,
2402
+ struct ggml_tensor * v,
2403
+ struct ggml_tensor * mask,
2404
+ float scale,
2405
+ float max_bias,
2406
+ float logit_softcap);
2407
+
2408
+ GGML_API void ggml_flash_attn_ext_set_prec(
2409
+ struct ggml_tensor * a,
2410
+ enum ggml_prec prec);
2411
+
2412
+ GGML_API enum ggml_prec ggml_flash_attn_ext_get_prec(
2413
+ const struct ggml_tensor * a);
2414
+
2415
+ GGML_API void ggml_flash_attn_ext_add_sinks(
2416
+ struct ggml_tensor * a,
2417
+ struct ggml_tensor * sinks);
2418
+
2419
+ // TODO: needs to be adapted to ggml_flash_attn_ext
2420
+ GGML_API struct ggml_tensor * ggml_flash_attn_back(
2421
+ struct ggml_context * ctx,
2422
+ struct ggml_tensor * q,
2423
+ struct ggml_tensor * k,
2424
+ struct ggml_tensor * v,
2425
+ struct ggml_tensor * d,
2426
+ bool masked);
2427
+
2428
+ GGML_API struct ggml_tensor * ggml_ssm_conv(
2429
+ struct ggml_context * ctx,
2430
+ struct ggml_tensor * sx,
2431
+ struct ggml_tensor * c);
2432
+
2433
+ GGML_API struct ggml_tensor * ggml_ssm_scan(
2434
+ struct ggml_context * ctx,
2435
+ struct ggml_tensor * s,
2436
+ struct ggml_tensor * x,
2437
+ struct ggml_tensor * dt,
2438
+ struct ggml_tensor * A,
2439
+ struct ggml_tensor * B,
2440
+ struct ggml_tensor * C,
2441
+ struct ggml_tensor * ids);
2442
+
2443
+ // partition into non-overlapping windows with padding if needed
2444
+ // example:
2445
+ // a: 768 64 64 1
2446
+ // w: 14
2447
+ // res: 768 14 14 25
2448
+ // used in sam
2449
+ GGML_API struct ggml_tensor * ggml_win_part(
2450
+ struct ggml_context * ctx,
2451
+ struct ggml_tensor * a,
2452
+ int w);
2453
+
2454
+ // reverse of ggml_win_part
2455
+ // used in sam
2456
+ GGML_API struct ggml_tensor * ggml_win_unpart(
2457
+ struct ggml_context * ctx,
2458
+ struct ggml_tensor * a,
2459
+ int w0,
2460
+ int h0,
2461
+ int w);
2462
+
2463
+ GGML_API struct ggml_tensor * ggml_unary(
2464
+ struct ggml_context * ctx,
2465
+ struct ggml_tensor * a,
2466
+ enum ggml_unary_op op);
2467
+
2468
+ GGML_API struct ggml_tensor * ggml_unary_inplace(
2469
+ struct ggml_context * ctx,
2470
+ struct ggml_tensor * a,
2471
+ enum ggml_unary_op op);
2472
+
2473
+ // used in sam
2474
+ GGML_API struct ggml_tensor * ggml_get_rel_pos(
2475
+ struct ggml_context * ctx,
2476
+ struct ggml_tensor * a,
2477
+ int qh,
2478
+ int kh);
2479
+
2480
+ // used in sam
2481
+ GGML_API struct ggml_tensor * ggml_add_rel_pos(
2482
+ struct ggml_context * ctx,
2483
+ struct ggml_tensor * a,
2484
+ struct ggml_tensor * pw,
2485
+ struct ggml_tensor * ph);
2486
+
2487
+ GGML_API struct ggml_tensor * ggml_add_rel_pos_inplace(
2488
+ struct ggml_context * ctx,
2489
+ struct ggml_tensor * a,
2490
+ struct ggml_tensor * pw,
2491
+ struct ggml_tensor * ph);
2492
+
2493
+ GGML_API struct ggml_tensor * ggml_rwkv_wkv6(
2494
+ struct ggml_context * ctx,
2495
+ struct ggml_tensor * k,
2496
+ struct ggml_tensor * v,
2497
+ struct ggml_tensor * r,
2498
+ struct ggml_tensor * tf,
2499
+ struct ggml_tensor * td,
2500
+ struct ggml_tensor * state);
2501
+
2502
+ GGML_API struct ggml_tensor * ggml_gated_linear_attn(
2503
+ struct ggml_context * ctx,
2504
+ struct ggml_tensor * k,
2505
+ struct ggml_tensor * v,
2506
+ struct ggml_tensor * q,
2507
+ struct ggml_tensor * g,
2508
+ struct ggml_tensor * state,
2509
+ float scale);
2510
+
2511
+ GGML_API struct ggml_tensor * ggml_rwkv_wkv7(
2512
+ struct ggml_context * ctx,
2513
+ struct ggml_tensor * r,
2514
+ struct ggml_tensor * w,
2515
+ struct ggml_tensor * k,
2516
+ struct ggml_tensor * v,
2517
+ struct ggml_tensor * a,
2518
+ struct ggml_tensor * b,
2519
+ struct ggml_tensor * state);
2520
+
2521
+ /* Solves a specific equation of the form Ax=B, where A is a triangular matrix
2522
+ * without zeroes on the diagonal (i.e. invertible).
2523
+ * B can have any number of columns, but must have the same number of rows as A
2524
+ * If A is [n, n] and B is [n, m], then the result will be [n, m] as well
2525
+ * Has O(n^3) complexity (unlike most matrix ops out there), so use on cases
2526
+ * where n > 100 sparingly, pre-chunk if necessary.
2527
+ *
2528
+ * If left = false, solves xA=B instead
2529
+ * If lower = false, assumes upper triangular instead
2530
+ * If uni = true, assumes diagonal of A to be all ones (will override actual values)
2531
+ *
2532
+ * TODO: currently only lower, right, non-unitriangular variant is implemented
2533
+ */
2534
+ GGML_API struct ggml_tensor * ggml_solve_tri(
2535
+ struct ggml_context * ctx,
2536
+ struct ggml_tensor * a,
2537
+ struct ggml_tensor * b,
2538
+ bool left,
2539
+ bool lower,
2540
+ bool uni);
2541
+
2542
+ // TODO: add ggml_gated_delta_net_set_bcast() to be able to configure Q, K broadcast type: tiled vs interleaved [TAG_GGML_GDN_BCAST]
2543
+ // ref: https://github.com/ggml-org/llama.cpp/pull/19468#discussion_r2786394306
2544
+ //
2545
+ // state is a 3D tensor of shape (S_v*S_v*H, K, n_seqs):
2546
+ // K == 1: output carries the final state only.
2547
+ // K > 1: output carries K snapshot slots; the kernel writes the last min(n_tokens, K)
2548
+ // per-token snapshots into the trailing slots
2549
+ GGML_API struct ggml_tensor * ggml_gated_delta_net(
2550
+ struct ggml_context * ctx,
2551
+ struct ggml_tensor * q,
2552
+ struct ggml_tensor * k,
2553
+ struct ggml_tensor * v,
2554
+ struct ggml_tensor * g,
2555
+ struct ggml_tensor * beta,
2556
+ struct ggml_tensor * state);
2557
+
2558
+ // custom operators
2559
+
2560
+ typedef void (*ggml_custom1_op_t)(struct ggml_tensor * dst , const struct ggml_tensor * a, int ith, int nth, void * userdata);
2561
+ typedef void (*ggml_custom2_op_t)(struct ggml_tensor * dst , const struct ggml_tensor * a, const struct ggml_tensor * b, int ith, int nth, void * userdata);
2562
+ typedef void (*ggml_custom3_op_t)(struct ggml_tensor * dst , const struct ggml_tensor * a, const struct ggml_tensor * b, const struct ggml_tensor * c, int ith, int nth, void * userdata);
2563
+
2564
+ #define GGML_N_TASKS_MAX (-1)
2565
+ // n_tasks == GGML_N_TASKS_MAX means to use max number of tasks
2566
+
2567
+ GGML_API struct ggml_tensor * ggml_map_custom1(
2568
+ struct ggml_context * ctx,
2569
+ struct ggml_tensor * a,
2570
+ ggml_custom1_op_t fun,
2571
+ int n_tasks,
2572
+ void * userdata);
2573
+
2574
+ GGML_API struct ggml_tensor * ggml_map_custom1_inplace(
2575
+ struct ggml_context * ctx,
2576
+ struct ggml_tensor * a,
2577
+ ggml_custom1_op_t fun,
2578
+ int n_tasks,
2579
+ void * userdata);
2580
+
2581
+ GGML_API struct ggml_tensor * ggml_map_custom2(
2582
+ struct ggml_context * ctx,
2583
+ struct ggml_tensor * a,
2584
+ struct ggml_tensor * b,
2585
+ ggml_custom2_op_t fun,
2586
+ int n_tasks,
2587
+ void * userdata);
2588
+
2589
+ GGML_API struct ggml_tensor * ggml_map_custom2_inplace(
2590
+ struct ggml_context * ctx,
2591
+ struct ggml_tensor * a,
2592
+ struct ggml_tensor * b,
2593
+ ggml_custom2_op_t fun,
2594
+ int n_tasks,
2595
+ void * userdata);
2596
+
2597
+ GGML_API struct ggml_tensor * ggml_map_custom3(
2598
+ struct ggml_context * ctx,
2599
+ struct ggml_tensor * a,
2600
+ struct ggml_tensor * b,
2601
+ struct ggml_tensor * c,
2602
+ ggml_custom3_op_t fun,
2603
+ int n_tasks,
2604
+ void * userdata);
2605
+
2606
+ GGML_API struct ggml_tensor * ggml_map_custom3_inplace(
2607
+ struct ggml_context * ctx,
2608
+ struct ggml_tensor * a,
2609
+ struct ggml_tensor * b,
2610
+ struct ggml_tensor * c,
2611
+ ggml_custom3_op_t fun,
2612
+ int n_tasks,
2613
+ void * userdata);
2614
+
2615
+ typedef void (*ggml_custom_op_t)(struct ggml_tensor * dst , int ith, int nth, void * userdata);
2616
+
2617
+ GGML_API struct ggml_tensor * ggml_custom_4d(
2618
+ struct ggml_context * ctx,
2619
+ enum ggml_type type,
2620
+ int64_t ne0,
2621
+ int64_t ne1,
2622
+ int64_t ne2,
2623
+ int64_t ne3,
2624
+ struct ggml_tensor ** args,
2625
+ int n_args,
2626
+ ggml_custom_op_t fun,
2627
+ int n_tasks,
2628
+ void * userdata);
2629
+
2630
+ GGML_API struct ggml_tensor * ggml_custom_inplace(
2631
+ struct ggml_context * ctx,
2632
+ struct ggml_tensor * a,
2633
+ struct ggml_tensor ** args,
2634
+ int n_args,
2635
+ ggml_custom_op_t fun,
2636
+ int n_tasks,
2637
+ void * userdata);
2638
+
2639
+ // loss function
2640
+
2641
+ GGML_API struct ggml_tensor * ggml_cross_entropy_loss(
2642
+ struct ggml_context * ctx,
2643
+ struct ggml_tensor * a, // logits
2644
+ struct ggml_tensor * b); // labels
2645
+
2646
+ GGML_API struct ggml_tensor * ggml_cross_entropy_loss_back(
2647
+ struct ggml_context * ctx,
2648
+ struct ggml_tensor * a, // logits
2649
+ struct ggml_tensor * b, // labels
2650
+ struct ggml_tensor * c); // gradients of cross_entropy_loss result
2651
+
2652
+ // AdamW optimizer step
2653
+ // Paper: https://arxiv.org/pdf/1711.05101v3.pdf
2654
+ // PyTorch: https://pytorch.org/docs/stable/generated/torch.optim.AdamW.html
2655
+ GGML_API struct ggml_tensor * ggml_opt_step_adamw(
2656
+ struct ggml_context * ctx,
2657
+ struct ggml_tensor * a,
2658
+ struct ggml_tensor * grad,
2659
+ struct ggml_tensor * m,
2660
+ struct ggml_tensor * v,
2661
+ struct ggml_tensor * adamw_params); // parameters such as the learning rate
2662
+
2663
+ // stochastic gradient descent step (with weight decay)
2664
+ GGML_API struct ggml_tensor * ggml_opt_step_sgd(
2665
+ struct ggml_context * ctx,
2666
+ struct ggml_tensor * a,
2667
+ struct ggml_tensor * grad,
2668
+ struct ggml_tensor * sgd_params); // alpha, weight decay
2669
+
2670
+ // build forward multiple tensors and select one of them for computing
2671
+ // this is useful for creating graphs that have constant topology but compute different things based on the input
2672
+ // ref: https://github.com/ggml-org/llama.cpp/pull/18550
2673
+ //
2674
+ // nodes:
2675
+ // | - build forward into the graph but do not compute
2676
+ // c - build forward into the graph and compute
2677
+ //
2678
+ // | | ... c ... |
2679
+ // | | ... c ... |
2680
+ // | | ... c ... |
2681
+ // [0 1 ... idx ... n-1] <-- ggml_build_forward_select(..., n, idx)
2682
+ // c
2683
+ // c
2684
+ //
2685
+ // example:
2686
+ // struct ggml_tensor * curs[3];
2687
+ //
2688
+ // curs[0] = compute0(...);
2689
+ // curs[1] = compute1(...);
2690
+ // curs[2] = compute2(...);
2691
+ //
2692
+ // int idx = select_branch(some_input);
2693
+ //
2694
+ // struct ggml_tensor * out = ggml_build_forward_select(cgraph, curs, 3, idx);
2695
+ //
2696
+ GGML_API struct ggml_tensor * ggml_build_forward_select(
2697
+ struct ggml_cgraph * cgraph,
2698
+ struct ggml_tensor ** tensors,
2699
+ int n_tensors,
2700
+ int idx);
2701
+
2702
+ GGML_API void ggml_build_forward_expand(
2703
+ struct ggml_cgraph * cgraph,
2704
+ struct ggml_tensor * tensor);
2705
+
2706
+ GGML_API void ggml_build_backward_expand(
2707
+ struct ggml_context * ctx, // context for gradient computation
2708
+ struct ggml_cgraph * cgraph,
2709
+ struct ggml_tensor ** grad_accs);
2710
+
2711
+ // graph allocation in a context
2712
+ GGML_API struct ggml_cgraph * ggml_new_graph (struct ggml_context * ctx); // size = GGML_DEFAULT_GRAPH_SIZE, grads = false
2713
+ GGML_API struct ggml_cgraph * ggml_new_graph_custom(struct ggml_context * ctx, size_t size, bool grads);
2714
+ GGML_API struct ggml_cgraph * ggml_graph_dup (struct ggml_context * ctx, struct ggml_cgraph * cgraph, bool force_grads);
2715
+ GGML_API void ggml_graph_cpy (struct ggml_cgraph * src, struct ggml_cgraph * dst);
2716
+ GGML_API void ggml_graph_reset (struct ggml_cgraph * cgraph); // set regular grads + optimizer momenta to 0, set loss grad to 1
2717
+ GGML_API void ggml_graph_clear (struct ggml_cgraph * cgraph);
2718
+
2719
+ GGML_API int ggml_graph_size (struct ggml_cgraph * cgraph);
2720
+ GGML_API struct ggml_tensor * ggml_graph_node (struct ggml_cgraph * cgraph, int i); // if i < 0, returns nodes[n_nodes + i]
2721
+ GGML_API struct ggml_tensor ** ggml_graph_nodes (struct ggml_cgraph * cgraph);
2722
+ GGML_API int ggml_graph_n_nodes(struct ggml_cgraph * cgraph);
2723
+
2724
+ GGML_API void ggml_graph_add_node(struct ggml_cgraph * cgraph, struct ggml_tensor * tensor);
2725
+
2726
+ GGML_API size_t ggml_graph_overhead(void);
2727
+ GGML_API size_t ggml_graph_overhead_custom(size_t size, bool grads);
2728
+
2729
+ GGML_API struct ggml_tensor * ggml_graph_get_tensor (const struct ggml_cgraph * cgraph, const char * name);
2730
+ GGML_API struct ggml_tensor * ggml_graph_get_grad (const struct ggml_cgraph * cgraph, const struct ggml_tensor * node);
2731
+ GGML_API struct ggml_tensor * ggml_graph_get_grad_acc(const struct ggml_cgraph * cgraph, const struct ggml_tensor * node);
2732
+
2733
+ // print info and performance information for the graph
2734
+ GGML_API void ggml_graph_print(const struct ggml_cgraph * cgraph);
2735
+
2736
+ // dump the graph into a file using the dot format
2737
+ GGML_API void ggml_graph_dump_dot(const struct ggml_cgraph * gb, const struct ggml_cgraph * cgraph, const char * filename);
2738
+
2739
+ // TODO these functions were sandwiched in the old optimization interface, is there a better place for them?
2740
+ typedef void (*ggml_log_callback)(enum ggml_log_level level, const char * text, void * user_data);
2741
+
2742
+ // Set callback for all future logging events.
2743
+ // If this is not called, or NULL is supplied, everything is output on stderr.
2744
+ GGML_API void ggml_log_get(ggml_log_callback * log_callback, void ** user_data);
2745
+ GGML_API void ggml_log_set(ggml_log_callback log_callback, void * user_data);
2746
+
2747
+ GGML_API struct ggml_tensor * ggml_set_zero(struct ggml_tensor * tensor);
2748
+
2749
+ //
2750
+ // quantization
2751
+ //
2752
+
2753
+ // - ggml_quantize_init can be called multiple times with the same type
2754
+ // it will only initialize the quantization tables for the first call or after ggml_quantize_free
2755
+ // automatically called by ggml_quantize_chunk for convenience
2756
+ //
2757
+ // - ggml_quantize_free will free any memory allocated by ggml_quantize_init
2758
+ // call this at the end of the program to avoid memory leaks
2759
+ //
2760
+ // note: these are thread-safe
2761
+ //
2762
+ GGML_API void ggml_quantize_init(enum ggml_type type);
2763
+ GGML_API void ggml_quantize_free(void);
2764
+
2765
+ // some quantization type cannot be used without an importance matrix
2766
+ GGML_API bool ggml_quantize_requires_imatrix(enum ggml_type type);
2767
+
2768
+ // calls ggml_quantize_init internally (i.e. can allocate memory)
2769
+ GGML_API size_t ggml_quantize_chunk(
2770
+ enum ggml_type type,
2771
+ const float * src,
2772
+ void * dst,
2773
+ int64_t start,
2774
+ int64_t nrows,
2775
+ int64_t n_per_row,
2776
+ const float * imatrix);
2777
+
2778
+ #ifdef __cplusplus
2779
+ // restrict not standard in C++
2780
+ # if defined(__GNUC__)
2781
+ # define GGML_RESTRICT __restrict__
2782
+ # elif defined(__clang__)
2783
+ # define GGML_RESTRICT __restrict
2784
+ # elif defined(_MSC_VER)
2785
+ # define GGML_RESTRICT __restrict
2786
+ # else
2787
+ # define GGML_RESTRICT
2788
+ # endif
2789
+ #else
2790
+ # if defined (_MSC_VER) && (__STDC_VERSION__ < 201112L)
2791
+ # define GGML_RESTRICT __restrict
2792
+ # else
2793
+ # define GGML_RESTRICT restrict
2794
+ # endif
2795
+ #endif
2796
+ typedef void (*ggml_to_float_t) (const void * GGML_RESTRICT x, float * GGML_RESTRICT y, int64_t k);
2797
+ typedef void (*ggml_from_float_t)(const float * GGML_RESTRICT x, void * GGML_RESTRICT y, int64_t k);
2798
+
2799
+ struct ggml_type_traits {
2800
+ const char * type_name;
2801
+ int64_t blck_size;
2802
+ int64_t blck_size_interleave; // interleave elements in blocks
2803
+ size_t type_size;
2804
+ bool is_quantized;
2805
+ ggml_to_float_t to_float;
2806
+ ggml_from_float_t from_float_ref;
2807
+ };
2808
+
2809
+ GGML_API const struct ggml_type_traits * ggml_get_type_traits(enum ggml_type type);
2810
+
2811
+ // ggml threadpool
2812
+ // TODO: currently, only a few functions are in the base ggml API, while the rest are in the CPU backend
2813
+ // the goal should be to create an API that other backends can use move everything to the ggml base
2814
+
2815
+ // scheduling priorities
2816
+ enum ggml_sched_priority {
2817
+ GGML_SCHED_PRIO_LOW = -1,
2818
+ GGML_SCHED_PRIO_NORMAL,
2819
+ GGML_SCHED_PRIO_MEDIUM,
2820
+ GGML_SCHED_PRIO_HIGH,
2821
+ GGML_SCHED_PRIO_REALTIME
2822
+ };
2823
+
2824
+ // threadpool params
2825
+ // Use ggml_threadpool_params_default() or ggml_threadpool_params_init() to populate the defaults
2826
+ struct ggml_threadpool_params {
2827
+ bool cpumask[GGML_MAX_N_THREADS]; // mask of cpu cores (all-zeros means use default affinity settings)
2828
+ int n_threads; // number of threads
2829
+ enum ggml_sched_priority prio; // thread priority
2830
+ uint32_t poll; // polling level (0 - no polling, 100 - aggressive polling)
2831
+ bool strict_cpu; // strict cpu placement
2832
+ bool paused; // start in paused state
2833
+ };
2834
+
2835
+ struct ggml_threadpool; // forward declaration, see ggml.c
2836
+
2837
+ typedef struct ggml_threadpool * ggml_threadpool_t;
2838
+
2839
+ GGML_API struct ggml_threadpool_params ggml_threadpool_params_default(int n_threads);
2840
+ GGML_API void ggml_threadpool_params_init (struct ggml_threadpool_params * p, int n_threads);
2841
+ GGML_API bool ggml_threadpool_params_match (const struct ggml_threadpool_params * p0, const struct ggml_threadpool_params * p1);
2842
+
2843
+ #ifdef __cplusplus
2844
+ }
2845
+ #endif