@novastera-oss/llamarn 0.0.1-alpha.4
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.
- package/INTERFACE.md +389 -0
- package/LICENSE +201 -0
- package/README.md +235 -0
- package/RNLlamaCpp.podspec +69 -0
- package/android/CMakeLists.txt +107 -0
- package/android/build.gradle +111 -0
- package/android/generated/java/com/novastera/llamarn/NativeRNLlamaCppSpec.java +47 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/RNLlamaCppSpec-generated.cpp +44 -0
- package/android/generated/jni/RNLlamaCppSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/RNLlamaCppSpec/RNLlamaCppSpecJSI-generated.cpp +42 -0
- package/android/generated/jni/react/renderer/components/RNLlamaCppSpec/RNLlamaCppSpecJSI.h +336 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/cpp/include/llama-cpp.h +30 -0
- package/android/src/main/cpp/include/llama.h +1440 -0
- package/android/src/main/java/com/novastera/llamarn/RNLlamaCppPackage.kt +21 -0
- package/android/src/main/jniLibs/arm64-v8a/libOpenCL.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libggml-base.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libggml-cpu.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libggml.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libllama.so +0 -0
- package/android/src/main/jniLibs/x86_64/libOpenCL.so +0 -0
- package/android/src/main/jniLibs/x86_64/libggml-base.so +0 -0
- package/android/src/main/jniLibs/x86_64/libggml-cpu.so +0 -0
- package/android/src/main/jniLibs/x86_64/libggml.so +0 -0
- package/android/src/main/jniLibs/x86_64/libllama.so +0 -0
- package/cpp/LlamaCppModel.cpp +984 -0
- package/cpp/LlamaCppModel.h +162 -0
- package/cpp/PureCppImpl.cpp +308 -0
- package/cpp/PureCppImpl.h +59 -0
- package/cpp/SystemUtils.cpp +180 -0
- package/cpp/SystemUtils.h +74 -0
- package/cpp/build-info.cpp +4 -0
- package/cpp/llama.cpp/AUTHORS +1106 -0
- package/cpp/llama.cpp/CMakeLists.txt +254 -0
- package/cpp/llama.cpp/CMakePresets.json +84 -0
- package/cpp/llama.cpp/CODEOWNERS +11 -0
- package/cpp/llama.cpp/CONTRIBUTING.md +127 -0
- package/cpp/llama.cpp/LICENSE +21 -0
- package/cpp/llama.cpp/Makefile +1608 -0
- package/cpp/llama.cpp/README.md +575 -0
- package/cpp/llama.cpp/SECURITY.md +68 -0
- package/cpp/llama.cpp/build-xcframework.sh +540 -0
- package/cpp/llama.cpp/cmake/arm64-apple-clang.cmake +16 -0
- package/cpp/llama.cpp/cmake/arm64-windows-llvm.cmake +16 -0
- package/cpp/llama.cpp/cmake/build-info.cmake +64 -0
- package/cpp/llama.cpp/cmake/common.cmake +35 -0
- package/cpp/llama.cpp/cmake/git-vars.cmake +22 -0
- package/cpp/llama.cpp/cmake/llama-config.cmake.in +30 -0
- package/cpp/llama.cpp/cmake/llama.pc.in +10 -0
- package/cpp/llama.cpp/cmake/x64-windows-llvm.cmake +5 -0
- package/cpp/llama.cpp/common/CMakeLists.txt +170 -0
- package/cpp/llama.cpp/common/arg.cpp +3337 -0
- package/cpp/llama.cpp/common/arg.h +89 -0
- package/cpp/llama.cpp/common/base64.hpp +392 -0
- package/cpp/llama.cpp/common/build-info.cpp.in +4 -0
- package/cpp/llama.cpp/common/chat.cpp +1781 -0
- package/cpp/llama.cpp/common/chat.h +135 -0
- package/cpp/llama.cpp/common/cmake/build-info-gen-cpp.cmake +24 -0
- package/cpp/llama.cpp/common/common.cpp +1567 -0
- package/cpp/llama.cpp/common/common.h +668 -0
- package/cpp/llama.cpp/common/console.cpp +504 -0
- package/cpp/llama.cpp/common/console.h +19 -0
- package/cpp/llama.cpp/common/json-schema-to-grammar.cpp +1027 -0
- package/cpp/llama.cpp/common/json-schema-to-grammar.h +21 -0
- package/cpp/llama.cpp/common/json.hpp +24766 -0
- package/cpp/llama.cpp/common/llguidance.cpp +254 -0
- package/cpp/llama.cpp/common/log.cpp +393 -0
- package/cpp/llama.cpp/common/log.h +103 -0
- package/cpp/llama.cpp/common/minja/chat-template.hpp +537 -0
- package/cpp/llama.cpp/common/minja/minja.hpp +2941 -0
- package/cpp/llama.cpp/common/ngram-cache.cpp +286 -0
- package/cpp/llama.cpp/common/ngram-cache.h +101 -0
- package/cpp/llama.cpp/common/sampling.cpp +580 -0
- package/cpp/llama.cpp/common/sampling.h +107 -0
- package/cpp/llama.cpp/common/speculative.cpp +278 -0
- package/cpp/llama.cpp/common/speculative.h +28 -0
- package/cpp/llama.cpp/common/stb_image.h +7988 -0
- package/cpp/llama.cpp/convert_hf_to_gguf.py +6195 -0
- package/cpp/llama.cpp/convert_hf_to_gguf_update.py +393 -0
- package/cpp/llama.cpp/convert_llama_ggml_to_gguf.py +450 -0
- package/cpp/llama.cpp/convert_lora_to_gguf.py +461 -0
- package/cpp/llama.cpp/flake.lock +58 -0
- package/cpp/llama.cpp/flake.nix +185 -0
- package/cpp/llama.cpp/ggml/CMakeLists.txt +388 -0
- package/cpp/llama.cpp/ggml/cmake/GitVars.cmake +22 -0
- package/cpp/llama.cpp/ggml/cmake/common.cmake +26 -0
- package/cpp/llama.cpp/ggml/cmake/ggml-config.cmake.in +152 -0
- package/cpp/llama.cpp/ggml/include/ggml-alloc.h +76 -0
- package/cpp/llama.cpp/ggml/include/ggml-backend.h +354 -0
- package/cpp/llama.cpp/ggml/include/ggml-blas.h +25 -0
- package/cpp/llama.cpp/ggml/include/ggml-cann.h +123 -0
- package/cpp/llama.cpp/ggml/include/ggml-cpp.h +39 -0
- package/cpp/llama.cpp/ggml/include/ggml-cpu.h +143 -0
- package/cpp/llama.cpp/ggml/include/ggml-cuda.h +47 -0
- package/cpp/llama.cpp/ggml/include/ggml-kompute.h +50 -0
- package/cpp/llama.cpp/ggml/include/ggml-metal.h +66 -0
- package/cpp/llama.cpp/ggml/include/ggml-opencl.h +26 -0
- package/cpp/llama.cpp/ggml/include/ggml-opt.h +216 -0
- package/cpp/llama.cpp/ggml/include/ggml-rpc.h +33 -0
- package/cpp/llama.cpp/ggml/include/ggml-sycl.h +49 -0
- package/cpp/llama.cpp/ggml/include/ggml-vulkan.h +29 -0
- package/cpp/llama.cpp/ggml/include/ggml.h +2192 -0
- package/cpp/llama.cpp/ggml/include/gguf.h +202 -0
- package/cpp/llama.cpp/ggml/src/CMakeLists.txt +345 -0
- package/cpp/llama.cpp/ggml/src/ggml-alloc.c +1042 -0
- package/cpp/llama.cpp/ggml/src/ggml-backend-impl.h +255 -0
- package/cpp/llama.cpp/ggml/src/ggml-backend-reg.cpp +586 -0
- package/cpp/llama.cpp/ggml/src/ggml-backend.cpp +2008 -0
- package/cpp/llama.cpp/ggml/src/ggml-blas/CMakeLists.txt +87 -0
- package/cpp/llama.cpp/ggml/src/ggml-blas/ggml-blas.cpp +517 -0
- package/cpp/llama.cpp/ggml/src/ggml-cann/CMakeLists.txt +74 -0
- package/cpp/llama.cpp/ggml/src/ggml-cann/Doxyfile +2579 -0
- package/cpp/llama.cpp/ggml/src/ggml-cann/acl_tensor.cpp +179 -0
- package/cpp/llama.cpp/ggml/src/ggml-cann/acl_tensor.h +258 -0
- package/cpp/llama.cpp/ggml/src/ggml-cann/aclnn_ops.cpp +2589 -0
- package/cpp/llama.cpp/ggml/src/ggml-cann/aclnn_ops.h +1083 -0
- package/cpp/llama.cpp/ggml/src/ggml-cann/common.h +420 -0
- package/cpp/llama.cpp/ggml/src/ggml-cann/ggml-cann.cpp +2554 -0
- package/cpp/llama.cpp/ggml/src/ggml-common.h +1857 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/CMakeLists.txt +495 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/amx/amx.cpp +221 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/amx/amx.h +8 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/amx/common.h +91 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/amx/mmq.cpp +2511 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/amx/mmq.h +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/binary-ops.cpp +158 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/binary-ops.h +16 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/cmake/FindSIMD.cmake +100 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/common.h +72 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/cpu-feats-x86.cpp +327 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp +6431 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-aarch64.h +8 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-hbm.cpp +55 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-hbm.h +8 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-impl.h +512 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c +13131 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.h +63 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-traits.cpp +36 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-traits.h +38 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/ggml-cpu.c +3492 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/ggml-cpu.cpp +671 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/kleidiai/kernels.cpp +254 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/kleidiai/kernels.h +60 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/kleidiai/kleidiai.cpp +287 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/kleidiai/kleidiai.h +17 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/llamafile/sgemm.cpp +3544 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/llamafile/sgemm.h +14 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/ops.cpp +8796 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/ops.h +110 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h +892 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/unary-ops.cpp +186 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/unary-ops.h +28 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/vec.cpp +252 -0
- package/cpp/llama.cpp/ggml/src/ggml-cpu/vec.h +802 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/CMakeLists.txt +184 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/acc.cu +47 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/acc.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/arange.cu +34 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/arange.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/argmax.cu +91 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/argmax.cuh +3 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/argsort.cu +104 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/argsort.cuh +3 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/binbcast.cu +363 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/binbcast.cuh +9 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/clamp.cu +45 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/clamp.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/common.cuh +828 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/concat.cu +221 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/concat.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/conv-transpose-1d.cu +89 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/conv-transpose-1d.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/convert.cu +730 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/convert.cuh +26 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/count-equal.cu +64 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/count-equal.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/cp-async.cuh +57 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/cpy.cu +695 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/cpy.cuh +11 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/cross-entropy-loss.cu +189 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/cross-entropy-loss.cuh +7 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/dequantize.cuh +103 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/diagmask.cu +40 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/diagmask.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/fattn-common.cuh +873 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/fattn-mma-f16.cuh +1269 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/fattn-tile-f16.cu +357 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/fattn-tile-f16.cuh +3 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/fattn-tile-f32.cu +365 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/fattn-tile-f32.cuh +3 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/fattn-vec-f16.cuh +437 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/fattn-vec-f32.cuh +428 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/fattn-wmma-f16.cu +634 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/fattn-wmma-f16.cuh +3 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/fattn.cu +345 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/fattn.cuh +3 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/getrows.cu +275 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/getrows.cuh +15 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/ggml-cuda.cu +3501 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/gla.cu +93 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/gla.cuh +3 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/im2col.cu +103 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/im2col.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/mma.cuh +396 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/mmq.cu +322 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/mmq.cuh +3217 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/mmv.cu +336 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/mmv.cuh +12 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/mmvq.cu +595 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/mmvq.cuh +12 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/norm.cu +458 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/norm.cuh +11 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/opt-step-adamw.cu +78 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/opt-step-adamw.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/out-prod.cu +68 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/out-prod.cuh +3 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/pad.cu +49 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/pad.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/pool2d.cu +94 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/pool2d.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/quantize.cu +189 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/quantize.cuh +27 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/rope.cu +456 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/rope.cuh +7 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/scale.cu +31 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/scale.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/softmax.cu +283 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/softmax.cuh +7 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/ssm-conv.cu +148 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/ssm-conv.cuh +3 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/ssm-scan.cu +153 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/ssm-scan.cuh +3 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/sum.cu +45 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/sum.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/sumrows.cu +39 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/sumrows.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_1-ncols2_16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_1-ncols2_8.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_16-ncols2_1.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_16-ncols2_2.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_16-ncols2_4.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_4.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_8.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_32-ncols2_1.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_32-ncols2_2.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_2.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_4.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_8.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_64-ncols2_1.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_1.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_2.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_4.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_8.cu +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-f16-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-f16-q4_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-f16-q4_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-f16-q5_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-f16-q5_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-f16-q8_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_0-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_0-q4_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_0-q4_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_0-q5_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_0-q5_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_0-q8_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_1-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_1-q4_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_1-q4_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_1-q5_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_1-q5_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_1-q8_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_0-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_0-q4_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_0-q4_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_0-q5_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_0-q5_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_0-q8_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_1-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_1-q4_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_1-q4_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_1-q5_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_1-q5_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_1-q8_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q8_0-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q8_0-q4_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q8_0-q4_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q8_0-q5_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q8_0-q5_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q8_0-q8_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs256-f16-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs64-f16-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs64-f16-q4_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs64-f16-q4_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs64-f16-q5_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs64-f16-q5_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs64-f16-q8_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-f16-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-f16-q4_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-f16-q4_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-f16-q5_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-f16-q5_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-f16-q8_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_0-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_0-q4_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_0-q4_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_0-q5_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_0-q5_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_0-q8_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_1-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_1-q4_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_1-q4_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_1-q5_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_1-q5_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_1-q8_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_0-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_0-q4_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_0-q4_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_0-q5_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_0-q5_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_0-q8_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_1-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_1-q4_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_1-q4_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_1-q5_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_1-q5_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_1-q8_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q8_0-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q8_0-q4_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q8_0-q4_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q8_0-q5_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q8_0-q5_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q8_0-q8_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs256-f16-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs64-f16-f16.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs64-f16-q4_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs64-f16-q4_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs64-f16-q5_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs64-f16-q5_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs64-f16-q8_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/generate_cu_files.py +78 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq1_s.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq2_s.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq2_xs.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq2_xxs.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq3_s.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq3_xxs.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq4_nl.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq4_xs.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q2_k.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q3_k.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q4_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q4_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q4_k.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q5_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q5_1.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q5_k.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q6_k.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q8_0.cu +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/tsembd.cu +47 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/tsembd.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/unary.cu +279 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/unary.cuh +57 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/upscale.cu +51 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/upscale.cuh +5 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/vecdotq.cuh +1135 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/vendors/cuda.h +15 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/vendors/hip.h +243 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/vendors/musa.h +140 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/wkv.cu +199 -0
- package/cpp/llama.cpp/ggml/src/ggml-cuda/wkv.cuh +7 -0
- package/cpp/llama.cpp/ggml/src/ggml-hip/CMakeLists.txt +131 -0
- package/cpp/llama.cpp/ggml/src/ggml-impl.h +601 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/CMakeLists.txt +166 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/ggml-kompute.cpp +2251 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/common.comp +112 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_add.comp +58 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_addrow.comp +25 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_cpy_f16_f16.comp +52 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_cpy_f16_f32.comp +52 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_cpy_f32_f16.comp +52 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_cpy_f32_f32.comp +52 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_diagmask.comp +30 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_gelu.comp +22 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_getrows.comp +17 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_getrows_f16.comp +31 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_getrows_f32.comp +31 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_getrows_q4_0.comp +38 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_getrows_q4_1.comp +39 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_getrows_q6_k.comp +44 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul.comp +52 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mat_f16.comp +69 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mat_mat_f32.comp +51 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mat_q4_0.comp +33 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mat_q4_1.comp +35 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mat_q4_k.comp +140 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mat_q6_k.comp +106 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mat_q8_0.comp +73 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mv_q_n.comp +52 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mv_q_n_pre.comp +28 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_norm.comp +84 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_relu.comp +21 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_rmsnorm.comp +53 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_rope_neox_f16.comp +52 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_rope_neox_f32.comp +52 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_rope_norm_f16.comp +52 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_rope_norm_f32.comp +52 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_scale.comp +19 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_scale_8.comp +23 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_silu.comp +22 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/op_softmax.comp +72 -0
- package/cpp/llama.cpp/ggml/src/ggml-kompute/kompute-shaders/rope_common.comp +71 -0
- package/cpp/llama.cpp/ggml/src/ggml-metal/CMakeLists.txt +120 -0
- package/cpp/llama.cpp/ggml/src/ggml-metal/ggml-metal-impl.h +618 -0
- package/cpp/llama.cpp/ggml/src/ggml-metal/ggml-metal.m +5916 -0
- package/cpp/llama.cpp/ggml/src/ggml-metal/ggml-metal.metal +6891 -0
- package/cpp/llama.cpp/ggml/src/ggml-musa/CMakeLists.txt +107 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/CMakeLists.txt +96 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/ggml-opencl.cpp +4966 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/add.cl +83 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/clamp.cl +20 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/cpy.cl +184 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/cvt.cl +118 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/diag_mask_inf.cl +58 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/embed_kernel.py +26 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/gelu.cl +62 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/gemv_noshuffle.cl +268 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/gemv_noshuffle_general.cl +274 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/get_rows.cl +163 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/im2col_f16.cl +57 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/im2col_f32.cl +57 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/mul.cl +79 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/mul_mat_Ab_Bi_8x4.cl +139 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/mul_mv_f16_f16.cl +118 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/mul_mv_f16_f32.cl +118 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/mul_mv_f16_f32_1row.cl +94 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/mul_mv_f16_f32_l4.cl +84 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/mul_mv_f32_f32.cl +118 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32.cl +192 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_1d_16x_flat.cl +307 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_1d_8x_flat.cl +265 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_8x_flat.cl +272 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_v.cl +254 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/mul_mv_q6_k.cl +190 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/norm.cl +81 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/relu.cl +16 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/rms_norm.cl +96 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/rope.cl +721 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/scale.cl +16 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/silu.cl +30 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/softmax_4_f16.cl +87 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/softmax_4_f32.cl +87 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/softmax_f16.cl +86 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/softmax_f32.cl +86 -0
- package/cpp/llama.cpp/ggml/src/ggml-opencl/kernels/transpose.cl +84 -0
- package/cpp/llama.cpp/ggml/src/ggml-opt.cpp +854 -0
- package/cpp/llama.cpp/ggml/src/ggml-quants.c +5232 -0
- package/cpp/llama.cpp/ggml/src/ggml-quants.h +100 -0
- package/cpp/llama.cpp/ggml/src/ggml-rpc/CMakeLists.txt +9 -0
- package/cpp/llama.cpp/ggml/src/ggml-rpc/ggml-rpc.cpp +1813 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/CMakeLists.txt +183 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/backend.hpp +37 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/binbcast.cpp +350 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/binbcast.hpp +39 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/common.cpp +83 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/common.hpp +493 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/concat.cpp +197 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/concat.hpp +20 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/conv.cpp +100 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/conv.hpp +20 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/convert.cpp +596 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/convert.hpp +34 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/cpy.cpp +701 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/cpy.hpp +11 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/dequantize.hpp +753 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/dmmv.cpp +1154 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/dmmv.hpp +27 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/dpct/helper.hpp +2957 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/element_wise.cpp +1559 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/element_wise.hpp +75 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/gemm.hpp +70 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/getrows.cpp +311 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/getrows.hpp +20 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/ggml-sycl.cpp +4302 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/gla.cpp +105 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/gla.hpp +8 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/im2col.cpp +136 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/im2col.hpp +21 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/mmq.cpp +3030 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/mmq.hpp +33 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/mmvq.cpp +1081 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/mmvq.hpp +27 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/norm.cpp +474 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/norm.hpp +26 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/outprod.cpp +46 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/outprod.hpp +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/presets.hpp +74 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/quants.hpp +61 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/rope.cpp +362 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/rope.hpp +20 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/softmax.cpp +264 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/softmax.hpp +20 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/sycl_hw.cpp +13 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/sycl_hw.hpp +23 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/tsembd.cpp +73 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/tsembd.hpp +20 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/vecdotq.hpp +1189 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/wkv.cpp +305 -0
- package/cpp/llama.cpp/ggml/src/ggml-sycl/wkv.hpp +10 -0
- package/cpp/llama.cpp/ggml/src/ggml-threading.cpp +12 -0
- package/cpp/llama.cpp/ggml/src/ggml-threading.h +14 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/CMakeLists.txt +202 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/cmake/host-toolchain.cmake.in +15 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp +10502 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/CMakeLists.txt +22 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/acc.comp +29 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/add.comp +29 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/argmax.comp +51 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/argsort.comp +69 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/clamp.comp +17 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/concat.comp +41 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/contig_copy.comp +49 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/conv2d_dw.comp +105 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/copy.comp +23 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/copy_from_quant.comp +51 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/copy_to_quant.comp +242 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/cos.comp +17 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/count_equal.comp +31 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_f32.comp +20 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_funcs.comp +462 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_funcs_cm2.comp +699 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_head.comp +13 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq1_m.comp +42 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq1_s.comp +35 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq2_s.comp +44 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq2_xs.comp +43 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq2_xxs.comp +48 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq3_s.comp +39 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq3_xxs.comp +49 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq4_nl.comp +32 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq4_xs.comp +34 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q2_k.comp +34 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q3_k.comp +42 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q4_0.comp +30 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q4_1.comp +32 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q4_k.comp +68 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q5_0.comp +34 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q5_1.comp +35 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q5_k.comp +70 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q6_k.comp +33 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q8_0.comp +31 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/diag_mask_inf.comp +34 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/div.comp +27 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn.comp +483 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_cm2.comp +383 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_split_k_reduce.comp +59 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/gelu.comp +25 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/gelu_quick.comp +23 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/generic_binary_head.comp +64 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/generic_head.comp +9 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/generic_unary_head.comp +76 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/get_rows.comp +33 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/get_rows_quant.comp +41 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/group_norm.comp +66 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/im2col.comp +100 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/l2_norm.comp +41 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/leaky_relu.comp +22 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul.comp +27 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_split_k_reduce.comp +48 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec.comp +169 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_base.comp +118 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq1_m.comp +82 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq1_s.comp +79 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq2_s.comp +90 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq2_xs.comp +87 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq2_xxs.comp +87 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq3_s.comp +90 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq3_xxs.comp +88 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_nc.comp +118 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_p021.comp +154 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q2_k.comp +130 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q3_k.comp +132 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q4_k.comp +136 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q5_k.comp +167 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q6_k.comp +130 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mm.comp +868 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mm_cm2.comp +441 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mmq.comp +442 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mmq_funcs.comp +99 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/norm.comp +44 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/opt_step_adamw.comp +42 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/pad.comp +28 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/pool2d.comp +74 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/quantize_q8_1.comp +77 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/relu.comp +21 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/repeat.comp +26 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/repeat_back.comp +37 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/rms_norm.comp +52 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/rms_norm_back.comp +55 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/rope_head.comp +58 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/rope_multi.comp +60 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/rope_neox.comp +43 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/rope_norm.comp +43 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/rope_vision.comp +47 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/scale.comp +24 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/sigmoid.comp +20 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/silu.comp +22 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/silu_back.comp +26 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/sin.comp +17 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/soft_max.comp +173 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/soft_max_back.comp +50 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/square.comp +17 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/sub.comp +29 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/sum_rows.comp +37 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/tanh.comp +20 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/test_bfloat16_support.comp +7 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/test_coopmat2_support.comp +7 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/test_coopmat_support.comp +7 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/test_integer_dot_support.comp +7 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/timestep_embedding.comp +41 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/types.comp +1373 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/upscale.comp +36 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp +740 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/wkv6.comp +87 -0
- package/cpp/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/wkv7.comp +91 -0
- package/cpp/llama.cpp/ggml/src/ggml.c +6499 -0
- package/cpp/llama.cpp/ggml/src/gguf.cpp +1330 -0
- package/cpp/llama.cpp/gguf-py/LICENSE +21 -0
- package/cpp/llama.cpp/gguf-py/README.md +99 -0
- package/cpp/llama.cpp/gguf-py/examples/reader.py +49 -0
- package/cpp/llama.cpp/gguf-py/examples/writer.py +39 -0
- package/cpp/llama.cpp/gguf-py/gguf/__init__.py +9 -0
- package/cpp/llama.cpp/gguf-py/gguf/constants.py +2296 -0
- package/cpp/llama.cpp/gguf-py/gguf/gguf.py +15 -0
- package/cpp/llama.cpp/gguf-py/gguf/gguf_reader.py +367 -0
- package/cpp/llama.cpp/gguf-py/gguf/gguf_writer.py +1041 -0
- package/cpp/llama.cpp/gguf-py/gguf/lazy.py +223 -0
- package/cpp/llama.cpp/gguf-py/gguf/metadata.py +642 -0
- package/cpp/llama.cpp/gguf-py/gguf/py.typed +0 -0
- package/cpp/llama.cpp/gguf-py/gguf/quants.py +1269 -0
- package/cpp/llama.cpp/gguf-py/gguf/scripts/gguf_convert_endian.py +182 -0
- package/cpp/llama.cpp/gguf-py/gguf/scripts/gguf_dump.py +454 -0
- package/cpp/llama.cpp/gguf-py/gguf/scripts/gguf_editor_gui.py +1610 -0
- package/cpp/llama.cpp/gguf-py/gguf/scripts/gguf_hash.py +102 -0
- package/cpp/llama.cpp/gguf-py/gguf/scripts/gguf_new_metadata.py +207 -0
- package/cpp/llama.cpp/gguf-py/gguf/scripts/gguf_set_metadata.py +95 -0
- package/cpp/llama.cpp/gguf-py/gguf/tensor_mapping.py +1172 -0
- package/cpp/llama.cpp/gguf-py/gguf/utility.py +264 -0
- package/cpp/llama.cpp/gguf-py/gguf/vocab.py +492 -0
- package/cpp/llama.cpp/gguf-py/pyproject.toml +43 -0
- package/cpp/llama.cpp/gguf-py/tests/__init__.py +1 -0
- package/cpp/llama.cpp/gguf-py/tests/test_metadata.py +238 -0
- package/cpp/llama.cpp/gguf-py/tests/test_quants.py +238 -0
- package/cpp/llama.cpp/grammars/README.md +382 -0
- package/cpp/llama.cpp/grammars/arithmetic.gbnf +6 -0
- package/cpp/llama.cpp/grammars/c.gbnf +42 -0
- package/cpp/llama.cpp/grammars/chess.gbnf +13 -0
- package/cpp/llama.cpp/grammars/english.gbnf +6 -0
- package/cpp/llama.cpp/grammars/japanese.gbnf +7 -0
- package/cpp/llama.cpp/grammars/json.gbnf +25 -0
- package/cpp/llama.cpp/grammars/json_arr.gbnf +34 -0
- package/cpp/llama.cpp/grammars/list.gbnf +4 -0
- package/cpp/llama.cpp/include/llama-cpp.h +30 -0
- package/cpp/llama.cpp/include/llama.h +1440 -0
- package/cpp/llama.cpp/licenses/LICENSE-curl +9 -0
- package/cpp/llama.cpp/licenses/LICENSE-httplib +21 -0
- package/cpp/llama.cpp/licenses/LICENSE-jsonhpp +21 -0
- package/cpp/llama.cpp/licenses/LICENSE-linenoise +26 -0
- package/cpp/llama.cpp/media/llama0-banner.png +0 -0
- package/cpp/llama.cpp/media/llama0-logo.png +0 -0
- package/cpp/llama.cpp/media/llama1-banner.png +0 -0
- package/cpp/llama.cpp/media/llama1-logo.png +0 -0
- package/cpp/llama.cpp/media/llama1-logo.svg +34 -0
- package/cpp/llama.cpp/media/matmul.png +0 -0
- package/cpp/llama.cpp/media/matmul.svg +1238 -0
- package/cpp/llama.cpp/models/ggml-vocab-aquila.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-baichuan.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-bert-bge.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-bert-bge.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-bert-bge.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-chameleon.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-chameleon.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-command-r.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-command-r.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-command-r.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-deepseek-coder.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-deepseek-coder.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-deepseek-coder.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-deepseek-llm.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-deepseek-llm.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-deepseek-llm.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-deepseek-r1-qwen.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-deepseek-r1-qwen.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-falcon.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-falcon.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-falcon.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-gpt-2.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-gpt-2.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-gpt-2.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-gpt-4o.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-gpt-4o.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-gpt-neox.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-llama-bpe.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-llama-bpe.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-llama-bpe.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-llama-spm.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-llama-spm.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-llama-spm.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-llama4.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-llama4.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-mpt.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-mpt.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-mpt.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-phi-3.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-phi-3.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-phi-3.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-pixtral.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-pixtral.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-qwen2.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-qwen2.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-qwen2.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-refact.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-refact.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-refact.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-roberta-bpe.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-roberta-bpe.gguf.out +46 -0
- package/cpp/llama.cpp/models/ggml-vocab-starcoder.gguf +0 -0
- package/cpp/llama.cpp/models/ggml-vocab-starcoder.gguf.inp +112 -0
- package/cpp/llama.cpp/models/ggml-vocab-starcoder.gguf.out +46 -0
- package/cpp/llama.cpp/models/templates/CohereForAI-c4ai-command-r-plus-tool_use.jinja +202 -0
- package/cpp/llama.cpp/models/templates/CohereForAI-c4ai-command-r7b-12-2024-tool_use.jinja +156 -0
- package/cpp/llama.cpp/models/templates/NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use.jinja +152 -0
- package/cpp/llama.cpp/models/templates/NousResearch-Hermes-3-Llama-3.1-8B-tool_use.jinja +152 -0
- package/cpp/llama.cpp/models/templates/Qwen-Qwen2.5-7B-Instruct.jinja +54 -0
- package/cpp/llama.cpp/models/templates/README.md +22 -0
- package/cpp/llama.cpp/models/templates/deepseek-ai-DeepSeek-R1-Distill-Llama-8B.jinja +1 -0
- package/cpp/llama.cpp/models/templates/deepseek-ai-DeepSeek-R1-Distill-Qwen-32B.jinja +1 -0
- package/cpp/llama.cpp/models/templates/fireworks-ai-llama-3-firefunction-v2.jinja +57 -0
- package/cpp/llama.cpp/models/templates/google-gemma-2-2b-it.jinja +4 -0
- package/cpp/llama.cpp/models/templates/llama-cpp-deepseek-r1.jinja +76 -0
- package/cpp/llama.cpp/models/templates/meetkai-functionary-medium-v3.1.jinja +58 -0
- package/cpp/llama.cpp/models/templates/meetkai-functionary-medium-v3.2.jinja +287 -0
- package/cpp/llama.cpp/models/templates/meta-llama-Llama-3.1-8B-Instruct.jinja +109 -0
- package/cpp/llama.cpp/models/templates/meta-llama-Llama-3.2-3B-Instruct.jinja +93 -0
- package/cpp/llama.cpp/models/templates/meta-llama-Llama-3.3-70B-Instruct.jinja +109 -0
- package/cpp/llama.cpp/models/templates/microsoft-Phi-3.5-mini-instruct.jinja +8 -0
- package/cpp/llama.cpp/models/templates/mistralai-Mistral-Nemo-Instruct-2407.jinja +87 -0
- package/cpp/llama.cpp/mypy.ini +7 -0
- package/cpp/llama.cpp/pocs/CMakeLists.txt +14 -0
- package/cpp/llama.cpp/pocs/vdot/CMakeLists.txt +9 -0
- package/cpp/llama.cpp/pocs/vdot/q8dot.cpp +173 -0
- package/cpp/llama.cpp/pocs/vdot/vdot.cpp +311 -0
- package/cpp/llama.cpp/poetry.lock +1197 -0
- package/cpp/llama.cpp/prompts/LLM-questions.txt +49 -0
- package/cpp/llama.cpp/prompts/alpaca.txt +1 -0
- package/cpp/llama.cpp/prompts/assistant.txt +31 -0
- package/cpp/llama.cpp/prompts/chat-with-baichuan.txt +4 -0
- package/cpp/llama.cpp/prompts/chat-with-bob.txt +7 -0
- package/cpp/llama.cpp/prompts/chat-with-qwen.txt +1 -0
- package/cpp/llama.cpp/prompts/chat-with-vicuna-v0.txt +7 -0
- package/cpp/llama.cpp/prompts/chat-with-vicuna-v1.txt +7 -0
- package/cpp/llama.cpp/prompts/chat.txt +28 -0
- package/cpp/llama.cpp/prompts/dan-modified.txt +1 -0
- package/cpp/llama.cpp/prompts/dan.txt +1 -0
- package/cpp/llama.cpp/prompts/mnemonics.txt +93 -0
- package/cpp/llama.cpp/prompts/parallel-questions.txt +43 -0
- package/cpp/llama.cpp/prompts/reason-act.txt +18 -0
- package/cpp/llama.cpp/pyproject.toml +45 -0
- package/cpp/llama.cpp/pyrightconfig.json +22 -0
- package/cpp/llama.cpp/requirements/requirements-all.txt +15 -0
- package/cpp/llama.cpp/requirements/requirements-compare-llama-bench.txt +2 -0
- package/cpp/llama.cpp/requirements/requirements-convert_hf_to_gguf.txt +3 -0
- package/cpp/llama.cpp/requirements/requirements-convert_hf_to_gguf_update.txt +3 -0
- package/cpp/llama.cpp/requirements/requirements-convert_legacy_llama.txt +5 -0
- package/cpp/llama.cpp/requirements/requirements-convert_llama_ggml_to_gguf.txt +1 -0
- package/cpp/llama.cpp/requirements/requirements-convert_lora_to_gguf.txt +2 -0
- package/cpp/llama.cpp/requirements/requirements-gguf_editor_gui.txt +3 -0
- package/cpp/llama.cpp/requirements/requirements-pydantic.txt +3 -0
- package/cpp/llama.cpp/requirements/requirements-test-tokenizer-random.txt +1 -0
- package/cpp/llama.cpp/requirements/requirements-tool_bench.txt +12 -0
- package/cpp/llama.cpp/requirements.txt +13 -0
- package/cpp/llama.cpp/src/CMakeLists.txt +45 -0
- package/cpp/llama.cpp/src/llama-adapter.cpp +388 -0
- package/cpp/llama.cpp/src/llama-adapter.h +76 -0
- package/cpp/llama.cpp/src/llama-arch.cpp +1743 -0
- package/cpp/llama.cpp/src/llama-arch.h +437 -0
- package/cpp/llama.cpp/src/llama-batch.cpp +372 -0
- package/cpp/llama.cpp/src/llama-batch.h +89 -0
- package/cpp/llama.cpp/src/llama-chat.cpp +663 -0
- package/cpp/llama.cpp/src/llama-chat.h +58 -0
- package/cpp/llama.cpp/src/llama-context.cpp +2459 -0
- package/cpp/llama.cpp/src/llama-context.h +246 -0
- package/cpp/llama.cpp/src/llama-cparams.cpp +1 -0
- package/cpp/llama.cpp/src/llama-cparams.h +39 -0
- package/cpp/llama.cpp/src/llama-grammar.cpp +1219 -0
- package/cpp/llama.cpp/src/llama-grammar.h +173 -0
- package/cpp/llama.cpp/src/llama-graph.cpp +1713 -0
- package/cpp/llama.cpp/src/llama-graph.h +595 -0
- package/cpp/llama.cpp/src/llama-hparams.cpp +79 -0
- package/cpp/llama.cpp/src/llama-hparams.h +161 -0
- package/cpp/llama.cpp/src/llama-impl.cpp +167 -0
- package/cpp/llama.cpp/src/llama-impl.h +61 -0
- package/cpp/llama.cpp/src/llama-io.cpp +15 -0
- package/cpp/llama.cpp/src/llama-io.h +35 -0
- package/cpp/llama.cpp/src/llama-kv-cache.cpp +2486 -0
- package/cpp/llama.cpp/src/llama-kv-cache.h +405 -0
- package/cpp/llama.cpp/src/llama-memory.cpp +1 -0
- package/cpp/llama.cpp/src/llama-memory.h +31 -0
- package/cpp/llama.cpp/src/llama-mmap.cpp +600 -0
- package/cpp/llama.cpp/src/llama-mmap.h +68 -0
- package/cpp/llama.cpp/src/llama-model-loader.cpp +1133 -0
- package/cpp/llama.cpp/src/llama-model-loader.h +169 -0
- package/cpp/llama.cpp/src/llama-model.cpp +13453 -0
- package/cpp/llama.cpp/src/llama-model.h +420 -0
- package/cpp/llama.cpp/src/llama-quant.cpp +964 -0
- package/cpp/llama.cpp/src/llama-quant.h +1 -0
- package/cpp/llama.cpp/src/llama-sampling.cpp +2575 -0
- package/cpp/llama.cpp/src/llama-sampling.h +32 -0
- package/cpp/llama.cpp/src/llama-vocab.cpp +3313 -0
- package/cpp/llama.cpp/src/llama-vocab.h +125 -0
- package/cpp/llama.cpp/src/llama.cpp +340 -0
- package/cpp/llama.cpp/src/unicode-data.cpp +7034 -0
- package/cpp/llama.cpp/src/unicode-data.h +20 -0
- package/cpp/llama.cpp/src/unicode.cpp +849 -0
- package/cpp/llama.cpp/src/unicode.h +66 -0
- package/cpp/rn-completion.cpp +431 -0
- package/cpp/rn-llama.hpp +60 -0
- package/cpp/rn-utils.hpp +331 -0
- package/ios/OnLoad.mm +22 -0
- package/ios/generated/RNLlamaCppSpec/RNLlamaCppSpec-generated.mm +64 -0
- package/ios/generated/RNLlamaCppSpec/RNLlamaCppSpec.h +251 -0
- package/ios/generated/RNLlamaCppSpecJSI-generated.cpp +42 -0
- package/ios/generated/RNLlamaCppSpecJSI.h +336 -0
- package/ios/include/chat.h +135 -0
- package/ios/include/common/base64.hpp +392 -0
- package/ios/include/common/json.hpp +24766 -0
- package/ios/include/common/minja/chat-template.hpp +537 -0
- package/ios/include/common/minja/minja.hpp +2941 -0
- package/ios/include/common.h +668 -0
- package/ios/include/json-schema-to-grammar.h +21 -0
- package/ios/include/llama-cpp.h +30 -0
- package/ios/include/llama.h +1440 -0
- package/ios/include/log.h +103 -0
- package/ios/include/ngram-cache.h +101 -0
- package/ios/include/sampling.h +107 -0
- package/ios/include/speculative.h +28 -0
- package/ios/libs/llama.xcframework/Info.plist +135 -0
- package/ios/libs/llama.xcframework/ios-arm64/dSYMs/llama.dSYM/Contents/Info.plist +20 -0
- package/ios/libs/llama.xcframework/ios-arm64/dSYMs/llama.dSYM/Contents/Resources/DWARF/llama +0 -0
- package/ios/libs/llama.xcframework/ios-arm64/dSYMs/llama.dSYM/Contents/Resources/Relocations/aarch64/llama.yml +4492 -0
- package/ios/libs/llama.xcframework/ios-arm64/llama.framework/Headers/ggml-alloc.h +76 -0
- package/ios/libs/llama.xcframework/ios-arm64/llama.framework/Headers/ggml-backend.h +354 -0
- package/ios/libs/llama.xcframework/ios-arm64/llama.framework/Headers/ggml-blas.h +25 -0
- package/ios/libs/llama.xcframework/ios-arm64/llama.framework/Headers/ggml-cpu.h +143 -0
- package/ios/libs/llama.xcframework/ios-arm64/llama.framework/Headers/ggml-metal.h +66 -0
- package/ios/libs/llama.xcframework/ios-arm64/llama.framework/Headers/ggml.h +2192 -0
- package/ios/libs/llama.xcframework/ios-arm64/llama.framework/Headers/gguf.h +202 -0
- package/ios/libs/llama.xcframework/ios-arm64/llama.framework/Headers/llama.h +1440 -0
- package/ios/libs/llama.xcframework/ios-arm64/llama.framework/Info.plist +36 -0
- package/ios/libs/llama.xcframework/ios-arm64/llama.framework/Modules/module.modulemap +17 -0
- package/ios/libs/llama.xcframework/ios-arm64/llama.framework/llama +0 -0
- package/ios/libs/llama.xcframework/ios-arm64_x86_64-simulator/dSYMs/llama.dSYM/Contents/Info.plist +20 -0
- package/ios/libs/llama.xcframework/ios-arm64_x86_64-simulator/dSYMs/llama.dSYM/Contents/Resources/DWARF/llama +0 -0
- package/ios/libs/llama.xcframework/ios-arm64_x86_64-simulator/dSYMs/llama.dSYM/Contents/Resources/Relocations/aarch64/llama.yml +4513 -0
- package/ios/libs/llama.xcframework/ios-arm64_x86_64-simulator/dSYMs/llama.dSYM/Contents/Resources/Relocations/x86_64/llama.yml +3440 -0
- package/ios/libs/llama.xcframework/ios-arm64_x86_64-simulator/llama.framework/Headers/ggml-alloc.h +76 -0
- package/ios/libs/llama.xcframework/ios-arm64_x86_64-simulator/llama.framework/Headers/ggml-backend.h +354 -0
- package/ios/libs/llama.xcframework/ios-arm64_x86_64-simulator/llama.framework/Headers/ggml-blas.h +25 -0
- package/ios/libs/llama.xcframework/ios-arm64_x86_64-simulator/llama.framework/Headers/ggml-cpu.h +143 -0
- package/ios/libs/llama.xcframework/ios-arm64_x86_64-simulator/llama.framework/Headers/ggml-metal.h +66 -0
- package/ios/libs/llama.xcframework/ios-arm64_x86_64-simulator/llama.framework/Headers/ggml.h +2192 -0
- package/ios/libs/llama.xcframework/ios-arm64_x86_64-simulator/llama.framework/Headers/gguf.h +202 -0
- package/ios/libs/llama.xcframework/ios-arm64_x86_64-simulator/llama.framework/Headers/llama.h +1440 -0
- package/ios/libs/llama.xcframework/ios-arm64_x86_64-simulator/llama.framework/Info.plist +36 -0
- package/ios/libs/llama.xcframework/ios-arm64_x86_64-simulator/llama.framework/Modules/module.modulemap +17 -0
- package/ios/libs/llama.xcframework/ios-arm64_x86_64-simulator/llama.framework/llama +0 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/dSYMs/llama.dSYM/Contents/Info.plist +20 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/dSYMs/llama.dSYM/Contents/Resources/DWARF/llama +0 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/dSYMs/llama.dSYM/Contents/Resources/Relocations/aarch64/llama.yml +4513 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/dSYMs/llama.dSYM/Contents/Resources/Relocations/x86_64/llama.yml +3442 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Headers/ggml-alloc.h +76 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Headers/ggml-backend.h +354 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Headers/ggml-blas.h +25 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Headers/ggml-cpu.h +143 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Headers/ggml-metal.h +66 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Headers/ggml.h +2192 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Headers/gguf.h +202 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Headers/llama.h +1440 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Modules/module.modulemap +17 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Resources/Info.plist +32 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/A/Headers/ggml-alloc.h +76 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/A/Headers/ggml-backend.h +354 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/A/Headers/ggml-blas.h +25 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/A/Headers/ggml-cpu.h +143 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/A/Headers/ggml-metal.h +66 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/A/Headers/ggml.h +2192 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/A/Headers/gguf.h +202 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/A/Headers/llama.h +1440 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/A/Modules/module.modulemap +17 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/A/Resources/Info.plist +32 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/A/llama +0 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/Current/Headers/ggml-alloc.h +76 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/Current/Headers/ggml-backend.h +354 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/Current/Headers/ggml-blas.h +25 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/Current/Headers/ggml-cpu.h +143 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/Current/Headers/ggml-metal.h +66 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/Current/Headers/ggml.h +2192 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/Current/Headers/gguf.h +202 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/Current/Headers/llama.h +1440 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/Current/Modules/module.modulemap +17 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/Current/Resources/Info.plist +32 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/Versions/Current/llama +0 -0
- package/ios/libs/llama.xcframework/macos-arm64_x86_64/llama.framework/llama +0 -0
- package/ios/libs/llama.xcframework/tvos-arm64/dSYMs/llama.dSYM/Contents/Info.plist +20 -0
- package/ios/libs/llama.xcframework/tvos-arm64/dSYMs/llama.dSYM/Contents/Resources/DWARF/llama +0 -0
- package/ios/libs/llama.xcframework/tvos-arm64/dSYMs/llama.dSYM/Contents/Resources/Relocations/aarch64/llama.yml +4492 -0
- package/ios/libs/llama.xcframework/tvos-arm64/llama.framework/Headers/ggml-alloc.h +76 -0
- package/ios/libs/llama.xcframework/tvos-arm64/llama.framework/Headers/ggml-backend.h +354 -0
- package/ios/libs/llama.xcframework/tvos-arm64/llama.framework/Headers/ggml-blas.h +25 -0
- package/ios/libs/llama.xcframework/tvos-arm64/llama.framework/Headers/ggml-cpu.h +143 -0
- package/ios/libs/llama.xcframework/tvos-arm64/llama.framework/Headers/ggml-metal.h +66 -0
- package/ios/libs/llama.xcframework/tvos-arm64/llama.framework/Headers/ggml.h +2192 -0
- package/ios/libs/llama.xcframework/tvos-arm64/llama.framework/Headers/gguf.h +202 -0
- package/ios/libs/llama.xcframework/tvos-arm64/llama.framework/Headers/llama.h +1440 -0
- package/ios/libs/llama.xcframework/tvos-arm64/llama.framework/Info.plist +35 -0
- package/ios/libs/llama.xcframework/tvos-arm64/llama.framework/Modules/module.modulemap +17 -0
- package/ios/libs/llama.xcframework/tvos-arm64/llama.framework/llama +0 -0
- package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/dSYMs/llama.dSYM/Contents/Info.plist +20 -0
- package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/dSYMs/llama.dSYM/Contents/Resources/DWARF/llama +0 -0
- package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/dSYMs/llama.dSYM/Contents/Resources/Relocations/aarch64/llama.yml +4513 -0
- package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/dSYMs/llama.dSYM/Contents/Resources/Relocations/x86_64/llama.yml +3440 -0
- package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/llama.framework/Headers/ggml-alloc.h +76 -0
- package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/llama.framework/Headers/ggml-backend.h +354 -0
- package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/llama.framework/Headers/ggml-blas.h +25 -0
- package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/llama.framework/Headers/ggml-cpu.h +143 -0
- package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/llama.framework/Headers/ggml-metal.h +66 -0
- package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/llama.framework/Headers/ggml.h +2192 -0
- package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/llama.framework/Headers/gguf.h +202 -0
- package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/llama.framework/Headers/llama.h +1440 -0
- package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/llama.framework/Info.plist +35 -0
- package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/llama.framework/Modules/module.modulemap +17 -0
- package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/llama.framework/llama +0 -0
- package/ios/libs/llama.xcframework/xros-arm64/dSYMs/llama.dSYM/Contents/Info.plist +20 -0
- package/ios/libs/llama.xcframework/xros-arm64/dSYMs/llama.dSYM/Contents/Resources/DWARF/llama +0 -0
- package/ios/libs/llama.xcframework/xros-arm64/dSYMs/llama.dSYM/Contents/Resources/Relocations/aarch64/llama.yml +4528 -0
- package/ios/libs/llama.xcframework/xros-arm64/llama.framework/Headers/ggml-alloc.h +76 -0
- package/ios/libs/llama.xcframework/xros-arm64/llama.framework/Headers/ggml-backend.h +354 -0
- package/ios/libs/llama.xcframework/xros-arm64/llama.framework/Headers/ggml-blas.h +25 -0
- package/ios/libs/llama.xcframework/xros-arm64/llama.framework/Headers/ggml-cpu.h +143 -0
- package/ios/libs/llama.xcframework/xros-arm64/llama.framework/Headers/ggml-metal.h +66 -0
- package/ios/libs/llama.xcframework/xros-arm64/llama.framework/Headers/ggml.h +2192 -0
- package/ios/libs/llama.xcframework/xros-arm64/llama.framework/Headers/gguf.h +202 -0
- package/ios/libs/llama.xcframework/xros-arm64/llama.framework/Headers/llama.h +1440 -0
- package/ios/libs/llama.xcframework/xros-arm64/llama.framework/Info.plist +32 -0
- package/ios/libs/llama.xcframework/xros-arm64/llama.framework/Modules/module.modulemap +17 -0
- package/ios/libs/llama.xcframework/xros-arm64/llama.framework/llama +0 -0
- package/ios/libs/llama.xcframework/xros-arm64_x86_64-simulator/dSYMs/llama.dSYM/Contents/Info.plist +20 -0
- package/ios/libs/llama.xcframework/xros-arm64_x86_64-simulator/dSYMs/llama.dSYM/Contents/Resources/DWARF/llama +0 -0
- package/ios/libs/llama.xcframework/xros-arm64_x86_64-simulator/dSYMs/llama.dSYM/Contents/Resources/Relocations/aarch64/llama.yml +4549 -0
- package/ios/libs/llama.xcframework/xros-arm64_x86_64-simulator/dSYMs/llama.dSYM/Contents/Resources/Relocations/x86_64/llama.yml +3470 -0
- package/ios/libs/llama.xcframework/xros-arm64_x86_64-simulator/llama.framework/Headers/ggml-alloc.h +76 -0
- package/ios/libs/llama.xcframework/xros-arm64_x86_64-simulator/llama.framework/Headers/ggml-backend.h +354 -0
- package/ios/libs/llama.xcframework/xros-arm64_x86_64-simulator/llama.framework/Headers/ggml-blas.h +25 -0
- package/ios/libs/llama.xcframework/xros-arm64_x86_64-simulator/llama.framework/Headers/ggml-cpu.h +143 -0
- package/ios/libs/llama.xcframework/xros-arm64_x86_64-simulator/llama.framework/Headers/ggml-metal.h +66 -0
- package/ios/libs/llama.xcframework/xros-arm64_x86_64-simulator/llama.framework/Headers/ggml.h +2192 -0
- package/ios/libs/llama.xcframework/xros-arm64_x86_64-simulator/llama.framework/Headers/gguf.h +202 -0
- package/ios/libs/llama.xcframework/xros-arm64_x86_64-simulator/llama.framework/Headers/llama.h +1440 -0
- package/ios/libs/llama.xcframework/xros-arm64_x86_64-simulator/llama.framework/Info.plist +32 -0
- package/ios/libs/llama.xcframework/xros-arm64_x86_64-simulator/llama.framework/Modules/module.modulemap +17 -0
- package/ios/libs/llama.xcframework/xros-arm64_x86_64-simulator/llama.framework/llama +0 -0
- package/lib/module/NativeRNLlamaCpp.js +35 -0
- package/lib/module/NativeRNLlamaCpp.js.map +1 -0
- package/lib/module/index.js +20 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeRNLlamaCpp.d.ts +222 -0
- package/lib/typescript/src/NativeRNLlamaCpp.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +5 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +161 -0
- package/react-native.config.js +15 -0
- package/src/NativeRNLlamaCpp.ts +282 -0
- package/src/index.tsx +54 -0
package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/llama.framework/Headers/ggml-alloc.h
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "ggml.h"
|
|
4
|
+
|
|
5
|
+
#ifdef __cplusplus
|
|
6
|
+
extern "C" {
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
typedef struct ggml_backend_buffer_type * ggml_backend_buffer_type_t;
|
|
10
|
+
typedef struct ggml_backend_buffer * ggml_backend_buffer_t;
|
|
11
|
+
typedef struct ggml_backend * ggml_backend_t;
|
|
12
|
+
|
|
13
|
+
// Tensor allocator
|
|
14
|
+
struct ggml_tallocr {
|
|
15
|
+
ggml_backend_buffer_t buffer;
|
|
16
|
+
void * base;
|
|
17
|
+
size_t alignment;
|
|
18
|
+
size_t offset;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
GGML_API struct ggml_tallocr ggml_tallocr_new(ggml_backend_buffer_t buffer);
|
|
22
|
+
GGML_API enum ggml_status ggml_tallocr_alloc(struct ggml_tallocr * talloc, struct ggml_tensor * tensor);
|
|
23
|
+
|
|
24
|
+
// Graph allocator
|
|
25
|
+
/*
|
|
26
|
+
Example usage:
|
|
27
|
+
ggml_gallocr_t galloc = ggml_gallocr_new(ggml_backend_cpu_buffer_type());
|
|
28
|
+
|
|
29
|
+
// optional: create a worst-case graph and reserve the buffers to avoid reallocations
|
|
30
|
+
ggml_gallocr_reserve(galloc, build_graph(max_batch));
|
|
31
|
+
|
|
32
|
+
// allocate the graph
|
|
33
|
+
struct ggml_cgraph * graph = build_graph(batch);
|
|
34
|
+
ggml_gallocr_alloc_graph(galloc, graph);
|
|
35
|
+
|
|
36
|
+
printf("compute buffer size: %zu bytes\n", ggml_gallocr_get_buffer_size(galloc, 0));
|
|
37
|
+
|
|
38
|
+
// evaluate the graph
|
|
39
|
+
ggml_backend_graph_compute(backend, graph);
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
// special tensor flags for use with the graph allocator:
|
|
43
|
+
// ggml_set_input(): all input tensors are allocated at the beginning of the graph in non-overlapping addresses
|
|
44
|
+
// ggml_set_output(): output tensors are never freed and never overwritten
|
|
45
|
+
|
|
46
|
+
typedef struct ggml_gallocr * ggml_gallocr_t;
|
|
47
|
+
|
|
48
|
+
GGML_API ggml_gallocr_t ggml_gallocr_new(ggml_backend_buffer_type_t buft);
|
|
49
|
+
GGML_API ggml_gallocr_t ggml_gallocr_new_n(ggml_backend_buffer_type_t * bufts, int n_bufs);
|
|
50
|
+
GGML_API void ggml_gallocr_free(ggml_gallocr_t galloc);
|
|
51
|
+
|
|
52
|
+
// pre-allocate buffers from a measure graph - does not allocate or modify the graph
|
|
53
|
+
// call with a worst-case graph to avoid buffer reallocations
|
|
54
|
+
// not strictly required for single buffer usage: ggml_gallocr_alloc_graph will reallocate the buffers automatically if needed
|
|
55
|
+
// returns false if the buffer allocation failed
|
|
56
|
+
GGML_API bool ggml_gallocr_reserve(ggml_gallocr_t galloc, struct ggml_cgraph * graph);
|
|
57
|
+
GGML_API bool ggml_gallocr_reserve_n(
|
|
58
|
+
ggml_gallocr_t galloc,
|
|
59
|
+
struct ggml_cgraph * graph,
|
|
60
|
+
const int * node_buffer_ids,
|
|
61
|
+
const int * leaf_buffer_ids);
|
|
62
|
+
|
|
63
|
+
// automatic reallocation if the topology changes when using a single buffer
|
|
64
|
+
// returns false if using multiple buffers and a re-allocation is needed (call ggml_gallocr_reserve_n first to set the node buffers)
|
|
65
|
+
GGML_API bool ggml_gallocr_alloc_graph(ggml_gallocr_t galloc, struct ggml_cgraph * graph);
|
|
66
|
+
|
|
67
|
+
GGML_API size_t ggml_gallocr_get_buffer_size(ggml_gallocr_t galloc, int buffer_id);
|
|
68
|
+
|
|
69
|
+
// Utils
|
|
70
|
+
// Create a buffer and allocate all the tensors in a ggml_context
|
|
71
|
+
GGML_API struct ggml_backend_buffer * ggml_backend_alloc_ctx_tensors_from_buft(struct ggml_context * ctx, ggml_backend_buffer_type_t buft);
|
|
72
|
+
GGML_API struct ggml_backend_buffer * ggml_backend_alloc_ctx_tensors(struct ggml_context * ctx, ggml_backend_t backend);
|
|
73
|
+
|
|
74
|
+
#ifdef __cplusplus
|
|
75
|
+
}
|
|
76
|
+
#endif
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "ggml.h"
|
|
4
|
+
#include "ggml-alloc.h"
|
|
5
|
+
|
|
6
|
+
#ifdef GGML_BACKEND_SHARED
|
|
7
|
+
# if defined(_WIN32) && !defined(__MINGW32__)
|
|
8
|
+
# ifdef GGML_BACKEND_BUILD
|
|
9
|
+
# define GGML_BACKEND_API __declspec(dllexport) extern
|
|
10
|
+
# else
|
|
11
|
+
# define GGML_BACKEND_API __declspec(dllimport) extern
|
|
12
|
+
# endif
|
|
13
|
+
# else
|
|
14
|
+
# define GGML_BACKEND_API __attribute__ ((visibility ("default"))) extern
|
|
15
|
+
# endif
|
|
16
|
+
#else
|
|
17
|
+
# define GGML_BACKEND_API extern
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
#ifdef __cplusplus
|
|
21
|
+
extern "C" {
|
|
22
|
+
#endif
|
|
23
|
+
|
|
24
|
+
typedef struct ggml_backend_buffer_type * ggml_backend_buffer_type_t;
|
|
25
|
+
typedef struct ggml_backend_buffer * ggml_backend_buffer_t;
|
|
26
|
+
typedef struct ggml_backend_event * ggml_backend_event_t;
|
|
27
|
+
typedef struct ggml_backend * ggml_backend_t;
|
|
28
|
+
typedef void * ggml_backend_graph_plan_t;
|
|
29
|
+
typedef struct ggml_backend_reg * ggml_backend_reg_t;
|
|
30
|
+
typedef struct ggml_backend_device * ggml_backend_dev_t;
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
//
|
|
34
|
+
// Backend buffer type
|
|
35
|
+
//
|
|
36
|
+
|
|
37
|
+
GGML_API const char * ggml_backend_buft_name (ggml_backend_buffer_type_t buft);
|
|
38
|
+
GGML_API ggml_backend_buffer_t ggml_backend_buft_alloc_buffer (ggml_backend_buffer_type_t buft, size_t size);
|
|
39
|
+
GGML_API size_t ggml_backend_buft_get_alignment (ggml_backend_buffer_type_t buft);
|
|
40
|
+
GGML_API size_t ggml_backend_buft_get_max_size (ggml_backend_buffer_type_t buft);
|
|
41
|
+
GGML_API size_t ggml_backend_buft_get_alloc_size(ggml_backend_buffer_type_t buft, const struct ggml_tensor * tensor);
|
|
42
|
+
GGML_API bool ggml_backend_buft_is_host (ggml_backend_buffer_type_t buft);
|
|
43
|
+
GGML_API ggml_backend_dev_t ggml_backend_buft_get_device (ggml_backend_buffer_type_t buft);
|
|
44
|
+
|
|
45
|
+
//
|
|
46
|
+
// Backend buffer
|
|
47
|
+
//
|
|
48
|
+
|
|
49
|
+
enum ggml_backend_buffer_usage {
|
|
50
|
+
GGML_BACKEND_BUFFER_USAGE_ANY = 0,
|
|
51
|
+
GGML_BACKEND_BUFFER_USAGE_WEIGHTS = 1,
|
|
52
|
+
GGML_BACKEND_BUFFER_USAGE_COMPUTE = 2,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
GGML_API const char * ggml_backend_buffer_name (ggml_backend_buffer_t buffer);
|
|
56
|
+
GGML_API void ggml_backend_buffer_free (ggml_backend_buffer_t buffer);
|
|
57
|
+
GGML_API void * ggml_backend_buffer_get_base (ggml_backend_buffer_t buffer);
|
|
58
|
+
GGML_API size_t ggml_backend_buffer_get_size (ggml_backend_buffer_t buffer);
|
|
59
|
+
GGML_API enum ggml_status ggml_backend_buffer_init_tensor (ggml_backend_buffer_t buffer, struct ggml_tensor * tensor);
|
|
60
|
+
GGML_API size_t ggml_backend_buffer_get_alignment (ggml_backend_buffer_t buffer);
|
|
61
|
+
GGML_API size_t ggml_backend_buffer_get_max_size (ggml_backend_buffer_t buffer);
|
|
62
|
+
GGML_API size_t ggml_backend_buffer_get_alloc_size(ggml_backend_buffer_t buffer, const struct ggml_tensor * tensor);
|
|
63
|
+
GGML_API void ggml_backend_buffer_clear (ggml_backend_buffer_t buffer, uint8_t value);
|
|
64
|
+
GGML_API bool ggml_backend_buffer_is_host (ggml_backend_buffer_t buffer);
|
|
65
|
+
GGML_API void ggml_backend_buffer_set_usage (ggml_backend_buffer_t buffer, enum ggml_backend_buffer_usage usage);
|
|
66
|
+
GGML_API enum ggml_backend_buffer_usage ggml_backend_buffer_get_usage (ggml_backend_buffer_t buffer);
|
|
67
|
+
GGML_API ggml_backend_buffer_type_t ggml_backend_buffer_get_type (ggml_backend_buffer_t buffer);
|
|
68
|
+
GGML_API void ggml_backend_buffer_reset (ggml_backend_buffer_t buffer);
|
|
69
|
+
|
|
70
|
+
// tensor copy between different backends
|
|
71
|
+
GGML_API void ggml_backend_tensor_copy(struct ggml_tensor * src, struct ggml_tensor * dst);
|
|
72
|
+
|
|
73
|
+
//
|
|
74
|
+
// Backend (stream)
|
|
75
|
+
//
|
|
76
|
+
|
|
77
|
+
GGML_API ggml_guid_t ggml_backend_guid(ggml_backend_t backend);
|
|
78
|
+
GGML_API const char * ggml_backend_name(ggml_backend_t backend);
|
|
79
|
+
GGML_API void ggml_backend_free(ggml_backend_t backend);
|
|
80
|
+
|
|
81
|
+
GGML_API ggml_backend_buffer_type_t ggml_backend_get_default_buffer_type(ggml_backend_t backend);
|
|
82
|
+
GGML_API ggml_backend_buffer_t ggml_backend_alloc_buffer(ggml_backend_t backend, size_t size);
|
|
83
|
+
GGML_API size_t ggml_backend_get_alignment(ggml_backend_t backend);
|
|
84
|
+
GGML_API size_t ggml_backend_get_max_size(ggml_backend_t backend);
|
|
85
|
+
|
|
86
|
+
GGML_API void ggml_backend_tensor_set_async(ggml_backend_t backend, struct ggml_tensor * tensor, const void * data, size_t offset, size_t size);
|
|
87
|
+
GGML_API void ggml_backend_tensor_get_async(ggml_backend_t backend, const struct ggml_tensor * tensor, void * data, size_t offset, size_t size);
|
|
88
|
+
|
|
89
|
+
// "offset" refers to the offset in tensor->data for setting/getting data
|
|
90
|
+
GGML_API void ggml_backend_tensor_set( struct ggml_tensor * tensor, const void * data, size_t offset, size_t size);
|
|
91
|
+
GGML_API void ggml_backend_tensor_get(const struct ggml_tensor * tensor, void * data, size_t offset, size_t size);
|
|
92
|
+
GGML_API void ggml_backend_tensor_memset( struct ggml_tensor * tensor, uint8_t value, size_t offset, size_t size);
|
|
93
|
+
|
|
94
|
+
GGML_API void ggml_backend_synchronize(ggml_backend_t backend);
|
|
95
|
+
|
|
96
|
+
GGML_API ggml_backend_graph_plan_t ggml_backend_graph_plan_create(ggml_backend_t backend, struct ggml_cgraph * cgraph);
|
|
97
|
+
GGML_API void ggml_backend_graph_plan_free (ggml_backend_t backend, ggml_backend_graph_plan_t plan);
|
|
98
|
+
|
|
99
|
+
GGML_API enum ggml_status ggml_backend_graph_plan_compute (ggml_backend_t backend, ggml_backend_graph_plan_t plan);
|
|
100
|
+
GGML_API enum ggml_status ggml_backend_graph_compute (ggml_backend_t backend, struct ggml_cgraph * cgraph);
|
|
101
|
+
GGML_API enum ggml_status ggml_backend_graph_compute_async(ggml_backend_t backend, struct ggml_cgraph * cgraph);
|
|
102
|
+
|
|
103
|
+
// NOTE: will be removed, use device version instead
|
|
104
|
+
GGML_API bool ggml_backend_supports_op(ggml_backend_t backend, const struct ggml_tensor * op);
|
|
105
|
+
GGML_API bool ggml_backend_supports_buft(ggml_backend_t backend, ggml_backend_buffer_type_t buft);
|
|
106
|
+
GGML_API bool ggml_backend_offload_op(ggml_backend_t backend, const struct ggml_tensor * op);
|
|
107
|
+
|
|
108
|
+
// asynchronous copy
|
|
109
|
+
// the copy is performed after all the currently queued operations in backend_src
|
|
110
|
+
// backend_dst will wait for the copy to complete before performing other operations
|
|
111
|
+
// automatic fallback to sync copy if async is not supported
|
|
112
|
+
GGML_API void ggml_backend_tensor_copy_async(ggml_backend_t backend_src, ggml_backend_t backend_dst, struct ggml_tensor * src, struct ggml_tensor * dst);
|
|
113
|
+
|
|
114
|
+
GGML_API ggml_backend_dev_t ggml_backend_get_device(ggml_backend_t backend);
|
|
115
|
+
|
|
116
|
+
//
|
|
117
|
+
// Events
|
|
118
|
+
//
|
|
119
|
+
|
|
120
|
+
GGML_API ggml_backend_event_t ggml_backend_event_new(ggml_backend_dev_t device);
|
|
121
|
+
GGML_API void ggml_backend_event_free(ggml_backend_event_t event);
|
|
122
|
+
GGML_API void ggml_backend_event_record(ggml_backend_event_t event, ggml_backend_t backend);
|
|
123
|
+
GGML_API void ggml_backend_event_synchronize(ggml_backend_event_t event);
|
|
124
|
+
GGML_API void ggml_backend_event_wait(ggml_backend_t backend, ggml_backend_event_t event);
|
|
125
|
+
|
|
126
|
+
//
|
|
127
|
+
// Backend device
|
|
128
|
+
//
|
|
129
|
+
|
|
130
|
+
enum ggml_backend_dev_type {
|
|
131
|
+
// CPU device using system memory
|
|
132
|
+
GGML_BACKEND_DEVICE_TYPE_CPU,
|
|
133
|
+
// GPU device using dedicated memory
|
|
134
|
+
GGML_BACKEND_DEVICE_TYPE_GPU,
|
|
135
|
+
// accelerator devices intended to be used together with the CPU backend (e.g. BLAS or AMX)
|
|
136
|
+
GGML_BACKEND_DEVICE_TYPE_ACCEL
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// functionality supported by the device
|
|
140
|
+
struct ggml_backend_dev_caps {
|
|
141
|
+
// asynchronous operations
|
|
142
|
+
bool async;
|
|
143
|
+
// pinned host buffer
|
|
144
|
+
bool host_buffer;
|
|
145
|
+
// creating buffers from host ptr
|
|
146
|
+
bool buffer_from_host_ptr;
|
|
147
|
+
// event synchronization
|
|
148
|
+
bool events;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
// all the device properties
|
|
152
|
+
struct ggml_backend_dev_props {
|
|
153
|
+
const char * name;
|
|
154
|
+
const char * description;
|
|
155
|
+
size_t memory_free;
|
|
156
|
+
size_t memory_total;
|
|
157
|
+
enum ggml_backend_dev_type type;
|
|
158
|
+
struct ggml_backend_dev_caps caps;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
GGML_API const char * ggml_backend_dev_name(ggml_backend_dev_t device);
|
|
162
|
+
GGML_API const char * ggml_backend_dev_description(ggml_backend_dev_t device);
|
|
163
|
+
GGML_API void ggml_backend_dev_memory(ggml_backend_dev_t device, size_t * free, size_t * total);
|
|
164
|
+
GGML_API enum ggml_backend_dev_type ggml_backend_dev_type(ggml_backend_dev_t device);
|
|
165
|
+
GGML_API void ggml_backend_dev_get_props(ggml_backend_dev_t device, struct ggml_backend_dev_props * props);
|
|
166
|
+
GGML_API ggml_backend_reg_t ggml_backend_dev_backend_reg(ggml_backend_dev_t device);
|
|
167
|
+
GGML_API ggml_backend_t ggml_backend_dev_init(ggml_backend_dev_t device, const char * params);
|
|
168
|
+
GGML_API ggml_backend_buffer_type_t ggml_backend_dev_buffer_type(ggml_backend_dev_t device);
|
|
169
|
+
GGML_API ggml_backend_buffer_type_t ggml_backend_dev_host_buffer_type(ggml_backend_dev_t device);
|
|
170
|
+
GGML_API ggml_backend_buffer_t ggml_backend_dev_buffer_from_host_ptr(ggml_backend_dev_t device, void * ptr, size_t size, size_t max_tensor_size);
|
|
171
|
+
|
|
172
|
+
GGML_API bool ggml_backend_dev_supports_op(ggml_backend_dev_t device, const struct ggml_tensor * op);
|
|
173
|
+
GGML_API bool ggml_backend_dev_supports_buft(ggml_backend_dev_t device, ggml_backend_buffer_type_t buft);
|
|
174
|
+
GGML_API bool ggml_backend_dev_offload_op(ggml_backend_dev_t device, const struct ggml_tensor * op);
|
|
175
|
+
|
|
176
|
+
//
|
|
177
|
+
// Backend (reg)
|
|
178
|
+
//
|
|
179
|
+
|
|
180
|
+
GGML_API const char * ggml_backend_reg_name(ggml_backend_reg_t reg);
|
|
181
|
+
GGML_API size_t ggml_backend_reg_dev_count(ggml_backend_reg_t reg);
|
|
182
|
+
GGML_API ggml_backend_dev_t ggml_backend_reg_dev_get(ggml_backend_reg_t reg, size_t index);
|
|
183
|
+
GGML_API void * ggml_backend_reg_get_proc_address(ggml_backend_reg_t reg, const char * name);
|
|
184
|
+
|
|
185
|
+
// Common functions that may be obtained using ggml_backend_reg_get_proc_address
|
|
186
|
+
|
|
187
|
+
// Split buffer type for tensor parallelism
|
|
188
|
+
typedef ggml_backend_buffer_type_t (*ggml_backend_split_buffer_type_t)(int main_device, const float * tensor_split);
|
|
189
|
+
// Set the number of threads for the backend
|
|
190
|
+
typedef void (*ggml_backend_set_n_threads_t)(ggml_backend_t backend, int n_threads);
|
|
191
|
+
// Get additional buffer types provided by the device (returns a NULL-terminated array)
|
|
192
|
+
typedef ggml_backend_buffer_type_t * (*ggml_backend_dev_get_extra_bufts_t)(ggml_backend_dev_t device);
|
|
193
|
+
// Set the abort callback for the backend
|
|
194
|
+
typedef void (*ggml_backend_set_abort_callback_t)(ggml_backend_t backend, ggml_abort_callback abort_callback, void * abort_callback_data);
|
|
195
|
+
// Get a list of feature flags supported by the backend (returns a NULL-terminated array)
|
|
196
|
+
struct ggml_backend_feature {
|
|
197
|
+
const char * name;
|
|
198
|
+
const char * value;
|
|
199
|
+
};
|
|
200
|
+
typedef struct ggml_backend_feature * (*ggml_backend_get_features_t)(ggml_backend_reg_t reg);
|
|
201
|
+
|
|
202
|
+
//
|
|
203
|
+
// Backend registry
|
|
204
|
+
//
|
|
205
|
+
|
|
206
|
+
GGML_API void ggml_backend_device_register(ggml_backend_dev_t device);
|
|
207
|
+
|
|
208
|
+
// Backend (reg) enumeration
|
|
209
|
+
GGML_API size_t ggml_backend_reg_count(void);
|
|
210
|
+
GGML_API ggml_backend_reg_t ggml_backend_reg_get(size_t index);
|
|
211
|
+
GGML_API ggml_backend_reg_t ggml_backend_reg_by_name(const char * name);
|
|
212
|
+
|
|
213
|
+
// Device enumeration
|
|
214
|
+
GGML_API size_t ggml_backend_dev_count(void);
|
|
215
|
+
GGML_API ggml_backend_dev_t ggml_backend_dev_get(size_t index);
|
|
216
|
+
GGML_API ggml_backend_dev_t ggml_backend_dev_by_name(const char * name);
|
|
217
|
+
GGML_API ggml_backend_dev_t ggml_backend_dev_by_type(enum ggml_backend_dev_type type);
|
|
218
|
+
|
|
219
|
+
// Direct backend (stream) initialization
|
|
220
|
+
// = ggml_backend_dev_init(ggml_backend_dev_by_name(name), params)
|
|
221
|
+
GGML_API ggml_backend_t ggml_backend_init_by_name(const char * name, const char * params);
|
|
222
|
+
// = ggml_backend_dev_init(ggml_backend_dev_by_type(type), params)
|
|
223
|
+
GGML_API ggml_backend_t ggml_backend_init_by_type(enum ggml_backend_dev_type type, const char * params);
|
|
224
|
+
// = ggml_backend_dev_init(ggml_backend_dev_by_type(GPU) OR ggml_backend_dev_by_type(CPU), NULL)
|
|
225
|
+
GGML_API ggml_backend_t ggml_backend_init_best(void);
|
|
226
|
+
|
|
227
|
+
// Load a backend from a dynamic library and register it
|
|
228
|
+
GGML_API ggml_backend_reg_t ggml_backend_load(const char * path);
|
|
229
|
+
// Unload a backend if loaded dynamically and unregister it
|
|
230
|
+
GGML_API void ggml_backend_unload(ggml_backend_reg_t reg);
|
|
231
|
+
// Load all known backends from dynamic libraries
|
|
232
|
+
GGML_API void ggml_backend_load_all(void);
|
|
233
|
+
GGML_API void ggml_backend_load_all_from_path(const char * dir_path);
|
|
234
|
+
|
|
235
|
+
//
|
|
236
|
+
// Backend scheduler
|
|
237
|
+
//
|
|
238
|
+
|
|
239
|
+
// The backend scheduler allows for multiple backend devices to be used together
|
|
240
|
+
// Handles compute buffer allocation, assignment of tensors to backends, and copying of tensors between backends
|
|
241
|
+
// The backends are selected based on:
|
|
242
|
+
// - the backend that supports the operation
|
|
243
|
+
// - the location of the pre-allocated tensors (e.g. the weights)
|
|
244
|
+
/*
|
|
245
|
+
Example usage:
|
|
246
|
+
|
|
247
|
+
// operations that use tensors allocated in a buffer with USAGE_WEIGHTS will be assigned
|
|
248
|
+
// preferrably to run on the same backend as the buffer
|
|
249
|
+
ggml_backend_buffer_set_usage(buf_weights, GGML_BACKEND_BUFFER_USAGE_WEIGHTS);
|
|
250
|
+
|
|
251
|
+
sched = ggml_backend_sched_new({backend_gpu, backend_gpu2, backend_cpu}, NULL, num_backends, GGML_DEFAULT_GRAPH_SIZE, false, true);
|
|
252
|
+
|
|
253
|
+
// initialize buffers from a max size graph (optional)
|
|
254
|
+
reserve_graph = build_graph(sched, max_batch_size);
|
|
255
|
+
|
|
256
|
+
// manually assign nodes to a backend (optional, should not be needed in most cases)
|
|
257
|
+
struct ggml_tensor * node = ggml_mul_mat(ctx, ...);
|
|
258
|
+
ggml_backend_sched_set_tensor_backend(sched, node, backend_gpu);
|
|
259
|
+
|
|
260
|
+
ggml_backend_sched_reserve(sched, reserve_graph);
|
|
261
|
+
|
|
262
|
+
// compute
|
|
263
|
+
graph = build_graph(sched); // the graph and its tensors are single-use in terms of allocation, multi-use in terms of computation
|
|
264
|
+
for (int i = 0; i < 10; ++i) {
|
|
265
|
+
ggml_backend_sched_graph_compute(sched, graph); // on the first iteration the graph is allocated automatically
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// if there are graph inputs:
|
|
269
|
+
graph = build_graph(sched); // get a new graph that is not allocated (the metadata for the old graph is freed once ggml_free is called)
|
|
270
|
+
ggml_backend_sched_reset(sched); // clear the allocation of the previous graph
|
|
271
|
+
ggml_backend_sched_alloc_graph(sched, graph); // explicitly allocate the new graph but do not execute it
|
|
272
|
+
ggml_backend_tensor_set(input_tensor, ...); // copy data to the newly allocated graph tensors
|
|
273
|
+
ggml_backend_sched_graph_compute(sched, graph); // execute the graph
|
|
274
|
+
|
|
275
|
+
// as an alternative to the above it is also possible to assign the inputs to a dedicated context and
|
|
276
|
+
// allocate them statically via ggml_backend_alloc_ctx_tensors
|
|
277
|
+
}
|
|
278
|
+
*/
|
|
279
|
+
|
|
280
|
+
typedef struct ggml_backend_sched * ggml_backend_sched_t;
|
|
281
|
+
|
|
282
|
+
// Evaluation callback for each node in the graph (set with ggml_backend_sched_set_eval_callback)
|
|
283
|
+
// when ask == true, the scheduler wants to know if the user wants to observe this node
|
|
284
|
+
// this allows the scheduler to batch nodes together in order to evaluate them in a single call
|
|
285
|
+
//
|
|
286
|
+
// when ask == false, the scheduler is passing the node tensor to the user for observation
|
|
287
|
+
// if the user returns false, the scheduler will cancel the graph compute
|
|
288
|
+
//
|
|
289
|
+
typedef bool (*ggml_backend_sched_eval_callback)(struct ggml_tensor * t, bool ask, void * user_data);
|
|
290
|
+
|
|
291
|
+
// Initialize a backend scheduler, backends with low index are given priority over backends with high index
|
|
292
|
+
GGML_API ggml_backend_sched_t ggml_backend_sched_new(ggml_backend_t * backends, ggml_backend_buffer_type_t * bufts, int n_backends, size_t graph_size, bool parallel, bool op_offload);
|
|
293
|
+
GGML_API void ggml_backend_sched_free(ggml_backend_sched_t sched);
|
|
294
|
+
|
|
295
|
+
// Initialize backend buffers from a measure graph
|
|
296
|
+
GGML_API bool ggml_backend_sched_reserve(ggml_backend_sched_t sched, struct ggml_cgraph * measure_graph); // returns success
|
|
297
|
+
|
|
298
|
+
GGML_API int ggml_backend_sched_get_n_backends(ggml_backend_sched_t sched);
|
|
299
|
+
GGML_API ggml_backend_t ggml_backend_sched_get_backend(ggml_backend_sched_t sched, int i);
|
|
300
|
+
|
|
301
|
+
// Get the number of splits of the last graph
|
|
302
|
+
GGML_API int ggml_backend_sched_get_n_splits(ggml_backend_sched_t sched);
|
|
303
|
+
GGML_API int ggml_backend_sched_get_n_copies(ggml_backend_sched_t sched);
|
|
304
|
+
|
|
305
|
+
GGML_API size_t ggml_backend_sched_get_buffer_size(ggml_backend_sched_t sched, ggml_backend_t backend);
|
|
306
|
+
|
|
307
|
+
GGML_API void ggml_backend_sched_set_tensor_backend(ggml_backend_sched_t sched, struct ggml_tensor * node, ggml_backend_t backend);
|
|
308
|
+
GGML_API ggml_backend_t ggml_backend_sched_get_tensor_backend(ggml_backend_sched_t sched, struct ggml_tensor * node);
|
|
309
|
+
|
|
310
|
+
// Allocate and compute graph on the backend scheduler
|
|
311
|
+
GGML_API bool ggml_backend_sched_alloc_graph(ggml_backend_sched_t sched, struct ggml_cgraph * graph); // returns success
|
|
312
|
+
GGML_API enum ggml_status ggml_backend_sched_graph_compute(ggml_backend_sched_t sched, struct ggml_cgraph * graph);
|
|
313
|
+
GGML_API enum ggml_status ggml_backend_sched_graph_compute_async(ggml_backend_sched_t sched, struct ggml_cgraph * graph);
|
|
314
|
+
GGML_API void ggml_backend_sched_synchronize(ggml_backend_sched_t sched);
|
|
315
|
+
|
|
316
|
+
// Reset all assignments and allocators - must be called before changing the node backends or allocating a new graph.
|
|
317
|
+
// This in effect deallocates all tensors that were previously allocated and leaves them with dangling pointers.
|
|
318
|
+
// The correct way to use this API is to discard the deallocated tensors and create new ones.
|
|
319
|
+
GGML_API void ggml_backend_sched_reset(ggml_backend_sched_t sched);
|
|
320
|
+
|
|
321
|
+
// Set a callback to be called for each resulting node during graph compute
|
|
322
|
+
GGML_API void ggml_backend_sched_set_eval_callback(ggml_backend_sched_t sched, ggml_backend_sched_eval_callback callback, void * user_data);
|
|
323
|
+
|
|
324
|
+
//
|
|
325
|
+
// Utils
|
|
326
|
+
//
|
|
327
|
+
|
|
328
|
+
struct ggml_backend_graph_copy {
|
|
329
|
+
ggml_backend_buffer_t buffer;
|
|
330
|
+
struct ggml_context * ctx_allocated;
|
|
331
|
+
struct ggml_context * ctx_unallocated;
|
|
332
|
+
struct ggml_cgraph * graph;
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
// Copy a graph to a different backend
|
|
336
|
+
GGML_API struct ggml_backend_graph_copy ggml_backend_graph_copy(ggml_backend_t backend, struct ggml_cgraph * graph);
|
|
337
|
+
GGML_API void ggml_backend_graph_copy_free(struct ggml_backend_graph_copy copy);
|
|
338
|
+
|
|
339
|
+
typedef bool (*ggml_backend_eval_callback)(int node_index, struct ggml_tensor * t1, struct ggml_tensor * t2, void * user_data);
|
|
340
|
+
|
|
341
|
+
// Compare the output of two backends
|
|
342
|
+
GGML_API bool ggml_backend_compare_graph_backend(ggml_backend_t backend1, ggml_backend_t backend2, struct ggml_cgraph * graph, ggml_backend_eval_callback callback, void * user_data);
|
|
343
|
+
|
|
344
|
+
// Tensor initialization
|
|
345
|
+
GGML_API enum ggml_status ggml_backend_tensor_alloc(ggml_backend_buffer_t buffer, struct ggml_tensor * tensor, void * addr);
|
|
346
|
+
GGML_API enum ggml_status ggml_backend_view_init(struct ggml_tensor * tensor);
|
|
347
|
+
|
|
348
|
+
// CPU buffer types are always available
|
|
349
|
+
GGML_API ggml_backend_buffer_t ggml_backend_cpu_buffer_from_ptr(void * ptr, size_t size);
|
|
350
|
+
GGML_API ggml_backend_buffer_type_t ggml_backend_cpu_buffer_type(void);
|
|
351
|
+
|
|
352
|
+
#ifdef __cplusplus
|
|
353
|
+
}
|
|
354
|
+
#endif
|
package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/llama.framework/Headers/ggml-blas.h
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "ggml.h"
|
|
4
|
+
#include "ggml-backend.h"
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
#ifdef __cplusplus
|
|
8
|
+
extern "C" {
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
// backend API
|
|
12
|
+
GGML_BACKEND_API ggml_backend_t ggml_backend_blas_init(void);
|
|
13
|
+
|
|
14
|
+
GGML_BACKEND_API bool ggml_backend_is_blas(ggml_backend_t backend);
|
|
15
|
+
|
|
16
|
+
// number of threads used for conversion to float
|
|
17
|
+
// for openblas and blis, this will also set the number of threads used for blas operations
|
|
18
|
+
GGML_BACKEND_API void ggml_backend_blas_set_n_threads(ggml_backend_t backend_blas, int n_threads);
|
|
19
|
+
|
|
20
|
+
GGML_BACKEND_API ggml_backend_reg_t ggml_backend_blas_reg(void);
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#ifdef __cplusplus
|
|
24
|
+
}
|
|
25
|
+
#endif
|
package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/llama.framework/Headers/ggml-cpu.h
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "ggml.h"
|
|
4
|
+
#include "ggml-backend.h"
|
|
5
|
+
|
|
6
|
+
#ifdef __cplusplus
|
|
7
|
+
extern "C" {
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
// the compute plan that needs to be prepared for ggml_graph_compute()
|
|
11
|
+
// since https://github.com/ggml-org/ggml/issues/287
|
|
12
|
+
struct ggml_cplan {
|
|
13
|
+
size_t work_size; // size of work buffer, calculated by `ggml_graph_plan()`
|
|
14
|
+
uint8_t * work_data; // work buffer, to be allocated by caller before calling to `ggml_graph_compute()`
|
|
15
|
+
|
|
16
|
+
int n_threads;
|
|
17
|
+
struct ggml_threadpool * threadpool;
|
|
18
|
+
|
|
19
|
+
// abort ggml_graph_compute when true
|
|
20
|
+
ggml_abort_callback abort_callback;
|
|
21
|
+
void * abort_callback_data;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// numa strategies
|
|
25
|
+
enum ggml_numa_strategy {
|
|
26
|
+
GGML_NUMA_STRATEGY_DISABLED = 0,
|
|
27
|
+
GGML_NUMA_STRATEGY_DISTRIBUTE = 1,
|
|
28
|
+
GGML_NUMA_STRATEGY_ISOLATE = 2,
|
|
29
|
+
GGML_NUMA_STRATEGY_NUMACTL = 3,
|
|
30
|
+
GGML_NUMA_STRATEGY_MIRROR = 4,
|
|
31
|
+
GGML_NUMA_STRATEGY_COUNT
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
GGML_BACKEND_API void ggml_numa_init(enum ggml_numa_strategy numa); // call once for better performance on NUMA systems
|
|
35
|
+
GGML_BACKEND_API bool ggml_is_numa(void); // true if init detected that system has >1 NUMA node
|
|
36
|
+
|
|
37
|
+
GGML_BACKEND_API struct ggml_tensor * ggml_new_i32(struct ggml_context * ctx, int32_t value);
|
|
38
|
+
GGML_BACKEND_API struct ggml_tensor * ggml_new_f32(struct ggml_context * ctx, float value);
|
|
39
|
+
|
|
40
|
+
GGML_BACKEND_API struct ggml_tensor * ggml_set_i32 (struct ggml_tensor * tensor, int32_t value);
|
|
41
|
+
GGML_BACKEND_API struct ggml_tensor * ggml_set_f32 (struct ggml_tensor * tensor, float value);
|
|
42
|
+
|
|
43
|
+
GGML_BACKEND_API int32_t ggml_get_i32_1d(const struct ggml_tensor * tensor, int i);
|
|
44
|
+
GGML_BACKEND_API void ggml_set_i32_1d(const struct ggml_tensor * tensor, int i, int32_t value);
|
|
45
|
+
|
|
46
|
+
GGML_BACKEND_API int32_t ggml_get_i32_nd(const struct ggml_tensor * tensor, int i0, int i1, int i2, int i3);
|
|
47
|
+
GGML_BACKEND_API void ggml_set_i32_nd(const struct ggml_tensor * tensor, int i0, int i1, int i2, int i3, int32_t value);
|
|
48
|
+
|
|
49
|
+
GGML_BACKEND_API float ggml_get_f32_1d(const struct ggml_tensor * tensor, int i);
|
|
50
|
+
GGML_BACKEND_API void ggml_set_f32_1d(const struct ggml_tensor * tensor, int i, float value);
|
|
51
|
+
|
|
52
|
+
GGML_BACKEND_API float ggml_get_f32_nd(const struct ggml_tensor * tensor, int i0, int i1, int i2, int i3);
|
|
53
|
+
GGML_BACKEND_API void ggml_set_f32_nd(const struct ggml_tensor * tensor, int i0, int i1, int i2, int i3, float value);
|
|
54
|
+
|
|
55
|
+
GGML_BACKEND_API struct ggml_threadpool * ggml_threadpool_new (struct ggml_threadpool_params * params);
|
|
56
|
+
GGML_BACKEND_API void ggml_threadpool_free (struct ggml_threadpool * threadpool);
|
|
57
|
+
GGML_BACKEND_API int ggml_threadpool_get_n_threads (struct ggml_threadpool * threadpool);
|
|
58
|
+
GGML_BACKEND_API void ggml_threadpool_pause (struct ggml_threadpool * threadpool);
|
|
59
|
+
GGML_BACKEND_API void ggml_threadpool_resume (struct ggml_threadpool * threadpool);
|
|
60
|
+
|
|
61
|
+
// ggml_graph_plan() has to be called before ggml_graph_compute()
|
|
62
|
+
// when plan.work_size > 0, caller must allocate memory for plan.work_data
|
|
63
|
+
GGML_BACKEND_API struct ggml_cplan ggml_graph_plan(
|
|
64
|
+
const struct ggml_cgraph * cgraph,
|
|
65
|
+
int n_threads, /* = GGML_DEFAULT_N_THREADS */
|
|
66
|
+
struct ggml_threadpool * threadpool /* = NULL */ );
|
|
67
|
+
GGML_BACKEND_API enum ggml_status ggml_graph_compute(struct ggml_cgraph * cgraph, struct ggml_cplan * cplan);
|
|
68
|
+
|
|
69
|
+
// same as ggml_graph_compute() but the work data is allocated as a part of the context
|
|
70
|
+
// note: the drawback of this API is that you must have ensured that the context has enough memory for the work data
|
|
71
|
+
GGML_BACKEND_API enum ggml_status ggml_graph_compute_with_ctx(struct ggml_context * ctx, struct ggml_cgraph * cgraph, int n_threads);
|
|
72
|
+
|
|
73
|
+
//
|
|
74
|
+
// system info
|
|
75
|
+
//
|
|
76
|
+
|
|
77
|
+
// x86
|
|
78
|
+
GGML_BACKEND_API int ggml_cpu_has_sse3 (void);
|
|
79
|
+
GGML_BACKEND_API int ggml_cpu_has_ssse3 (void);
|
|
80
|
+
GGML_BACKEND_API int ggml_cpu_has_avx (void);
|
|
81
|
+
GGML_BACKEND_API int ggml_cpu_has_avx_vnni (void);
|
|
82
|
+
GGML_BACKEND_API int ggml_cpu_has_avx2 (void);
|
|
83
|
+
GGML_BACKEND_API int ggml_cpu_has_bmi2 (void);
|
|
84
|
+
GGML_BACKEND_API int ggml_cpu_has_f16c (void);
|
|
85
|
+
GGML_BACKEND_API int ggml_cpu_has_fma (void);
|
|
86
|
+
GGML_BACKEND_API int ggml_cpu_has_avx512 (void);
|
|
87
|
+
GGML_BACKEND_API int ggml_cpu_has_avx512_vbmi(void);
|
|
88
|
+
GGML_BACKEND_API int ggml_cpu_has_avx512_vnni(void);
|
|
89
|
+
GGML_BACKEND_API int ggml_cpu_has_avx512_bf16(void);
|
|
90
|
+
GGML_BACKEND_API int ggml_cpu_has_amx_int8 (void);
|
|
91
|
+
// ARM
|
|
92
|
+
GGML_BACKEND_API int ggml_cpu_has_neon (void);
|
|
93
|
+
GGML_BACKEND_API int ggml_cpu_has_arm_fma (void);
|
|
94
|
+
GGML_BACKEND_API int ggml_cpu_has_fp16_va (void);
|
|
95
|
+
GGML_BACKEND_API int ggml_cpu_has_dotprod (void);
|
|
96
|
+
GGML_BACKEND_API int ggml_cpu_has_matmul_int8(void);
|
|
97
|
+
GGML_BACKEND_API int ggml_cpu_has_sve (void);
|
|
98
|
+
GGML_BACKEND_API int ggml_cpu_get_sve_cnt (void); // sve vector length in bytes
|
|
99
|
+
GGML_BACKEND_API int ggml_cpu_has_sme (void);
|
|
100
|
+
// other
|
|
101
|
+
GGML_BACKEND_API int ggml_cpu_has_riscv_v (void);
|
|
102
|
+
GGML_BACKEND_API int ggml_cpu_has_vsx (void);
|
|
103
|
+
GGML_BACKEND_API int ggml_cpu_has_vxe (void);
|
|
104
|
+
GGML_BACKEND_API int ggml_cpu_has_wasm_simd (void);
|
|
105
|
+
GGML_BACKEND_API int ggml_cpu_has_llamafile (void);
|
|
106
|
+
|
|
107
|
+
// Internal types and functions exposed for tests and benchmarks
|
|
108
|
+
|
|
109
|
+
typedef void (*ggml_vec_dot_t) (int n, float * GGML_RESTRICT s, size_t bs, const void * GGML_RESTRICT x, size_t bx,
|
|
110
|
+
const void * GGML_RESTRICT y, size_t by, int nrc);
|
|
111
|
+
|
|
112
|
+
struct ggml_type_traits_cpu {
|
|
113
|
+
ggml_from_float_t from_float;
|
|
114
|
+
ggml_vec_dot_t vec_dot;
|
|
115
|
+
enum ggml_type vec_dot_type;
|
|
116
|
+
int64_t nrows; // number of rows to process simultaneously
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
GGML_BACKEND_API const struct ggml_type_traits_cpu * ggml_get_type_traits_cpu(enum ggml_type type);
|
|
120
|
+
|
|
121
|
+
GGML_BACKEND_API void ggml_cpu_init(void);
|
|
122
|
+
|
|
123
|
+
//
|
|
124
|
+
// CPU backend
|
|
125
|
+
//
|
|
126
|
+
|
|
127
|
+
GGML_BACKEND_API ggml_backend_t ggml_backend_cpu_init(void);
|
|
128
|
+
|
|
129
|
+
GGML_BACKEND_API bool ggml_backend_is_cpu (ggml_backend_t backend);
|
|
130
|
+
GGML_BACKEND_API void ggml_backend_cpu_set_n_threads (ggml_backend_t backend_cpu, int n_threads);
|
|
131
|
+
GGML_BACKEND_API void ggml_backend_cpu_set_threadpool (ggml_backend_t backend_cpu, ggml_threadpool_t threadpool);
|
|
132
|
+
GGML_BACKEND_API void ggml_backend_cpu_set_abort_callback(ggml_backend_t backend_cpu, ggml_abort_callback abort_callback, void * abort_callback_data);
|
|
133
|
+
|
|
134
|
+
GGML_BACKEND_API ggml_backend_reg_t ggml_backend_cpu_reg(void);
|
|
135
|
+
|
|
136
|
+
GGML_BACKEND_API void ggml_cpu_fp32_to_fp16(const float *, ggml_fp16_t *, int64_t);
|
|
137
|
+
GGML_BACKEND_API void ggml_cpu_fp16_to_fp32(const ggml_fp16_t *, float *, int64_t);
|
|
138
|
+
GGML_BACKEND_API void ggml_cpu_fp32_to_bf16(const float *, ggml_bf16_t *, int64_t);
|
|
139
|
+
GGML_BACKEND_API void ggml_cpu_bf16_to_fp32(const ggml_bf16_t *, float *, int64_t);
|
|
140
|
+
|
|
141
|
+
#ifdef __cplusplus
|
|
142
|
+
}
|
|
143
|
+
#endif
|
package/ios/libs/llama.xcframework/tvos-arm64_x86_64-simulator/llama.framework/Headers/ggml-metal.h
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Note: this description is outdated
|
|
2
|
+
//
|
|
3
|
+
// An interface allowing to compute ggml_cgraph with Metal
|
|
4
|
+
//
|
|
5
|
+
// This is a fully functional interface that extends ggml with GPU support for Apple devices.
|
|
6
|
+
// A similar interface can be created for other GPU backends (e.g. Vulkan, CUDA, etc.)
|
|
7
|
+
//
|
|
8
|
+
// How it works?
|
|
9
|
+
//
|
|
10
|
+
// As long as your program can create and evaluate a ggml_cgraph on the CPU, you can use this
|
|
11
|
+
// interface to evaluate the same graph on the GPU. Instead of using ggml_graph_compute(), you
|
|
12
|
+
// use ggml_metal_graph_compute() (or ggml_vulkan_graph_compute(), etc.)
|
|
13
|
+
//
|
|
14
|
+
// You only need to make sure that all memory buffers that you used during the graph creation
|
|
15
|
+
// are mapped to the device memory with the ggml_metal_add_buffer() function. This mapping is
|
|
16
|
+
// used during the graph evaluation to determine the arguments of the compute kernels.
|
|
17
|
+
//
|
|
18
|
+
// Synchronization between device and host memory (for example for input and output tensors)
|
|
19
|
+
// is done with the ggml_metal_set_tensor() and ggml_metal_get_tensor() functions.
|
|
20
|
+
//
|
|
21
|
+
|
|
22
|
+
#pragma once
|
|
23
|
+
|
|
24
|
+
#include "ggml.h"
|
|
25
|
+
#include "ggml-backend.h"
|
|
26
|
+
|
|
27
|
+
#include <stddef.h>
|
|
28
|
+
#include <stdbool.h>
|
|
29
|
+
|
|
30
|
+
struct ggml_tensor;
|
|
31
|
+
struct ggml_cgraph;
|
|
32
|
+
|
|
33
|
+
#ifdef __cplusplus
|
|
34
|
+
extern "C" {
|
|
35
|
+
#endif
|
|
36
|
+
|
|
37
|
+
//
|
|
38
|
+
// backend API
|
|
39
|
+
// user-code should use only these functions
|
|
40
|
+
//
|
|
41
|
+
|
|
42
|
+
GGML_BACKEND_API ggml_backend_t ggml_backend_metal_init(void);
|
|
43
|
+
|
|
44
|
+
GGML_BACKEND_API bool ggml_backend_is_metal(ggml_backend_t backend);
|
|
45
|
+
|
|
46
|
+
GGML_DEPRECATED(
|
|
47
|
+
GGML_BACKEND_API ggml_backend_buffer_t ggml_backend_metal_buffer_from_ptr(void * data, size_t size, size_t max_size),
|
|
48
|
+
"obsoleted by the new device interface - https://github.com/ggml-org/llama.cpp/pull/9713");
|
|
49
|
+
|
|
50
|
+
GGML_BACKEND_API void ggml_backend_metal_set_abort_callback(ggml_backend_t backend, ggml_abort_callback abort_callback, void * user_data);
|
|
51
|
+
|
|
52
|
+
GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_metal_buffer_type(void);
|
|
53
|
+
|
|
54
|
+
// helper to check if the device supports a specific family
|
|
55
|
+
// ideally, the user code should be doing these checks
|
|
56
|
+
// ref: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
|
|
57
|
+
GGML_BACKEND_API bool ggml_backend_metal_supports_family(ggml_backend_t backend, int family);
|
|
58
|
+
|
|
59
|
+
// capture all command buffers committed the next time `ggml_backend_graph_compute` is called
|
|
60
|
+
GGML_BACKEND_API void ggml_backend_metal_capture_next_compute(ggml_backend_t backend);
|
|
61
|
+
|
|
62
|
+
GGML_BACKEND_API ggml_backend_reg_t ggml_backend_metal_reg(void);
|
|
63
|
+
|
|
64
|
+
#ifdef __cplusplus
|
|
65
|
+
}
|
|
66
|
+
#endif
|