toy 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +1124 -0
- data/LICENSE +21 -0
- data/Makefile +2022 -0
- data/README.md +154 -0
- data/bin/toy +10 -0
- data/lib/toy/compute.rb +135 -0
- data/lib/toy/compute_cuda.rb +104 -0
- data/lib/toy/compute_metal.rb +97 -0
- data/lib/toy/core/cli/describe.rb +188 -0
- data/lib/toy/core/cli/eval.rb +385 -0
- data/lib/toy/core/cli/exit_codes.rb +15 -0
- data/lib/toy/core/cli/fetch.rb +238 -0
- data/lib/toy/core/cli/infer.rb +268 -0
- data/lib/toy/core/cli/install.rb +228 -0
- data/lib/toy/core/cli/list.rb +86 -0
- data/lib/toy/core/cli/manifest.rb +49 -0
- data/lib/toy/core/cli/new.rb +594 -0
- data/lib/toy/core/cli/serve.rb +237 -0
- data/lib/toy/core/cli/train.rb +471 -0
- data/lib/toy/core/cli.rb +165 -0
- data/lib/toy/core/config.rb +64 -0
- data/lib/toy/core/gguf_meta.rb +161 -0
- data/lib/toy/core/model_scan.rb +221 -0
- data/lib/toy/core/run_log.rb +94 -0
- data/lib/toy/core/toy_root.rb +95 -0
- data/lib/toy/dev/toy_card.rb +299 -0
- data/lib/toy/dev/toy_describe_flow.rb +412 -0
- data/lib/toy/dev/toy_logprobs.rb +86 -0
- data/lib/toy/dev/toy_tap.rb +183 -0
- data/lib/toy/dev/toy_token_drift.rb +121 -0
- data/lib/toy/ffi/tinynn.rb +1491 -0
- data/lib/toy/ffi/tinynn_cuda.rb +1124 -0
- data/lib/toy/ffi/tinynn_metal.rb +359 -0
- data/lib/toy/ffi_manifest.rb +84 -0
- data/lib/toy/io/bpe.rb +325 -0
- data/lib/toy/io/gguf_kv.rb +35 -0
- data/lib/toy/io/gguf_load.rb +331 -0
- data/lib/toy/io/loaders/toy_gpt2_loader.rb +70 -0
- data/lib/toy/io/loaders/toy_smollm2_loader.rb +754 -0
- data/lib/toy/io/model_index.rb +206 -0
- data/lib/toy/io/run_bundle.rb +280 -0
- data/lib/toy/io/tokenizer.rb +613 -0
- data/lib/toy/io/toy_corpus_loader.rb +52 -0
- data/lib/toy/io/toy_events.rb +56 -0
- data/lib/toy/io/toy_image_loader.rb +48 -0
- data/lib/toy/llm/adamw.rb +169 -0
- data/lib/toy/llm/archs/llama_arch.rb +233 -0
- data/lib/toy/llm/archs/llama_arch_cuda.rb +237 -0
- data/lib/toy/llm/archs/llama_arch_metal.rb +237 -0
- data/lib/toy/llm/blocks/transformer_block.rb +876 -0
- data/lib/toy/llm/blocks/transformer_block_cuda.rb +880 -0
- data/lib/toy/llm/blocks/transformer_block_metal.rb +880 -0
- data/lib/toy/llm/classify_batch.rb +88 -0
- data/lib/toy/llm/engine/gpt2_fwd_engine.rb +360 -0
- data/lib/toy/llm/engine/gpt2_fwd_engine_cuda.rb +362 -0
- data/lib/toy/llm/engine/gpt2_fwd_engine_metal.rb +362 -0
- data/lib/toy/llm/engine/gpt2_kv_engine.rb +346 -0
- data/lib/toy/llm/engine/gpt2_kv_engine_cuda.rb +348 -0
- data/lib/toy/llm/engine/gpt2_kv_engine_metal.rb +348 -0
- data/lib/toy/llm/engine/gpt2_seq_engine.rb +289 -0
- data/lib/toy/llm/engine/gpt2_seq_engine_cuda.rb +293 -0
- data/lib/toy/llm/engine/gpt2_seq_engine_metal.rb +293 -0
- data/lib/toy/llm/engine/llama_kv_engine.rb +1593 -0
- data/lib/toy/llm/engine/llama_kv_engine_cuda.rb +1526 -0
- data/lib/toy/llm/engine/llama_kv_engine_metal.rb +1526 -0
- data/lib/toy/llm/engine/llama_seq_engine.rb +1233 -0
- data/lib/toy/llm/engine/llama_seq_engine_cuda.rb +1238 -0
- data/lib/toy/llm/engine/llama_seq_engine_metal.rb +1238 -0
- data/lib/toy/llm/engine/vit_tiny_engine.rb +467 -0
- data/lib/toy/llm/labels.rb +142 -0
- data/lib/toy/llm/primitives/gqa.rb +62 -0
- data/lib/toy/llm/primitives/gqa_cuda.rb +66 -0
- data/lib/toy/llm/primitives/gqa_metal.rb +66 -0
- data/lib/toy/llm/primitives/rms_norm.rb +39 -0
- data/lib/toy/llm/primitives/rms_norm_cuda.rb +43 -0
- data/lib/toy/llm/primitives/rms_norm_metal.rb +43 -0
- data/lib/toy/llm/primitives/rope.rb +68 -0
- data/lib/toy/llm/primitives/rope_cuda.rb +72 -0
- data/lib/toy/llm/primitives/rope_metal.rb +72 -0
- data/lib/toy/llm/primitives/swiglu.rb +41 -0
- data/lib/toy/llm/primitives/swiglu_cuda.rb +45 -0
- data/lib/toy/llm/primitives/swiglu_metal.rb +45 -0
- data/lib/toy/llm/recipe_options.rb +71 -0
- data/lib/toy/llm/recipes/from_scratch.rb +105 -0
- data/lib/toy/llm/recipes/from_scratch_cuda.rb +109 -0
- data/lib/toy/llm/recipes/from_scratch_metal.rb +109 -0
- data/lib/toy/llm/recipes/lora.rb +110 -0
- data/lib/toy/llm/recipes/lora_cuda.rb +114 -0
- data/lib/toy/llm/recipes/lora_metal.rb +114 -0
- data/lib/toy/llm/recipes/vit_tiny.rb +75 -0
- data/lib/toy/llm/recipes/warm_start.rb +235 -0
- data/lib/toy/llm/recipes/warm_start_cuda.rb +239 -0
- data/lib/toy/llm/recipes/warm_start_metal.rb +239 -0
- data/lib/toy/llm/training_batch.rb +133 -0
- data/lib/toy/models/arch.rb +253 -0
- data/lib/toy/models/gpt2.rb +311 -0
- data/lib/toy/models/toy_gpt2.rb +177 -0
- data/lib/toy/models/toy_smollm2.rb +393 -0
- data/lib/toy/models/toy_vit.rb +83 -0
- data/lib/toy/models/transformer.rb +1494 -0
- data/lib/toy/models/transformer_lm.rb +298 -0
- data/lib/toy/models/transformer_lm_cuda.rb +159 -0
- data/lib/toy/models/transformer_lm_metal.rb +142 -0
- data/lib/toy/mri.rb +300 -0
- data/lib/toy/run/eval.rb +76 -0
- data/lib/toy/run/eval_cuda.rb +66 -0
- data/lib/toy/run/eval_lmc.rb +334 -0
- data/lib/toy/run/eval_metal.rb +67 -0
- data/lib/toy/run/infer.rb +130 -0
- data/lib/toy/run/infer_cuda.rb +118 -0
- data/lib/toy/run/infer_metal.rb +119 -0
- data/lib/toy/run/infer_trace.rb +37 -0
- data/lib/toy/run/serve.rb +144 -0
- data/lib/toy/run/train.rb +404 -0
- data/lib/toy/run/train_cuda.rb +397 -0
- data/lib/toy/run/train_gpt2.rb +103 -0
- data/lib/toy/run/train_gpt2_cuda.rb +85 -0
- data/lib/toy/run/train_gpt2_metal.rb +85 -0
- data/lib/toy/run/train_lora.rb +207 -0
- data/lib/toy/run/train_lora_cuda.rb +219 -0
- data/lib/toy/run/train_metal.rb +227 -0
- data/lib/toy/run/train_vit.rb +251 -0
- data/lib/toy/serve/openai/embeddings_handler.rb +92 -0
- data/lib/toy/serve/openai/handlers.rb +143 -0
- data/lib/toy/serve/openai/server.rb +159 -0
- data/lib/toy/train/sampler.rb +314 -0
- data/lib/toy/train/toy_chat_template.rb +179 -0
- data/lib/toy/train/toy_drift_grad.rb +176 -0
- data/lib/toy/train/toy_gguf_fuse.rb +428 -0
- data/lib/toy/train/toy_gguf_writer.rb +100 -0
- data/lib/toy/train/toy_lr_schedule.rb +39 -0
- data/lib/toy/train/toy_sample.rb +125 -0
- data/lib/toy/train/toy_trainer.rb +86 -0
- data/lib/toy/train/training.rb +160 -0
- data/lib/toy/version.rb +11 -0
- data/lib/toy.rb +902 -0
- data/prep/progress +118 -0
- data/prep/quietly +64 -0
- data/sig/toy.rbs +397 -0
- data/sig/toy_compute.rbs +450 -0
- data/spinel-ext.json +122 -0
- data/tinynn/Makefile +71 -0
- data/tinynn/tinynn_backend_cuda.c +99 -0
- data/tinynn/tinynn_backend_metal.m +75 -0
- data/tinynn/tinynn_events.c +122 -0
- data/tinynn/tinynn_events.h +83 -0
- data/tinynn/tinynn_ggml.c +2460 -0
- data/tinynn/tinynn_ggml.h +545 -0
- data/tinynn/tinynn_gguf.c +783 -0
- data/tinynn/tinynn_gguf.h +167 -0
- data/tinynn/tinynn_trace.c +180 -0
- data/tinynn/tinynn_trace.h +85 -0
- data/vendor/ggml/AUTHORS +335 -0
- data/vendor/ggml/CMakeLists.txt +505 -0
- data/vendor/ggml/CONTRIBUTING.md +3 -0
- data/vendor/ggml/LICENSE +21 -0
- data/vendor/ggml/README.md +50 -0
- data/vendor/ggml/ci/run.sh +395 -0
- data/vendor/ggml/cmake/FindNCCL.cmake +36 -0
- data/vendor/ggml/cmake/GitVars.cmake +22 -0
- data/vendor/ggml/cmake/common.cmake +50 -0
- data/vendor/ggml/cmake/ggml-config.cmake.in +191 -0
- data/vendor/ggml/docs/gguf.md +828 -0
- data/vendor/ggml/examples/CMakeLists.txt +34 -0
- data/vendor/ggml/examples/common-ggml.cpp +244 -0
- data/vendor/ggml/examples/common-ggml.h +18 -0
- data/vendor/ggml/examples/common.cpp +675 -0
- data/vendor/ggml/examples/common.h +322 -0
- data/vendor/ggml/examples/gpt-2/CMakeLists.txt +32 -0
- data/vendor/ggml/examples/gpt-2/README.md +225 -0
- data/vendor/ggml/examples/gpt-2/convert-cerebras-to-ggml.py +183 -0
- data/vendor/ggml/examples/gpt-2/convert-ckpt-to-ggml.py +159 -0
- data/vendor/ggml/examples/gpt-2/convert-h5-to-ggml.py +195 -0
- data/vendor/ggml/examples/gpt-2/download-ggml-model.sh +69 -0
- data/vendor/ggml/examples/gpt-2/download-model.sh +48 -0
- data/vendor/ggml/examples/gpt-2/main-alloc.cpp +880 -0
- data/vendor/ggml/examples/gpt-2/main-backend.cpp +946 -0
- data/vendor/ggml/examples/gpt-2/main-batched.cpp +1210 -0
- data/vendor/ggml/examples/gpt-2/main-ctx.cpp +840 -0
- data/vendor/ggml/examples/gpt-2/main-sched.cpp +1079 -0
- data/vendor/ggml/examples/gpt-2/quantize.cpp +184 -0
- data/vendor/ggml/examples/gpt-j/CMakeLists.txt +13 -0
- data/vendor/ggml/examples/gpt-j/README.md +239 -0
- data/vendor/ggml/examples/gpt-j/convert-h5-to-ggml.py +173 -0
- data/vendor/ggml/examples/gpt-j/download-ggml-model.sh +69 -0
- data/vendor/ggml/examples/gpt-j/download-model.sh +11 -0
- data/vendor/ggml/examples/gpt-j/main.cpp +755 -0
- data/vendor/ggml/examples/gpt-j/quantize.cpp +182 -0
- data/vendor/ggml/examples/magika/CMakeLists.txt +17 -0
- data/vendor/ggml/examples/magika/README.md +23 -0
- data/vendor/ggml/examples/magika/convert.py +32 -0
- data/vendor/ggml/examples/magika/main.cpp +374 -0
- data/vendor/ggml/examples/mnist/CMakeLists.txt +58 -0
- data/vendor/ggml/examples/mnist/README.md +206 -0
- data/vendor/ggml/examples/mnist/mnist-common.cpp +496 -0
- data/vendor/ggml/examples/mnist/mnist-common.h +166 -0
- data/vendor/ggml/examples/mnist/mnist-eval.cpp +67 -0
- data/vendor/ggml/examples/mnist/mnist-train-cnn.py +91 -0
- data/vendor/ggml/examples/mnist/mnist-train-fc.py +131 -0
- data/vendor/ggml/examples/mnist/mnist-train.cpp +39 -0
- data/vendor/ggml/examples/mnist/server.py +36 -0
- data/vendor/ggml/examples/mnist/web/index.html +178 -0
- data/vendor/ggml/examples/perf-metal/CMakeLists.txt +7 -0
- data/vendor/ggml/examples/perf-metal/perf-metal.cpp +152 -0
- data/vendor/ggml/examples/prompts/dolly-v2.txt +100 -0
- data/vendor/ggml/examples/prompts/gpt-2-chinese.txt +1 -0
- data/vendor/ggml/examples/prompts/gpt-2.txt +100 -0
- data/vendor/ggml/examples/prompts/gpt-j.txt +100 -0
- data/vendor/ggml/examples/prompts/gpt-neox-japanese.txt +1 -0
- data/vendor/ggml/examples/prompts/gpt-neox.txt +100 -0
- data/vendor/ggml/examples/prompts/polyglot-ko.txt +3 -0
- data/vendor/ggml/examples/prompts/replit.txt +100 -0
- data/vendor/ggml/examples/prompts/starcoder.txt +100 -0
- data/vendor/ggml/examples/prompts/test-cases.txt +110 -0
- data/vendor/ggml/examples/prompts/tokenize_huggingface.py +65 -0
- data/vendor/ggml/examples/prompts/whisper.txt +100 -0
- data/vendor/ggml/examples/python/README.md +115 -0
- data/vendor/ggml/examples/python/api.h +14 -0
- data/vendor/ggml/examples/python/example_add_quant.py +25 -0
- data/vendor/ggml/examples/python/example_test_all_quants.py +68 -0
- data/vendor/ggml/examples/python/ggml/__init__.py +58 -0
- data/vendor/ggml/examples/python/ggml/__init__.pyi +2406 -0
- data/vendor/ggml/examples/python/ggml/cffi.py +11 -0
- data/vendor/ggml/examples/python/ggml/ffi/__init__.pyi +7 -0
- data/vendor/ggml/examples/python/ggml/utils.py +182 -0
- data/vendor/ggml/examples/python/regenerate.py +42 -0
- data/vendor/ggml/examples/python/stubs.py +128 -0
- data/vendor/ggml/examples/python/test_tensor.py +258 -0
- data/vendor/ggml/examples/sam/CMakeLists.txt +13 -0
- data/vendor/ggml/examples/sam/README.md +95 -0
- data/vendor/ggml/examples/sam/convert-pth-to-ggml.py +147 -0
- data/vendor/ggml/examples/sam/example.jpg +0 -0
- data/vendor/ggml/examples/sam/sam.cpp +2370 -0
- data/vendor/ggml/examples/simple/CMakeLists.txt +21 -0
- data/vendor/ggml/examples/simple/README.md +61 -0
- data/vendor/ggml/examples/simple/simple-backend.cpp +153 -0
- data/vendor/ggml/examples/simple/simple-ctx.cpp +127 -0
- data/vendor/ggml/examples/stb_image.h +7987 -0
- data/vendor/ggml/examples/stb_image_write.h +1724 -0
- data/vendor/ggml/examples/test-cmake/CMakeLists.txt +10 -0
- data/vendor/ggml/examples/test-cmake/README.md +3 -0
- data/vendor/ggml/examples/test-cmake/test-cmake.cpp +6 -0
- data/vendor/ggml/examples/yolo/CMakeLists.txt +6 -0
- data/vendor/ggml/examples/yolo/README.md +59 -0
- data/vendor/ggml/examples/yolo/convert-yolov3-tiny.py +53 -0
- data/vendor/ggml/examples/yolo/data/coco.names +80 -0
- data/vendor/ggml/examples/yolo/data/labels/100_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/100_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/100_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/100_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/100_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/100_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/100_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/100_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/101_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/101_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/101_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/101_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/101_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/101_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/101_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/101_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/102_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/102_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/102_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/102_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/102_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/102_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/102_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/102_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/103_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/103_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/103_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/103_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/103_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/103_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/103_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/103_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/104_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/104_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/104_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/104_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/104_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/104_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/104_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/104_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/105_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/105_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/105_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/105_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/105_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/105_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/105_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/105_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/106_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/106_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/106_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/106_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/106_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/106_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/106_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/106_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/107_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/107_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/107_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/107_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/107_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/107_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/107_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/107_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/108_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/108_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/108_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/108_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/108_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/108_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/108_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/108_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/109_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/109_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/109_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/109_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/109_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/109_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/109_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/109_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/110_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/110_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/110_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/110_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/110_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/110_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/110_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/110_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/111_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/111_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/111_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/111_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/111_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/111_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/111_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/111_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/112_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/112_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/112_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/112_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/112_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/112_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/112_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/112_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/113_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/113_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/113_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/113_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/113_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/113_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/113_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/113_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/114_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/114_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/114_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/114_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/114_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/114_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/114_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/114_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/115_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/115_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/115_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/115_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/115_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/115_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/115_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/115_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/116_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/116_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/116_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/116_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/116_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/116_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/116_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/116_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/117_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/117_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/117_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/117_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/117_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/117_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/117_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/117_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/118_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/118_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/118_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/118_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/118_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/118_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/118_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/118_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/119_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/119_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/119_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/119_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/119_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/119_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/119_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/119_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/120_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/120_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/120_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/120_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/120_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/120_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/120_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/120_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/121_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/121_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/121_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/121_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/121_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/121_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/121_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/121_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/122_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/122_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/122_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/122_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/122_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/122_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/122_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/122_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/123_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/123_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/123_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/123_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/123_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/123_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/123_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/123_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/124_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/124_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/124_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/124_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/124_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/124_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/124_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/124_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/125_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/125_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/125_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/125_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/125_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/125_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/125_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/125_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/126_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/126_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/126_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/126_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/126_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/126_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/126_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/126_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/32_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/32_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/32_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/32_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/32_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/32_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/32_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/32_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/33_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/33_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/33_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/33_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/33_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/33_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/33_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/33_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/34_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/34_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/34_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/34_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/34_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/34_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/34_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/34_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/35_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/35_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/35_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/35_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/35_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/35_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/35_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/35_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/36_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/36_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/36_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/36_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/36_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/36_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/36_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/36_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/37_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/37_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/37_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/37_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/37_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/37_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/37_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/37_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/38_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/38_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/38_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/38_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/38_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/38_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/38_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/38_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/39_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/39_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/39_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/39_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/39_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/39_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/39_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/39_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/40_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/40_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/40_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/40_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/40_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/40_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/40_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/40_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/41_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/41_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/41_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/41_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/41_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/41_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/41_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/41_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/42_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/42_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/42_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/42_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/42_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/42_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/42_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/42_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/43_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/43_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/43_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/43_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/43_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/43_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/43_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/43_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/44_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/44_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/44_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/44_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/44_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/44_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/44_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/44_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/45_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/45_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/45_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/45_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/45_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/45_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/45_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/45_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/46_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/46_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/46_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/46_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/46_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/46_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/46_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/46_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/47_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/47_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/47_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/47_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/47_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/47_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/47_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/47_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/48_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/48_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/48_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/48_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/48_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/48_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/48_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/48_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/49_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/49_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/49_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/49_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/49_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/49_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/49_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/49_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/50_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/50_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/50_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/50_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/50_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/50_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/50_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/50_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/51_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/51_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/51_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/51_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/51_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/51_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/51_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/51_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/52_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/52_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/52_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/52_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/52_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/52_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/52_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/52_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/53_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/53_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/53_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/53_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/53_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/53_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/53_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/53_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/54_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/54_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/54_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/54_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/54_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/54_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/54_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/54_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/55_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/55_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/55_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/55_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/55_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/55_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/55_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/55_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/56_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/56_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/56_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/56_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/56_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/56_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/56_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/56_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/57_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/57_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/57_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/57_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/57_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/57_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/57_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/57_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/58_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/58_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/58_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/58_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/58_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/58_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/58_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/58_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/59_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/59_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/59_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/59_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/59_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/59_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/59_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/59_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/60_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/60_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/60_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/60_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/60_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/60_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/60_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/60_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/61_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/61_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/61_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/61_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/61_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/61_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/61_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/61_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/62_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/62_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/62_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/62_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/62_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/62_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/62_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/62_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/63_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/63_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/63_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/63_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/63_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/63_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/63_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/63_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/64_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/64_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/64_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/64_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/64_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/64_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/64_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/64_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/65_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/65_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/65_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/65_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/65_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/65_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/65_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/65_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/66_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/66_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/66_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/66_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/66_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/66_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/66_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/66_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/67_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/67_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/67_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/67_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/67_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/67_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/67_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/67_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/68_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/68_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/68_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/68_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/68_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/68_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/68_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/68_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/69_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/69_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/69_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/69_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/69_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/69_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/69_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/69_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/70_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/70_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/70_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/70_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/70_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/70_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/70_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/70_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/71_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/71_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/71_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/71_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/71_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/71_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/71_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/71_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/72_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/72_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/72_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/72_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/72_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/72_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/72_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/72_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/73_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/73_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/73_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/73_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/73_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/73_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/73_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/73_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/74_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/74_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/74_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/74_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/74_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/74_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/74_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/74_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/75_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/75_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/75_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/75_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/75_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/75_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/75_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/75_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/76_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/76_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/76_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/76_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/76_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/76_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/76_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/76_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/77_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/77_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/77_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/77_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/77_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/77_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/77_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/77_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/78_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/78_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/78_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/78_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/78_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/78_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/78_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/78_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/79_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/79_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/79_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/79_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/79_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/79_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/79_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/79_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/80_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/80_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/80_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/80_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/80_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/80_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/80_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/80_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/81_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/81_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/81_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/81_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/81_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/81_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/81_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/81_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/82_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/82_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/82_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/82_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/82_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/82_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/82_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/82_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/83_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/83_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/83_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/83_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/83_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/83_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/83_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/83_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/84_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/84_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/84_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/84_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/84_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/84_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/84_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/84_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/85_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/85_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/85_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/85_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/85_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/85_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/85_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/85_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/86_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/86_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/86_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/86_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/86_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/86_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/86_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/86_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/87_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/87_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/87_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/87_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/87_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/87_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/87_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/87_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/88_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/88_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/88_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/88_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/88_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/88_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/88_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/88_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/89_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/89_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/89_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/89_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/89_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/89_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/89_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/89_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/90_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/90_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/90_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/90_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/90_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/90_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/90_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/90_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/91_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/91_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/91_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/91_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/91_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/91_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/91_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/91_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/92_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/92_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/92_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/92_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/92_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/92_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/92_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/92_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/93_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/93_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/93_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/93_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/93_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/93_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/93_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/93_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/94_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/94_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/94_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/94_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/94_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/94_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/94_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/94_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/95_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/95_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/95_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/95_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/95_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/95_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/95_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/95_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/96_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/96_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/96_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/96_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/96_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/96_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/96_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/96_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/97_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/97_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/97_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/97_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/97_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/97_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/97_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/97_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/98_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/98_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/98_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/98_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/98_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/98_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/98_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/98_7.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/99_0.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/99_1.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/99_2.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/99_3.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/99_4.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/99_5.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/99_6.png +0 -0
- data/vendor/ggml/examples/yolo/data/labels/99_7.png +0 -0
- data/vendor/ggml/examples/yolo/yolo-image.cpp +210 -0
- data/vendor/ggml/examples/yolo/yolo-image.h +39 -0
- data/vendor/ggml/examples/yolo/yolov3-tiny.cpp +661 -0
- data/vendor/ggml/ggml.pc.in +10 -0
- data/vendor/ggml/include/ggml-alloc.h +85 -0
- data/vendor/ggml/include/ggml-backend.h +431 -0
- data/vendor/ggml/include/ggml-blas.h +25 -0
- data/vendor/ggml/include/ggml-cann.h +123 -0
- data/vendor/ggml/include/ggml-cpp.h +39 -0
- data/vendor/ggml/include/ggml-cpu.h +151 -0
- data/vendor/ggml/include/ggml-cuda.h +50 -0
- data/vendor/ggml/include/ggml-hexagon.h +19 -0
- data/vendor/ggml/include/ggml-metal.h +61 -0
- data/vendor/ggml/include/ggml-opencl.h +26 -0
- data/vendor/ggml/include/ggml-openvino.h +37 -0
- data/vendor/ggml/include/ggml-opt.h +256 -0
- data/vendor/ggml/include/ggml-rpc.h +35 -0
- data/vendor/ggml/include/ggml-sycl.h +49 -0
- data/vendor/ggml/include/ggml-virtgpu.h +14 -0
- data/vendor/ggml/include/ggml-vulkan.h +29 -0
- data/vendor/ggml/include/ggml-webgpu.h +19 -0
- data/vendor/ggml/include/ggml-zdnn.h +17 -0
- data/vendor/ggml/include/ggml-zendnn.h +22 -0
- data/vendor/ggml/include/ggml.h +2845 -0
- data/vendor/ggml/include/gguf.h +204 -0
- data/vendor/ggml/requirements.txt +12 -0
- data/vendor/ggml/scripts/gen-authors.sh +9 -0
- data/vendor/ggml/scripts/release.sh +296 -0
- data/vendor/ggml/scripts/sync-llama-am.sh +167 -0
- data/vendor/ggml/scripts/sync-llama.last +1 -0
- data/vendor/ggml/scripts/sync-llama.sh +21 -0
- data/vendor/ggml/scripts/sync-whisper-am.sh +138 -0
- data/vendor/ggml/scripts/sync-whisper.last +1 -0
- data/vendor/ggml/scripts/sync-whisper.sh +17 -0
- data/vendor/ggml/src/CMakeLists.txt +493 -0
- data/vendor/ggml/src/ggml-alloc.c +1248 -0
- data/vendor/ggml/src/ggml-backend-dl.cpp +48 -0
- data/vendor/ggml/src/ggml-backend-dl.h +45 -0
- data/vendor/ggml/src/ggml-backend-impl.h +275 -0
- data/vendor/ggml/src/ggml-backend-meta.cpp +2144 -0
- data/vendor/ggml/src/ggml-backend-reg.cpp +586 -0
- data/vendor/ggml/src/ggml-backend.cpp +2371 -0
- data/vendor/ggml/src/ggml-blas/CMakeLists.txt +101 -0
- data/vendor/ggml/src/ggml-blas/ggml-blas.cpp +522 -0
- data/vendor/ggml/src/ggml-cann/CMakeLists.txt +89 -0
- data/vendor/ggml/src/ggml-cann/acl_tensor.cpp +195 -0
- data/vendor/ggml/src/ggml-cann/acl_tensor.h +349 -0
- data/vendor/ggml/src/ggml-cann/aclnn_ops.cpp +4436 -0
- data/vendor/ggml/src/ggml-cann/aclnn_ops.h +1190 -0
- data/vendor/ggml/src/ggml-cann/common.h +651 -0
- data/vendor/ggml/src/ggml-cann/ggml-cann.cpp +3062 -0
- data/vendor/ggml/src/ggml-common.h +1900 -0
- data/vendor/ggml/src/ggml-cpu/CMakeLists.txt +731 -0
- data/vendor/ggml/src/ggml-cpu/amx/amx.cpp +249 -0
- data/vendor/ggml/src/ggml-cpu/amx/amx.h +8 -0
- data/vendor/ggml/src/ggml-cpu/amx/common.h +115 -0
- data/vendor/ggml/src/ggml-cpu/amx/mmq.cpp +2512 -0
- data/vendor/ggml/src/ggml-cpu/amx/mmq.h +10 -0
- data/vendor/ggml/src/ggml-cpu/arch/arm/cpu-feats.cpp +98 -0
- data/vendor/ggml/src/ggml-cpu/arch/arm/quants.c +4245 -0
- data/vendor/ggml/src/ggml-cpu/arch/arm/repack.cpp +5156 -0
- data/vendor/ggml/src/ggml-cpu/arch/loongarch/quants.c +2158 -0
- data/vendor/ggml/src/ggml-cpu/arch/powerpc/cpu-feats.cpp +82 -0
- data/vendor/ggml/src/ggml-cpu/arch/powerpc/quants.c +2304 -0
- data/vendor/ggml/src/ggml-cpu/arch/riscv/cpu-feats.cpp +38 -0
- data/vendor/ggml/src/ggml-cpu/arch/riscv/quants.c +4553 -0
- data/vendor/ggml/src/ggml-cpu/arch/riscv/repack.cpp +1703 -0
- data/vendor/ggml/src/ggml-cpu/arch/s390/cpu-feats.cpp +50 -0
- data/vendor/ggml/src/ggml-cpu/arch/s390/quants.c +1465 -0
- data/vendor/ggml/src/ggml-cpu/arch/wasm/quants.c +1220 -0
- data/vendor/ggml/src/ggml-cpu/arch/x86/cpu-feats.cpp +327 -0
- data/vendor/ggml/src/ggml-cpu/arch/x86/quants.c +3970 -0
- data/vendor/ggml/src/ggml-cpu/arch/x86/repack.cpp +6407 -0
- data/vendor/ggml/src/ggml-cpu/arch-fallback.h +348 -0
- data/vendor/ggml/src/ggml-cpu/binary-ops.cpp +154 -0
- data/vendor/ggml/src/ggml-cpu/binary-ops.h +16 -0
- data/vendor/ggml/src/ggml-cpu/cmake/FindSIMD.cmake +100 -0
- data/vendor/ggml/src/ggml-cpu/cmake/FindSMTIME.cmake +32 -0
- data/vendor/ggml/src/ggml-cpu/common.h +95 -0
- data/vendor/ggml/src/ggml-cpu/ggml-cpu-impl.h +539 -0
- data/vendor/ggml/src/ggml-cpu/ggml-cpu.c +3835 -0
- data/vendor/ggml/src/ggml-cpu/ggml-cpu.cpp +703 -0
- data/vendor/ggml/src/ggml-cpu/hbm.cpp +55 -0
- data/vendor/ggml/src/ggml-cpu/hbm.h +8 -0
- data/vendor/ggml/src/ggml-cpu/kleidiai/kernels.cpp +939 -0
- data/vendor/ggml/src/ggml-cpu/kleidiai/kernels.h +90 -0
- data/vendor/ggml/src/ggml-cpu/kleidiai/kleidiai.cpp +1513 -0
- data/vendor/ggml/src/ggml-cpu/kleidiai/kleidiai.h +17 -0
- data/vendor/ggml/src/ggml-cpu/llamafile/sgemm.cpp +4051 -0
- data/vendor/ggml/src/ggml-cpu/llamafile/sgemm.h +25 -0
- data/vendor/ggml/src/ggml-cpu/ops.cpp +11373 -0
- data/vendor/ggml/src/ggml-cpu/ops.h +119 -0
- data/vendor/ggml/src/ggml-cpu/quants.c +1288 -0
- data/vendor/ggml/src/ggml-cpu/quants.h +103 -0
- data/vendor/ggml/src/ggml-cpu/repack.cpp +4836 -0
- data/vendor/ggml/src/ggml-cpu/repack.h +245 -0
- data/vendor/ggml/src/ggml-cpu/simd-gemm.h +226 -0
- data/vendor/ggml/src/ggml-cpu/simd-mappings.h +1319 -0
- data/vendor/ggml/src/ggml-cpu/spacemit/ime.cpp +1740 -0
- data/vendor/ggml/src/ggml-cpu/spacemit/ime.h +21 -0
- data/vendor/ggml/src/ggml-cpu/spacemit/ime1_kernels.cpp +1027 -0
- data/vendor/ggml/src/ggml-cpu/spacemit/ime2_kernels.cpp +5768 -0
- data/vendor/ggml/src/ggml-cpu/spacemit/ime_env.cpp +320 -0
- data/vendor/ggml/src/ggml-cpu/spacemit/ime_env.h +55 -0
- data/vendor/ggml/src/ggml-cpu/spacemit/ime_kernels.h +189 -0
- data/vendor/ggml/src/ggml-cpu/spacemit/repack.cpp +1795 -0
- data/vendor/ggml/src/ggml-cpu/spacemit/repack.h +14 -0
- data/vendor/ggml/src/ggml-cpu/spacemit/rvv_kernels.cpp +3178 -0
- data/vendor/ggml/src/ggml-cpu/spacemit/rvv_kernels.h +95 -0
- data/vendor/ggml/src/ggml-cpu/spacemit/spine_barrier.h +34 -0
- data/vendor/ggml/src/ggml-cpu/spacemit/spine_mem_pool.cpp +760 -0
- data/vendor/ggml/src/ggml-cpu/spacemit/spine_mem_pool.h +32 -0
- data/vendor/ggml/src/ggml-cpu/spacemit/spine_tcm.h +409 -0
- data/vendor/ggml/src/ggml-cpu/traits.cpp +36 -0
- data/vendor/ggml/src/ggml-cpu/traits.h +38 -0
- data/vendor/ggml/src/ggml-cpu/unary-ops.cpp +337 -0
- data/vendor/ggml/src/ggml-cpu/unary-ops.h +35 -0
- data/vendor/ggml/src/ggml-cpu/vec.cpp +629 -0
- data/vendor/ggml/src/ggml-cpu/vec.h +1588 -0
- data/vendor/ggml/src/ggml-cuda/CMakeLists.txt +268 -0
- data/vendor/ggml/src/ggml-cuda/acc.cu +61 -0
- data/vendor/ggml/src/ggml-cuda/acc.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/add-id.cu +58 -0
- data/vendor/ggml/src/ggml-cuda/add-id.cuh +3 -0
- data/vendor/ggml/src/ggml-cuda/allreduce.cu +971 -0
- data/vendor/ggml/src/ggml-cuda/allreduce.cuh +29 -0
- data/vendor/ggml/src/ggml-cuda/arange.cu +34 -0
- data/vendor/ggml/src/ggml-cuda/arange.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/argmax.cu +91 -0
- data/vendor/ggml/src/ggml-cuda/argmax.cuh +3 -0
- data/vendor/ggml/src/ggml-cuda/argsort.cu +266 -0
- data/vendor/ggml/src/ggml-cuda/argsort.cuh +19 -0
- data/vendor/ggml/src/ggml-cuda/binbcast.cu +534 -0
- data/vendor/ggml/src/ggml-cuda/binbcast.cuh +12 -0
- data/vendor/ggml/src/ggml-cuda/clamp.cu +45 -0
- data/vendor/ggml/src/ggml-cuda/clamp.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/common.cuh +1489 -0
- data/vendor/ggml/src/ggml-cuda/concat.cu +204 -0
- data/vendor/ggml/src/ggml-cuda/concat.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/conv-transpose-1d.cu +86 -0
- data/vendor/ggml/src/ggml-cuda/conv-transpose-1d.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/conv2d-dw.cu +161 -0
- data/vendor/ggml/src/ggml-cuda/conv2d-dw.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/conv2d-transpose.cu +115 -0
- data/vendor/ggml/src/ggml-cuda/conv2d-transpose.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/conv2d.cu +166 -0
- data/vendor/ggml/src/ggml-cuda/conv2d.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/convert.cu +892 -0
- data/vendor/ggml/src/ggml-cuda/convert.cuh +66 -0
- data/vendor/ggml/src/ggml-cuda/count-equal.cu +64 -0
- data/vendor/ggml/src/ggml-cuda/count-equal.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/cp-async.cuh +57 -0
- data/vendor/ggml/src/ggml-cuda/cpy-utils.cuh +217 -0
- data/vendor/ggml/src/ggml-cuda/cpy.cu +558 -0
- data/vendor/ggml/src/ggml-cuda/cpy.cuh +7 -0
- data/vendor/ggml/src/ggml-cuda/cross-entropy-loss.cu +177 -0
- data/vendor/ggml/src/ggml-cuda/cross-entropy-loss.cuh +7 -0
- data/vendor/ggml/src/ggml-cuda/cumsum.cu +307 -0
- data/vendor/ggml/src/ggml-cuda/cumsum.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/dequantize.cuh +99 -0
- data/vendor/ggml/src/ggml-cuda/diag.cu +77 -0
- data/vendor/ggml/src/ggml-cuda/diag.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/diagmask.cu +40 -0
- data/vendor/ggml/src/ggml-cuda/diagmask.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/fattn-common.cuh +1212 -0
- data/vendor/ggml/src/ggml-cuda/fattn-mma-f16.cuh +2020 -0
- data/vendor/ggml/src/ggml-cuda/fattn-tile.cu +61 -0
- data/vendor/ggml/src/ggml-cuda/fattn-tile.cuh +1347 -0
- data/vendor/ggml/src/ggml-cuda/fattn-vec.cuh +600 -0
- data/vendor/ggml/src/ggml-cuda/fattn-wmma-f16.cu +696 -0
- data/vendor/ggml/src/ggml-cuda/fattn-wmma-f16.cuh +51 -0
- data/vendor/ggml/src/ggml-cuda/fattn.cu +562 -0
- data/vendor/ggml/src/ggml-cuda/fattn.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/fill.cu +37 -0
- data/vendor/ggml/src/ggml-cuda/fill.cuh +3 -0
- data/vendor/ggml/src/ggml-cuda/gated_delta_net.cu +311 -0
- data/vendor/ggml/src/ggml-cuda/gated_delta_net.cuh +4 -0
- data/vendor/ggml/src/ggml-cuda/getrows.cu +300 -0
- data/vendor/ggml/src/ggml-cuda/getrows.cuh +15 -0
- data/vendor/ggml/src/ggml-cuda/ggml-cuda.cu +5684 -0
- data/vendor/ggml/src/ggml-cuda/gla.cu +93 -0
- data/vendor/ggml/src/ggml-cuda/gla.cuh +3 -0
- data/vendor/ggml/src/ggml-cuda/im2col.cu +267 -0
- data/vendor/ggml/src/ggml-cuda/im2col.cuh +6 -0
- data/vendor/ggml/src/ggml-cuda/mean.cu +75 -0
- data/vendor/ggml/src/ggml-cuda/mean.cuh +3 -0
- data/vendor/ggml/src/ggml-cuda/mma.cuh +1456 -0
- data/vendor/ggml/src/ggml-cuda/mmf.cu +191 -0
- data/vendor/ggml/src/ggml-cuda/mmf.cuh +908 -0
- data/vendor/ggml/src/ggml-cuda/mmid.cu +164 -0
- data/vendor/ggml/src/ggml-cuda/mmid.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/mmq.cu +372 -0
- data/vendor/ggml/src/ggml-cuda/mmq.cuh +4176 -0
- data/vendor/ggml/src/ggml-cuda/mmvf.cu +862 -0
- data/vendor/ggml/src/ggml-cuda/mmvf.cuh +14 -0
- data/vendor/ggml/src/ggml-cuda/mmvq.cu +1161 -0
- data/vendor/ggml/src/ggml-cuda/mmvq.cuh +16 -0
- data/vendor/ggml/src/ggml-cuda/norm.cu +672 -0
- data/vendor/ggml/src/ggml-cuda/norm.cuh +18 -0
- data/vendor/ggml/src/ggml-cuda/opt-step-adamw.cu +78 -0
- data/vendor/ggml/src/ggml-cuda/opt-step-adamw.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/opt-step-sgd.cu +49 -0
- data/vendor/ggml/src/ggml-cuda/opt-step-sgd.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/out-prod.cu +84 -0
- data/vendor/ggml/src/ggml-cuda/out-prod.cuh +3 -0
- data/vendor/ggml/src/ggml-cuda/pad.cu +106 -0
- data/vendor/ggml/src/ggml-cuda/pad.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/pad_reflect_1d.cu +91 -0
- data/vendor/ggml/src/ggml-cuda/pad_reflect_1d.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/pool2d.cu +94 -0
- data/vendor/ggml/src/ggml-cuda/pool2d.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/quantize.cu +443 -0
- data/vendor/ggml/src/ggml-cuda/quantize.cuh +41 -0
- data/vendor/ggml/src/ggml-cuda/reduce_rows.cuh +39 -0
- data/vendor/ggml/src/ggml-cuda/roll.cu +67 -0
- data/vendor/ggml/src/ggml-cuda/roll.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/rope.cu +665 -0
- data/vendor/ggml/src/ggml-cuda/rope.cuh +9 -0
- data/vendor/ggml/src/ggml-cuda/scale.cu +34 -0
- data/vendor/ggml/src/ggml-cuda/scale.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/set-rows.cu +330 -0
- data/vendor/ggml/src/ggml-cuda/set-rows.cuh +7 -0
- data/vendor/ggml/src/ggml-cuda/set.cu +39 -0
- data/vendor/ggml/src/ggml-cuda/set.cuh +7 -0
- data/vendor/ggml/src/ggml-cuda/snake.cu +72 -0
- data/vendor/ggml/src/ggml-cuda/snake.cuh +8 -0
- data/vendor/ggml/src/ggml-cuda/softcap.cu +34 -0
- data/vendor/ggml/src/ggml-cuda/softcap.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/softmax.cu +472 -0
- data/vendor/ggml/src/ggml-cuda/softmax.cuh +7 -0
- data/vendor/ggml/src/ggml-cuda/solve_tri.cu +275 -0
- data/vendor/ggml/src/ggml-cuda/solve_tri.cuh +3 -0
- data/vendor/ggml/src/ggml-cuda/ssm-conv.cu +197 -0
- data/vendor/ggml/src/ggml-cuda/ssm-conv.cuh +3 -0
- data/vendor/ggml/src/ggml-cuda/ssm-scan.cu +342 -0
- data/vendor/ggml/src/ggml-cuda/ssm-scan.cuh +3 -0
- data/vendor/ggml/src/ggml-cuda/sum.cu +41 -0
- data/vendor/ggml/src/ggml-cuda/sum.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/sumrows.cu +43 -0
- data/vendor/ggml/src/ggml-cuda/sumrows.cuh +4 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_1-ncols2_16.cu +6 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_1-ncols2_32.cu +6 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_1-ncols2_8.cu +12 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_16-ncols2_1.cu +10 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_16-ncols2_2.cu +10 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_16-ncols2_4.cu +12 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_16.cu +6 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_32.cu +6 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_4.cu +12 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_8.cu +12 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_32-ncols2_1.cu +10 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_32-ncols2_2.cu +10 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_16.cu +6 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_2.cu +10 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_4.cu +12 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_8.cu +12 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_64-ncols2_1.cu +10 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_1.cu +10 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_2.cu +10 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_4.cu +12 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_8.cu +12 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq112-dv112.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq128-dv128.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq192-dv128.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq256-dv256.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq320-dv256.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq40-dv40.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq512-dv512.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq576-dv512.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq64-dv64.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq72-dv72.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq80-dv80.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-tile-instance-dkq96-dv96.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-bf16-bf16.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-bf16-f16.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-bf16-q4_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-bf16-q4_1.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-bf16-q5_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-bf16-q5_1.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-bf16-q8_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-f16-bf16.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-f16-f16.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-f16-q4_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-f16-q4_1.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-f16-q5_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-f16-q5_1.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-f16-q8_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_0-bf16.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_0-f16.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_0-q4_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_0-q4_1.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_0-q5_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_0-q5_1.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_0-q8_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_1-bf16.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_1-f16.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_1-q4_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_1-q4_1.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_1-q5_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_1-q5_1.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q4_1-q8_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_0-bf16.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_0-f16.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_0-q4_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_0-q4_1.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_0-q5_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_0-q5_1.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_0-q8_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_1-bf16.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_1-f16.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_1-q4_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_1-q4_1.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_1-q5_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_1-q5_1.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q5_1-q8_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q8_0-bf16.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q8_0-f16.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q8_0-q4_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q8_0-q4_1.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q8_0-q5_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q8_0-q5_1.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/fattn-vec-instance-q8_0-q8_0.cu +7 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/generate_cu_files.py +110 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_1.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_10.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_11.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_12.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_13.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_14.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_15.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_16.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_2.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_3.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_4.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_5.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_6.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_7.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_8.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmf-instance-ncols_9.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq1_s.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq2_s.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq2_xs.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq2_xxs.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq3_s.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq3_xxs.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq4_nl.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-iq4_xs.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-mxfp4.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-nvfp4.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q1_0.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q2_k.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q3_k.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q4_0.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q4_1.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q4_k.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q5_0.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q5_1.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q5_k.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q6_k.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/template-instances/mmq-instance-q8_0.cu +5 -0
- data/vendor/ggml/src/ggml-cuda/top-k.cu +95 -0
- data/vendor/ggml/src/ggml-cuda/top-k.cuh +3 -0
- data/vendor/ggml/src/ggml-cuda/topk-moe.cu +415 -0
- data/vendor/ggml/src/ggml-cuda/topk-moe.cuh +27 -0
- data/vendor/ggml/src/ggml-cuda/tri.cu +136 -0
- data/vendor/ggml/src/ggml-cuda/tri.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/tsembd.cu +47 -0
- data/vendor/ggml/src/ggml-cuda/tsembd.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/unary.cu +640 -0
- data/vendor/ggml/src/ggml-cuda/unary.cuh +114 -0
- data/vendor/ggml/src/ggml-cuda/upscale.cu +293 -0
- data/vendor/ggml/src/ggml-cuda/upscale.cuh +5 -0
- data/vendor/ggml/src/ggml-cuda/vecdotq.cuh +1317 -0
- data/vendor/ggml/src/ggml-cuda/vendors/cuda.h +28 -0
- data/vendor/ggml/src/ggml-cuda/vendors/hip.h +304 -0
- data/vendor/ggml/src/ggml-cuda/vendors/musa.h +150 -0
- data/vendor/ggml/src/ggml-cuda/wkv.cu +199 -0
- data/vendor/ggml/src/ggml-cuda/wkv.cuh +7 -0
- data/vendor/ggml/src/ggml-hexagon/CMakeLists.txt +118 -0
- data/vendor/ggml/src/ggml-hexagon/ggml-hexagon.cpp +3680 -0
- data/vendor/ggml/src/ggml-hexagon/htp/CMakeLists.txt +78 -0
- data/vendor/ggml/src/ggml-hexagon/htp/act-ops.c +782 -0
- data/vendor/ggml/src/ggml-hexagon/htp/argsort-ops.c +293 -0
- data/vendor/ggml/src/ggml-hexagon/htp/binary-ops.c +872 -0
- data/vendor/ggml/src/ggml-hexagon/htp/cmake-toolchain.cmake +157 -0
- data/vendor/ggml/src/ggml-hexagon/htp/cpy-ops.c +275 -0
- data/vendor/ggml/src/ggml-hexagon/htp/cumsum-ops.c +270 -0
- data/vendor/ggml/src/ggml-hexagon/htp/diag-ops.c +216 -0
- data/vendor/ggml/src/ggml-hexagon/htp/fill-ops.c +123 -0
- data/vendor/ggml/src/ggml-hexagon/htp/flash-attn-ops.c +727 -0
- data/vendor/ggml/src/ggml-hexagon/htp/gated-delta-net-ops.c +955 -0
- data/vendor/ggml/src/ggml-hexagon/htp/get-rows-ops.c +124 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hex-dma.c +63 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hex-dma.h +372 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hex-dump.h +86 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hex-fastdiv.h +37 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hex-utils.h +137 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hmx-flash-attn-ops.c +1841 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hmx-matmul-ops.c +1785 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hmx-ops.h +71 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hmx-profile.h +34 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hmx-queue.c +158 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hmx-queue.h +134 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hmx-utils.h +200 -0
- data/vendor/ggml/src/ggml-hexagon/htp/htp-ctx.h +111 -0
- data/vendor/ggml/src/ggml-hexagon/htp/htp-ops.h +181 -0
- data/vendor/ggml/src/ggml-hexagon/htp/htp_iface.idl +22 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hvx-arith.h +443 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hvx-base.h +308 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hvx-copy.h +262 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hvx-div.h +291 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hvx-dump.h +129 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hvx-exp.h +216 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hvx-floor.h +100 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hvx-inverse.h +210 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hvx-reduce.h +296 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hvx-repl.h +74 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hvx-scale.h +133 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hvx-sigmoid.h +142 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hvx-sqrt.h +126 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hvx-types.h +36 -0
- data/vendor/ggml/src/ggml-hexagon/htp/hvx-utils.h +19 -0
- data/vendor/ggml/src/ggml-hexagon/htp/main.c +880 -0
- data/vendor/ggml/src/ggml-hexagon/htp/matmul-ops.c +3173 -0
- data/vendor/ggml/src/ggml-hexagon/htp/repeat-ops.c +148 -0
- data/vendor/ggml/src/ggml-hexagon/htp/rope-ops.c +494 -0
- data/vendor/ggml/src/ggml-hexagon/htp/set-rows-ops.c +184 -0
- data/vendor/ggml/src/ggml-hexagon/htp/softmax-ops.c +407 -0
- data/vendor/ggml/src/ggml-hexagon/htp/solve-tri-ops.c +267 -0
- data/vendor/ggml/src/ggml-hexagon/htp/ssm-conv.c +340 -0
- data/vendor/ggml/src/ggml-hexagon/htp/sum-rows-ops.c +128 -0
- data/vendor/ggml/src/ggml-hexagon/htp/unary-ops.c +657 -0
- data/vendor/ggml/src/ggml-hexagon/htp/vtcm-utils.h +16 -0
- data/vendor/ggml/src/ggml-hexagon/htp/worker-pool.c +293 -0
- data/vendor/ggml/src/ggml-hexagon/htp/worker-pool.h +57 -0
- data/vendor/ggml/src/ggml-hexagon/htp-drv.cpp +418 -0
- data/vendor/ggml/src/ggml-hexagon/htp-drv.h +121 -0
- data/vendor/ggml/src/ggml-hexagon/libdl.h +79 -0
- data/vendor/ggml/src/ggml-hexagon/libggml-htp.inf +40 -0
- data/vendor/ggml/src/ggml-hexagon/op-desc.h +153 -0
- data/vendor/ggml/src/ggml-hip/CMakeLists.txt +157 -0
- data/vendor/ggml/src/ggml-impl.h +783 -0
- data/vendor/ggml/src/ggml-metal/CMakeLists.txt +124 -0
- data/vendor/ggml/src/ggml-metal/ggml-metal-common.cpp +457 -0
- data/vendor/ggml/src/ggml-metal/ggml-metal-common.h +52 -0
- data/vendor/ggml/src/ggml-metal/ggml-metal-context.h +41 -0
- data/vendor/ggml/src/ggml-metal/ggml-metal-context.m +739 -0
- data/vendor/ggml/src/ggml-metal/ggml-metal-device.cpp +2053 -0
- data/vendor/ggml/src/ggml-metal/ggml-metal-device.h +296 -0
- data/vendor/ggml/src/ggml-metal/ggml-metal-device.m +1829 -0
- data/vendor/ggml/src/ggml-metal/ggml-metal-impl.h +1175 -0
- data/vendor/ggml/src/ggml-metal/ggml-metal-ops.cpp +4606 -0
- data/vendor/ggml/src/ggml-metal/ggml-metal-ops.h +97 -0
- data/vendor/ggml/src/ggml-metal/ggml-metal.cpp +950 -0
- data/vendor/ggml/src/ggml-metal/ggml-metal.metal +10679 -0
- data/vendor/ggml/src/ggml-musa/CMakeLists.txt +124 -0
- data/vendor/ggml/src/ggml-musa/mudnn.cu +112 -0
- data/vendor/ggml/src/ggml-musa/mudnn.cuh +12 -0
- data/vendor/ggml/src/ggml-opencl/CMakeLists.txt +189 -0
- data/vendor/ggml/src/ggml-opencl/ggml-opencl.cpp +16374 -0
- data/vendor/ggml/src/ggml-opencl/kernels/add.cl +190 -0
- data/vendor/ggml/src/ggml-opencl/kernels/add_id.cl +42 -0
- data/vendor/ggml/src/ggml-opencl/kernels/argsort.cl +86 -0
- data/vendor/ggml/src/ggml-opencl/kernels/clamp.cl +20 -0
- data/vendor/ggml/src/ggml-opencl/kernels/concat.cl +51 -0
- data/vendor/ggml/src/ggml-opencl/kernels/conv2d.cl +185 -0
- data/vendor/ggml/src/ggml-opencl/kernels/conv2d_f16_f32.cl +176 -0
- data/vendor/ggml/src/ggml-opencl/kernels/cpy.cl +229 -0
- data/vendor/ggml/src/ggml-opencl/kernels/cumsum.cl +139 -0
- data/vendor/ggml/src/ggml-opencl/kernels/cvt.cl +1471 -0
- data/vendor/ggml/src/ggml-opencl/kernels/diag.cl +27 -0
- data/vendor/ggml/src/ggml-opencl/kernels/diag_mask_inf.cl +58 -0
- data/vendor/ggml/src/ggml-opencl/kernels/div.cl +138 -0
- data/vendor/ggml/src/ggml-opencl/kernels/embed_kernel.py +26 -0
- data/vendor/ggml/src/ggml-opencl/kernels/exp.cl +125 -0
- data/vendor/ggml/src/ggml-opencl/kernels/expm1.cl +113 -0
- data/vendor/ggml/src/ggml-opencl/kernels/fill.cl +17 -0
- data/vendor/ggml/src/ggml-opencl/kernels/flash_attn_f16.cl +370 -0
- data/vendor/ggml/src/ggml-opencl/kernels/flash_attn_f32.cl +371 -0
- data/vendor/ggml/src/ggml-opencl/kernels/flash_attn_f32_f16.cl +373 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gelu.cl +89 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemm_moe_mxfp4_f32.cl +162 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemm_moe_mxfp4_f32_ns.cl +302 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemm_moe_q4_0_f32_ns.cl +252 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemm_moe_q4_1_f32_ns.cl +254 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemm_moe_q5_0_f32_ns.cl +256 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemm_moe_q5_1_f32_ns.cl +258 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemm_noshuffle_iq4_nl_f32.cl +150 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemm_noshuffle_q4_0_f32.cl +139 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemm_noshuffle_q4_1_f32.cl +132 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemm_noshuffle_q4_k_f32.cl +172 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemm_noshuffle_q5_k_f32.cl +176 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemm_noshuffle_q6_k_f32.cl +140 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemm_noshuffle_q8_0_f32.cl +129 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemm_xmem_f16_f32_os8.cl +233 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemv_moe_mxfp4_f32.cl +156 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemv_moe_mxfp4_f32_ns.cl +161 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemv_moe_q4_0_f32_ns.cl +116 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemv_moe_q4_1_f32_ns.cl +119 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemv_moe_q5_0_f32_ns.cl +119 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemv_moe_q5_1_f32_ns.cl +121 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_iq4_nl_f32.cl +302 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_q4_0_f32.cl +274 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_q4_0_f32_spec.cl +268 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_q4_1_f32.cl +283 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_q4_k_f32.cl +318 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_q5_k_f32.cl +326 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_q6_k_f32.cl +293 -0
- data/vendor/ggml/src/ggml-opencl/kernels/gemv_noshuffle_q8_0_f32.cl +195 -0
- data/vendor/ggml/src/ggml-opencl/kernels/get_rows.cl +187 -0
- data/vendor/ggml/src/ggml-opencl/kernels/glu.cl +378 -0
- data/vendor/ggml/src/ggml-opencl/kernels/group_norm.cl +121 -0
- data/vendor/ggml/src/ggml-opencl/kernels/im2col_f16.cl +57 -0
- data/vendor/ggml/src/ggml-opencl/kernels/im2col_f32.cl +57 -0
- data/vendor/ggml/src/ggml-opencl/kernels/l2_norm.cl +71 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mean.cl +140 -0
- data/vendor/ggml/src/ggml-opencl/kernels/moe_reorder_b.cl +30 -0
- data/vendor/ggml/src/ggml-opencl/kernels/moe_sort_by_expert.cl +82 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul.cl +152 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mat_f16_f32.cl +130 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_f16_f32_kq_kqv.cl +273 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_f16_f32_l4_lm.cl +146 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_f32_f32_l4_lm.cl +147 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_iq4_nl_f32_l4_lm.cl +171 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_q4_0_f32_l4_lm.cl +163 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_q4_1_f32_l4_lm.cl +165 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_q4_k_f32_l4_lm.cl +179 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_q5_k_f32_l4_lm.cl +192 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_q6_k_f32_l4_lm.cl +158 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mm_q8_0_f32_l4_lm.cl +154 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_f16_f16.cl +118 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_f16_f32.cl +118 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_f16_f32_1row.cl +94 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_f16_f32_l4.cl +84 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_f32_f32.cl +118 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_id_mxfp4_f32.cl +189 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_id_mxfp4_f32_flat.cl +176 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_id_q4_0_f32_8x_flat.cl +283 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_id_q8_0_f32.cl +140 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_id_q8_0_f32_flat.cl +222 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_iq4_nl_f32.cl +164 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_iq4_nl_f32_flat.cl +202 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_mxfp4_f32.cl +144 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_mxfp4_f32_flat.cl +167 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32.cl +192 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_1d_16x_flat.cl +307 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_1d_8x_flat.cl +265 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_8x_flat.cl +272 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_v.cl +254 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_1_f32.cl +219 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_1_f32_flat.cl +229 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_k_f32.cl +180 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q4_k_f32_flat.cl +196 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q5_k_f32.cl +187 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q5_k_f32_flat.cl +203 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q6_k_f32.cl +194 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q6_k_f32_flat.cl +194 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q8_0_f32.cl +125 -0
- data/vendor/ggml/src/ggml-opencl/kernels/mul_mv_q8_0_f32_flat.cl +202 -0
- data/vendor/ggml/src/ggml-opencl/kernels/neg.cl +125 -0
- data/vendor/ggml/src/ggml-opencl/kernels/norm.cl +161 -0
- data/vendor/ggml/src/ggml-opencl/kernels/pad.cl +39 -0
- data/vendor/ggml/src/ggml-opencl/kernels/relu.cl +16 -0
- data/vendor/ggml/src/ggml-opencl/kernels/repeat.cl +38 -0
- data/vendor/ggml/src/ggml-opencl/kernels/rms_norm.cl +190 -0
- data/vendor/ggml/src/ggml-opencl/kernels/rope.cl +747 -0
- data/vendor/ggml/src/ggml-opencl/kernels/scale.cl +27 -0
- data/vendor/ggml/src/ggml-opencl/kernels/set_rows.cl +208 -0
- data/vendor/ggml/src/ggml-opencl/kernels/sigmoid.cl +29 -0
- data/vendor/ggml/src/ggml-opencl/kernels/silu.cl +30 -0
- data/vendor/ggml/src/ggml-opencl/kernels/softmax_4_f16.cl +108 -0
- data/vendor/ggml/src/ggml-opencl/kernels/softmax_4_f32.cl +108 -0
- data/vendor/ggml/src/ggml-opencl/kernels/softmax_f16.cl +107 -0
- data/vendor/ggml/src/ggml-opencl/kernels/softmax_f32.cl +107 -0
- data/vendor/ggml/src/ggml-opencl/kernels/softplus.cl +116 -0
- data/vendor/ggml/src/ggml-opencl/kernels/solve_tri.cl +51 -0
- data/vendor/ggml/src/ggml-opencl/kernels/sqr.cl +53 -0
- data/vendor/ggml/src/ggml-opencl/kernels/sqrt.cl +53 -0
- data/vendor/ggml/src/ggml-opencl/kernels/ssm_conv.cl +77 -0
- data/vendor/ggml/src/ggml-opencl/kernels/sub.cl +138 -0
- data/vendor/ggml/src/ggml-opencl/kernels/sum_rows.cl +140 -0
- data/vendor/ggml/src/ggml-opencl/kernels/tanh.cl +109 -0
- data/vendor/ggml/src/ggml-opencl/kernels/transpose.cl +143 -0
- data/vendor/ggml/src/ggml-opencl/kernels/tri.cl +32 -0
- data/vendor/ggml/src/ggml-opencl/kernels/tsembd.cl +48 -0
- data/vendor/ggml/src/ggml-opencl/kernels/upscale.cl +120 -0
- data/vendor/ggml/src/ggml-openvino/CMakeLists.txt +22 -0
- data/vendor/ggml/src/ggml-openvino/ggml-decoder.cpp +985 -0
- data/vendor/ggml/src/ggml-openvino/ggml-decoder.h +294 -0
- data/vendor/ggml/src/ggml-openvino/ggml-openvino-extra.cpp +380 -0
- data/vendor/ggml/src/ggml-openvino/ggml-openvino-extra.h +182 -0
- data/vendor/ggml/src/ggml-openvino/ggml-openvino.cpp +1132 -0
- data/vendor/ggml/src/ggml-openvino/ggml-quants.cpp +956 -0
- data/vendor/ggml/src/ggml-openvino/ggml-quants.h +153 -0
- data/vendor/ggml/src/ggml-openvino/openvino/decoder.h +74 -0
- data/vendor/ggml/src/ggml-openvino/openvino/frontend.cpp +27 -0
- data/vendor/ggml/src/ggml-openvino/openvino/frontend.h +23 -0
- data/vendor/ggml/src/ggml-openvino/openvino/input_model.cpp +17 -0
- data/vendor/ggml/src/ggml-openvino/openvino/input_model.h +29 -0
- data/vendor/ggml/src/ggml-openvino/openvino/node_context.h +112 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/cont.cpp +48 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/cpy.cpp +21 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/flash_attn_ext.cpp +90 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/get_rows.cpp +69 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/glu_geglu.cpp +61 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/glu_swiglu.cpp +62 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/mulmat.cpp +90 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/permute.cpp +102 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/reshape.cpp +83 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/rms_norm.cpp +46 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/rope.cpp +149 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/scale.cpp +41 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/set_rows.cpp +76 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/softmax.cpp +89 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/transpose.cpp +23 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/unary_gelu.cpp +25 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/unary_silu.cpp +27 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op/view.cpp +53 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op_table.cpp +47 -0
- data/vendor/ggml/src/ggml-openvino/openvino/op_table.h +40 -0
- data/vendor/ggml/src/ggml-openvino/openvino/pass/fuse_to_sdpa.cpp +60 -0
- data/vendor/ggml/src/ggml-openvino/openvino/pass/fuse_to_sdpa.h +17 -0
- data/vendor/ggml/src/ggml-openvino/openvino/pass/mark_decompression_convert_constant_folding.h +29 -0
- data/vendor/ggml/src/ggml-openvino/openvino/pass/squeeze_matmul.cpp +58 -0
- data/vendor/ggml/src/ggml-openvino/openvino/pass/squeeze_matmul.h +17 -0
- data/vendor/ggml/src/ggml-openvino/openvino/rt_info/weightless_caching_attributes.hpp +41 -0
- data/vendor/ggml/src/ggml-openvino/openvino/translate_session.cpp +317 -0
- data/vendor/ggml/src/ggml-openvino/openvino/translate_session.h +28 -0
- data/vendor/ggml/src/ggml-openvino/openvino/utils.cpp +257 -0
- data/vendor/ggml/src/ggml-openvino/openvino/utils.h +86 -0
- data/vendor/ggml/src/ggml-openvino/utils.cpp +880 -0
- data/vendor/ggml/src/ggml-openvino/utils.h +143 -0
- data/vendor/ggml/src/ggml-opt.cpp +1094 -0
- data/vendor/ggml/src/ggml-quants.c +5491 -0
- data/vendor/ggml/src/ggml-quants.h +112 -0
- data/vendor/ggml/src/ggml-rpc/CMakeLists.txt +33 -0
- data/vendor/ggml/src/ggml-rpc/ggml-rpc.cpp +1974 -0
- data/vendor/ggml/src/ggml-rpc/transport.cpp +683 -0
- data/vendor/ggml/src/ggml-rpc/transport.h +34 -0
- data/vendor/ggml/src/ggml-sycl/CMakeLists.txt +207 -0
- data/vendor/ggml/src/ggml-sycl/add-id.cpp +81 -0
- data/vendor/ggml/src/ggml-sycl/add-id.hpp +8 -0
- data/vendor/ggml/src/ggml-sycl/backend.hpp +48 -0
- data/vendor/ggml/src/ggml-sycl/binbcast.cpp +346 -0
- data/vendor/ggml/src/ggml-sycl/binbcast.hpp +39 -0
- data/vendor/ggml/src/ggml-sycl/common.cpp +155 -0
- data/vendor/ggml/src/ggml-sycl/common.hpp +1002 -0
- data/vendor/ggml/src/ggml-sycl/concat.cpp +202 -0
- data/vendor/ggml/src/ggml-sycl/concat.hpp +20 -0
- data/vendor/ggml/src/ggml-sycl/conv.cpp +101 -0
- data/vendor/ggml/src/ggml-sycl/conv.hpp +20 -0
- data/vendor/ggml/src/ggml-sycl/convert.cpp +825 -0
- data/vendor/ggml/src/ggml-sycl/convert.hpp +64 -0
- data/vendor/ggml/src/ggml-sycl/count-equal.cpp +79 -0
- data/vendor/ggml/src/ggml-sycl/count-equal.hpp +9 -0
- data/vendor/ggml/src/ggml-sycl/cpy.cpp +602 -0
- data/vendor/ggml/src/ggml-sycl/cpy.hpp +223 -0
- data/vendor/ggml/src/ggml-sycl/cumsum.cpp +148 -0
- data/vendor/ggml/src/ggml-sycl/cumsum.hpp +5 -0
- data/vendor/ggml/src/ggml-sycl/dequantize.hpp +975 -0
- data/vendor/ggml/src/ggml-sycl/diag.cpp +67 -0
- data/vendor/ggml/src/ggml-sycl/diag.hpp +5 -0
- data/vendor/ggml/src/ggml-sycl/dmmv.cpp +1579 -0
- data/vendor/ggml/src/ggml-sycl/dmmv.hpp +27 -0
- data/vendor/ggml/src/ggml-sycl/dpct/helper.hpp +3774 -0
- data/vendor/ggml/src/ggml-sycl/element_wise.cpp +1124 -0
- data/vendor/ggml/src/ggml-sycl/element_wise.hpp +94 -0
- data/vendor/ggml/src/ggml-sycl/fattn-buffers.cpp +56 -0
- data/vendor/ggml/src/ggml-sycl/fattn-buffers.hpp +63 -0
- data/vendor/ggml/src/ggml-sycl/fattn-common.hpp +1181 -0
- data/vendor/ggml/src/ggml-sycl/fattn-tile.cpp +59 -0
- data/vendor/ggml/src/ggml-sycl/fattn-tile.hpp +1246 -0
- data/vendor/ggml/src/ggml-sycl/fattn-vec.hpp +674 -0
- data/vendor/ggml/src/ggml-sycl/fattn.cpp +227 -0
- data/vendor/ggml/src/ggml-sycl/fattn.hpp +22 -0
- data/vendor/ggml/src/ggml-sycl/fill.cpp +55 -0
- data/vendor/ggml/src/ggml-sycl/fill.hpp +5 -0
- data/vendor/ggml/src/ggml-sycl/gated_delta_net.cpp +307 -0
- data/vendor/ggml/src/ggml-sycl/gated_delta_net.hpp +9 -0
- data/vendor/ggml/src/ggml-sycl/gemm.hpp +93 -0
- data/vendor/ggml/src/ggml-sycl/getrows.cpp +219 -0
- data/vendor/ggml/src/ggml-sycl/getrows.hpp +20 -0
- data/vendor/ggml/src/ggml-sycl/ggml-sycl.cpp +5520 -0
- data/vendor/ggml/src/ggml-sycl/gla.cpp +106 -0
- data/vendor/ggml/src/ggml-sycl/gla.hpp +8 -0
- data/vendor/ggml/src/ggml-sycl/im2col.cpp +400 -0
- data/vendor/ggml/src/ggml-sycl/im2col.hpp +23 -0
- data/vendor/ggml/src/ggml-sycl/mmq.cpp +3030 -0
- data/vendor/ggml/src/ggml-sycl/mmq.hpp +33 -0
- data/vendor/ggml/src/ggml-sycl/mmvq.cpp +1380 -0
- data/vendor/ggml/src/ggml-sycl/mmvq.hpp +43 -0
- data/vendor/ggml/src/ggml-sycl/norm.cpp +656 -0
- data/vendor/ggml/src/ggml-sycl/norm.hpp +28 -0
- data/vendor/ggml/src/ggml-sycl/outprod.cpp +47 -0
- data/vendor/ggml/src/ggml-sycl/outprod.hpp +10 -0
- data/vendor/ggml/src/ggml-sycl/pad.cpp +97 -0
- data/vendor/ggml/src/ggml-sycl/pad.hpp +24 -0
- data/vendor/ggml/src/ggml-sycl/pad_reflect_1d.cpp +100 -0
- data/vendor/ggml/src/ggml-sycl/pad_reflect_1d.hpp +10 -0
- data/vendor/ggml/src/ggml-sycl/presets.hpp +79 -0
- data/vendor/ggml/src/ggml-sycl/quantize.hpp +133 -0
- data/vendor/ggml/src/ggml-sycl/quants.hpp +156 -0
- data/vendor/ggml/src/ggml-sycl/repeat_back.cpp +76 -0
- data/vendor/ggml/src/ggml-sycl/repeat_back.hpp +8 -0
- data/vendor/ggml/src/ggml-sycl/roll.cpp +122 -0
- data/vendor/ggml/src/ggml-sycl/roll.hpp +20 -0
- data/vendor/ggml/src/ggml-sycl/rope.cpp +641 -0
- data/vendor/ggml/src/ggml-sycl/rope.hpp +26 -0
- data/vendor/ggml/src/ggml-sycl/set.cpp +73 -0
- data/vendor/ggml/src/ggml-sycl/set.hpp +5 -0
- data/vendor/ggml/src/ggml-sycl/set_rows.cpp +240 -0
- data/vendor/ggml/src/ggml-sycl/set_rows.hpp +8 -0
- data/vendor/ggml/src/ggml-sycl/softmax.cpp +426 -0
- data/vendor/ggml/src/ggml-sycl/softmax.hpp +24 -0
- data/vendor/ggml/src/ggml-sycl/solve_tri.cpp +172 -0
- data/vendor/ggml/src/ggml-sycl/solve_tri.hpp +8 -0
- data/vendor/ggml/src/ggml-sycl/ssm_conv.cpp +132 -0
- data/vendor/ggml/src/ggml-sycl/ssm_conv.hpp +5 -0
- data/vendor/ggml/src/ggml-sycl/ssm_scan.cpp +156 -0
- data/vendor/ggml/src/ggml-sycl/ssm_scan.hpp +5 -0
- data/vendor/ggml/src/ggml-sycl/sycl_hw.cpp +67 -0
- data/vendor/ggml/src/ggml-sycl/sycl_hw.hpp +38 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq112-dv112.cpp +5 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq128-dv128.cpp +5 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq256-dv256.cpp +5 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq40-dv40.cpp +5 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq512-dv512.cpp +6 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq576-dv512.cpp +5 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq64-dv64.cpp +5 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq72-dv72.cpp +5 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq80-dv80.cpp +5 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-tile-instance-dkq96-dv96.cpp +5 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-f16-f16.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-f16-q4_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-f16-q4_1.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-f16-q5_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-f16-q5_1.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-f16-q8_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_0-f16.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_0-q4_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_0-q4_1.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_0-q5_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_0-q5_1.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_0-q8_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_1-f16.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_1-q4_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_1-q4_1.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_1-q5_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_1-q5_1.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q4_1-q8_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_0-f16.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_0-q4_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_0-q4_1.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_0-q5_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_0-q5_1.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_0-q8_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_1-f16.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_1-q4_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_1-q4_1.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_1-q5_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_1-q5_1.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q5_1-q8_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q8_0-f16.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q8_0-q4_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q8_0-q4_1.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q8_0-q5_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q8_0-q5_1.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/template-instances/fattn-vec-instance-q8_0-q8_0.cpp +8 -0
- data/vendor/ggml/src/ggml-sycl/tsembd.cpp +73 -0
- data/vendor/ggml/src/ggml-sycl/tsembd.hpp +20 -0
- data/vendor/ggml/src/ggml-sycl/type.hpp +112 -0
- data/vendor/ggml/src/ggml-sycl/upscale.cpp +410 -0
- data/vendor/ggml/src/ggml-sycl/upscale.hpp +9 -0
- data/vendor/ggml/src/ggml-sycl/vecdotq.hpp +1508 -0
- data/vendor/ggml/src/ggml-sycl/wkv.cpp +293 -0
- data/vendor/ggml/src/ggml-sycl/wkv.hpp +10 -0
- data/vendor/ggml/src/ggml-threading.cpp +12 -0
- data/vendor/ggml/src/ggml-threading.h +14 -0
- data/vendor/ggml/src/ggml-virtgpu/CMakeLists.txt +70 -0
- data/vendor/ggml/src/ggml-virtgpu/apir_cs_ggml-rpc-front.cpp +87 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/CMakeLists.txt +21 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/apir_cs_ggml-rpc-back.cpp +115 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/backend-convert.h +13 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/backend-dispatched-backend.cpp +102 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/backend-dispatched-buffer-type.cpp +105 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/backend-dispatched-buffer.cpp +179 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/backend-dispatched-device.cpp +148 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/backend-dispatched.cpp +51 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/backend-dispatched.gen.h +73 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/backend-dispatched.h +27 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/backend-virgl-apir.h +32 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/backend.cpp +144 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/shared/api_remoting.h +95 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/shared/apir_backend.gen.h +94 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/shared/apir_backend.h +50 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/shared/apir_cs.h +378 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/shared/apir_cs_ggml.h +232 -0
- data/vendor/ggml/src/ggml-virtgpu/backend/shared/apir_cs_rpc.h +58 -0
- data/vendor/ggml/src/ggml-virtgpu/ggml-backend-buffer-type.cpp +81 -0
- data/vendor/ggml/src/ggml-virtgpu/ggml-backend-buffer.cpp +123 -0
- data/vendor/ggml/src/ggml-virtgpu/ggml-backend-device.cpp +160 -0
- data/vendor/ggml/src/ggml-virtgpu/ggml-backend-reg.cpp +213 -0
- data/vendor/ggml/src/ggml-virtgpu/ggml-backend.cpp +71 -0
- data/vendor/ggml/src/ggml-virtgpu/ggml-remoting.h +71 -0
- data/vendor/ggml/src/ggml-virtgpu/ggmlremoting_functions.yaml +166 -0
- data/vendor/ggml/src/ggml-virtgpu/include/apir_hw.h +9 -0
- data/vendor/ggml/src/ggml-virtgpu/regenerate_remoting.py +333 -0
- data/vendor/ggml/src/ggml-virtgpu/virtgpu-apir.h +15 -0
- data/vendor/ggml/src/ggml-virtgpu/virtgpu-forward-backend.cpp +58 -0
- data/vendor/ggml/src/ggml-virtgpu/virtgpu-forward-buffer-type.cpp +110 -0
- data/vendor/ggml/src/ggml-virtgpu/virtgpu-forward-buffer.cpp +173 -0
- data/vendor/ggml/src/ggml-virtgpu/virtgpu-forward-device.cpp +192 -0
- data/vendor/ggml/src/ggml-virtgpu/virtgpu-forward-impl.h +36 -0
- data/vendor/ggml/src/ggml-virtgpu/virtgpu-forward.gen.h +53 -0
- data/vendor/ggml/src/ggml-virtgpu/virtgpu-shm.cpp +99 -0
- data/vendor/ggml/src/ggml-virtgpu/virtgpu-shm.h +23 -0
- data/vendor/ggml/src/ggml-virtgpu/virtgpu-utils.cpp +179 -0
- data/vendor/ggml/src/ggml-virtgpu/virtgpu-utils.h +86 -0
- data/vendor/ggml/src/ggml-virtgpu/virtgpu.cpp +545 -0
- data/vendor/ggml/src/ggml-virtgpu/virtgpu.h +115 -0
- data/vendor/ggml/src/ggml-vulkan/CMakeLists.txt +220 -0
- data/vendor/ggml/src/ggml-vulkan/cmake/host-toolchain.cmake.in +15 -0
- data/vendor/ggml/src/ggml-vulkan/ggml-vulkan.cpp +17208 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/CMakeLists.txt +31 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/abs.comp +21 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/acc.comp +37 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/add.comp +69 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/add1.comp +28 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/add_id.comp +42 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/arange.comp +20 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/argmax.comp +60 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/argsort.comp +86 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/argsort_large.comp +114 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/ceil.comp +22 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/clamp.comp +17 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/concat.comp +41 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/contig_copy.comp +49 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/conv2d_dw.comp +105 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/conv2d_mm.comp +347 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/conv_transpose_1d.comp +98 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/copy.comp +23 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/copy_from_quant.comp +51 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/copy_to_quant.comp +320 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/copy_transpose.comp +67 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/cos.comp +17 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/count_equal.comp +31 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/count_experts.comp +51 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/cumsum.comp +83 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/cumsum_multipass1.comp +60 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/cumsum_multipass2.comp +66 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_f32.comp +20 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_funcs.glsl +653 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_funcs_cm2.glsl +768 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_head.glsl +13 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq1_m.comp +42 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq1_s.comp +35 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq2_s.comp +44 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq2_xs.comp +43 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq2_xxs.comp +49 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq3_s.comp +40 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq3_xxs.comp +51 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq4_nl.comp +32 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq4_xs.comp +34 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_mxfp4.comp +32 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_nvfp4.comp +32 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q1_0.comp +29 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q2_k.comp +34 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q3_k.comp +42 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q4_0.comp +30 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q4_1.comp +32 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q4_k.comp +68 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q5_0.comp +34 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q5_1.comp +35 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q5_k.comp +70 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q6_k.comp +33 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q8_0.comp +31 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/diag.comp +28 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/diag_mask_inf.comp +34 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/div.comp +27 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/elu.comp +27 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/exp.comp +20 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/feature-tests/bfloat16.comp +7 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/feature-tests/coopmat.comp +7 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/feature-tests/coopmat2.comp +7 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/feature-tests/integer_dot.comp +7 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/fill.comp +19 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn.comp +756 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_base.glsl +255 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_cm1.comp +626 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_cm2.comp +427 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_dequant.glsl +123 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_mask_opt.comp +162 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_mmq_funcs.glsl +203 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_split_k_reduce.comp +121 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/floor.comp +22 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/gated_delta_net.comp +190 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/geglu.comp +13 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/geglu_erf.comp +27 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/geglu_quick.comp +11 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/gelu.comp +25 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/gelu_erf.comp +39 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/gelu_quick.comp +23 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/generic_binary_head.glsl +65 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/generic_head.glsl +11 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/generic_unary_head.glsl +83 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/get_rows.comp +42 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/get_rows_quant.comp +51 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/glu_head.glsl +28 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/glu_main.glsl +39 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/group_norm.comp +66 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/hardsigmoid.comp +22 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/hardswish.comp +22 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/im2col.comp +93 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/im2col_3d.comp +124 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/l2_norm.comp +44 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/leaky_relu.comp +22 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/log.comp +17 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul.comp +27 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_split_k_reduce.comp +48 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec.comp +169 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_base.glsl +230 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iface.glsl +35 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq1_m.comp +132 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq1_s.comp +95 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq2_s.comp +90 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq2_xs.comp +105 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq2_xxs.comp +87 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq3_s.comp +90 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq3_xxs.comp +88 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_nc.comp +124 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_p021.comp +156 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q2_k.comp +128 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q3_k.comp +132 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q4_k.comp +134 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q5_k.comp +165 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q6_k.comp +130 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vecq.comp +143 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vecq_funcs.glsl +503 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mm.comp +464 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mm_cm2.comp +624 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mm_funcs.glsl +600 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mm_id_funcs.glsl +74 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mmq.comp +311 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mmq_funcs.glsl +454 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/mul_mmq_shmem_types.glsl +93 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/multi_add.comp +194 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/neg.comp +20 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/norm.comp +44 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/opt_step_adamw.comp +42 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/opt_step_sgd.comp +22 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/pad.comp +64 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/pool2d.comp +74 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/quantize_q8_1.comp +127 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/reglu.comp +9 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/relu.comp +21 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/repeat.comp +26 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/repeat_back.comp +37 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rms_norm.comp +150 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rms_norm_back.comp +55 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rms_norm_partials.comp +65 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/roll.comp +46 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rope_funcs.glsl +207 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rope_head.glsl +19 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rope_multi.comp +17 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rope_neox.comp +17 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rope_norm.comp +17 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rope_params.glsl +31 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/rope_vision.comp +17 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/round.comp +29 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/scale.comp +24 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/sgn.comp +21 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/sigmoid.comp +20 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/silu.comp +22 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/silu_back.comp +26 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/sin.comp +17 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/soft_max.comp +195 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/soft_max_back.comp +54 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/soft_max_large1.comp +62 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/soft_max_large2.comp +79 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/soft_max_large3.comp +65 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/soft_max_large_common.glsl +53 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/softplus.comp +23 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/solve_tri.comp +81 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/sqrt.comp +17 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/square.comp +17 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/ssm_conv.comp +50 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/ssm_scan.comp +124 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/step.comp +22 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/sub.comp +29 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/sum_rows.comp +47 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/sum_rows.glsl +25 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/swiglu.comp +9 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/swiglu_oai.comp +14 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/tanh.comp +20 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/timestep_embedding.comp +42 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/topk_argsort.comp +118 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/topk_moe.comp +213 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/topk_nary_search.comp +246 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/tri.comp +42 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/trunc.comp +22 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/types.glsl +1846 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/upscale.comp +178 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/utils.glsl +25 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp +1183 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/wkv6.comp +87 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/wkv7.comp +91 -0
- data/vendor/ggml/src/ggml-vulkan/vulkan-shaders/xielu.comp +35 -0
- data/vendor/ggml/src/ggml-webgpu/CMakeLists.txt +80 -0
- data/vendor/ggml/src/ggml-webgpu/ggml-webgpu-shader-lib.hpp +3231 -0
- data/vendor/ggml/src/ggml-webgpu/ggml-webgpu.cpp +4461 -0
- data/vendor/ggml/src/ggml-webgpu/pre_wgsl.hpp +778 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/add_id.wgsl +64 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/argmax.wgsl +72 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/argsort.wgsl +106 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/argsort_merge.wgsl +134 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/binary.wgsl +139 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/common_decls.tmpl +905 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/concat.wgsl +75 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/conv2d.wgsl +165 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/cpy.wgsl +81 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/cumsum.wgsl +66 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/embed_wgsl.py +89 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/flash_attn.wgsl +706 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/flash_attn_tile.wgsl +351 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/flash_attn_vec_blk.wgsl +101 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/flash_attn_vec_reduce.wgsl +84 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/flash_attn_vec_split.wgsl +720 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/gated_delta_net.wgsl +132 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/get_rows.wgsl +773 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/glu.wgsl +155 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/im2col.wgsl +101 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/memset.wgsl +40 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat.wgsl +747 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_decls.tmpl +1210 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_id.wgsl +195 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_id_gather.wgsl +55 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_id_vec.wgsl +154 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_reg_tile.wgsl +149 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_subgroup_matrix.wgsl +200 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_vec.wgsl +133 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/mul_mat_vec_acc.tmpl +1433 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/pad.wgsl +86 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/repeat.wgsl +67 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/rms_norm_mul.wgsl +152 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/rope.wgsl +224 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/row_norm.wgsl +153 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/scale.wgsl +63 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/set.wgsl +109 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/set_rows.wgsl +109 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/soft_max.wgsl +245 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/solve_tri.wgsl +121 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/ssm_conv.wgsl +65 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/ssm_scan.wgsl +193 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/sum_rows.wgsl +55 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/unary.wgsl +210 -0
- data/vendor/ggml/src/ggml-webgpu/wgsl-shaders/upscale.wgsl +240 -0
- data/vendor/ggml/src/ggml-zdnn/CMakeLists.txt +36 -0
- data/vendor/ggml/src/ggml-zdnn/common.hpp +59 -0
- data/vendor/ggml/src/ggml-zdnn/ggml-zdnn.cpp +637 -0
- data/vendor/ggml/src/ggml-zdnn/mmf.cpp +80 -0
- data/vendor/ggml/src/ggml-zdnn/mmf.hpp +12 -0
- data/vendor/ggml/src/ggml-zdnn/utils.cpp +79 -0
- data/vendor/ggml/src/ggml-zdnn/utils.hpp +19 -0
- data/vendor/ggml/src/ggml-zendnn/CMakeLists.txt +91 -0
- data/vendor/ggml/src/ggml-zendnn/ggml-zendnn.cpp +669 -0
- data/vendor/ggml/src/ggml.c +7777 -0
- data/vendor/ggml/src/ggml.cpp +26 -0
- data/vendor/ggml/src/gguf.cpp +1556 -0
- data/vendor/ggml/tests/CMakeLists.txt +356 -0
- data/vendor/ggml/tests/test-arange.cpp +100 -0
- data/vendor/ggml/tests/test-backend-ops.cpp +9786 -0
- data/vendor/ggml/tests/test-cont.c +170 -0
- data/vendor/ggml/tests/test-conv-transpose-1d.cpp +691 -0
- data/vendor/ggml/tests/test-conv-transpose.c +248 -0
- data/vendor/ggml/tests/test-conv1d-dw-c1.cpp +243 -0
- data/vendor/ggml/tests/test-conv1d-dw-c2.cpp +243 -0
- data/vendor/ggml/tests/test-conv1d.cpp +289 -0
- data/vendor/ggml/tests/test-conv2d-dw.cpp +153 -0
- data/vendor/ggml/tests/test-conv2d.cpp +391 -0
- data/vendor/ggml/tests/test-customop.c +300 -0
- data/vendor/ggml/tests/test-dup.c +111 -0
- data/vendor/ggml/tests/test-interpolate.cpp +166 -0
- data/vendor/ggml/tests/test-opt.cpp +1003 -0
- data/vendor/ggml/tests/test-pad-reflect-1d.cpp +213 -0
- data/vendor/ggml/tests/test-pool.c +274 -0
- data/vendor/ggml/tests/test-quantize-fns.cpp +196 -0
- data/vendor/ggml/tests/test-quantize-perf.cpp +356 -0
- data/vendor/ggml/tests/test-rel-pos.c +87 -0
- data/vendor/ggml/tests/test-roll.cpp +128 -0
- data/vendor/ggml/tests/test-timestep_embedding.cpp +180 -0
- data/vendor-patches/0001-cuda-buffer_from_ptr.patch +253 -0
- data/vendor-patches/0002-cuda-buffer_from_ptr-reuse-iface.patch +117 -0
- data/vendor-patches/0003-cuda-buffer_from_ptr-copy-mode.patch +128 -0
- data/vendor-patches/0004-cuda-cpy-strided.patch +61 -0
- data/vendor-patches/0005-concat-backward.patch +36 -0
- data/vendor-patches/0006-getrows-back-large-vocab.patch +69 -0
- data/vendor-patches/0007-gpt2-backward-kernels.patch +438 -0
- data/vendor-patches/0008-mul-mat-backward-mixed-precision.patch +50 -0
- data/vendor-patches/0009-sched-unsupported-node-diagnostic.patch +26 -0
- metadata +2161 -0
|
@@ -0,0 +1,1513 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright 2025-2026 Arm Limited and/or its affiliates <open-source-office@arm.com>
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
//
|
|
4
|
+
#include <arm_neon.h>
|
|
5
|
+
#include <assert.h>
|
|
6
|
+
#include <stdio.h>
|
|
7
|
+
#include <atomic>
|
|
8
|
+
#include <cfloat>
|
|
9
|
+
#include <algorithm>
|
|
10
|
+
#include <cmath>
|
|
11
|
+
#include <stdexcept>
|
|
12
|
+
#include <stdint.h>
|
|
13
|
+
#include <string.h>
|
|
14
|
+
#include <string>
|
|
15
|
+
#include <vector>
|
|
16
|
+
#include <array>
|
|
17
|
+
#include <cstddef>
|
|
18
|
+
#include <cstdint>
|
|
19
|
+
#include <fstream>
|
|
20
|
+
#include <set>
|
|
21
|
+
#include <iostream>
|
|
22
|
+
#include <climits>
|
|
23
|
+
#if defined(__linux__)
|
|
24
|
+
#include <asm/hwcap.h>
|
|
25
|
+
#include <sys/auxv.h>
|
|
26
|
+
#include <sys/types.h>
|
|
27
|
+
#include <sys/stat.h>
|
|
28
|
+
#include <unistd.h>
|
|
29
|
+
#elif defined(__APPLE__)
|
|
30
|
+
#include <string_view>
|
|
31
|
+
#include <sys/sysctl.h>
|
|
32
|
+
#include <sys/types.h>
|
|
33
|
+
#elif defined(_WIN32)
|
|
34
|
+
#include <windows.h>
|
|
35
|
+
#include <excpt.h>
|
|
36
|
+
#endif
|
|
37
|
+
|
|
38
|
+
#include "kleidiai.h"
|
|
39
|
+
|
|
40
|
+
#include "ggml-cpu.h"
|
|
41
|
+
#include "ggml-impl.h"
|
|
42
|
+
#include "ggml-backend-impl.h"
|
|
43
|
+
#include "ggml-threading.h"
|
|
44
|
+
#include "traits.h"
|
|
45
|
+
|
|
46
|
+
#include "kernels.h"
|
|
47
|
+
|
|
48
|
+
#include "kai_common.h"
|
|
49
|
+
|
|
50
|
+
#define GGML_COMMON_DECL_CPP
|
|
51
|
+
#include "ggml-common.h"
|
|
52
|
+
|
|
53
|
+
static constexpr int GGML_KLEIDIAI_MAX_KERNEL_SLOTS = 2;
|
|
54
|
+
static constexpr uint32_t GGML_KLEIDIAI_PACK_MAGIC = 0x4b4c4149; // "KLAI"
|
|
55
|
+
static constexpr uint16_t GGML_KLEIDIAI_PACK_VERSION = 1;
|
|
56
|
+
static constexpr size_t GGML_KLEIDIAI_PACK_ALIGN = 64;
|
|
57
|
+
|
|
58
|
+
struct ggml_kleidiai_context {
|
|
59
|
+
cpu_feature features;
|
|
60
|
+
ggml_kleidiai_kernels * kernels_q4;
|
|
61
|
+
ggml_kleidiai_kernels * kernels_q8;
|
|
62
|
+
int sme_thread_cap; // <= 0 means “SME disabled/unknown”;
|
|
63
|
+
int thread_hint; // <= 0 means “no hint”
|
|
64
|
+
} static ctx = { CPU_FEATURE_NONE, nullptr, nullptr, 0, -1 };
|
|
65
|
+
|
|
66
|
+
static const char* cpu_feature_to_string(cpu_feature f) {
|
|
67
|
+
if (f == CPU_FEATURE_NONE) {
|
|
68
|
+
return "NONE";
|
|
69
|
+
} else if ((f & CPU_FEATURE_SME) == CPU_FEATURE_SME) {
|
|
70
|
+
return "SME";
|
|
71
|
+
} else if ((f & CPU_FEATURE_SVE) == CPU_FEATURE_SVE) {
|
|
72
|
+
return "SVE";
|
|
73
|
+
}
|
|
74
|
+
else if ((f & CPU_FEATURE_I8MM) == CPU_FEATURE_I8MM) {
|
|
75
|
+
return "I8MM";
|
|
76
|
+
} else if ((f & CPU_FEATURE_DOTPROD) == CPU_FEATURE_DOTPROD) {
|
|
77
|
+
return "DOTPROD";
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
return "UNKNOWN";
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
static size_t detect_num_smcus() {
|
|
85
|
+
if (!ggml_cpu_has_sme()) {
|
|
86
|
+
return 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
#if defined(__linux__) && defined(__aarch64__)
|
|
90
|
+
// Linux/aarch64: Best-effort count of Streaming Mode Compute Units (SMCUs) via SMIDR_EL1 sysfs.
|
|
91
|
+
size_t num_private = 0;
|
|
92
|
+
std::set<uint32_t> shared_ids;
|
|
93
|
+
|
|
94
|
+
for (size_t cpu = 0;; ++cpu) {
|
|
95
|
+
const std::string path =
|
|
96
|
+
"/sys/devices/system/cpu/cpu" + std::to_string(cpu) +
|
|
97
|
+
"/regs/identification/smidr_el1";
|
|
98
|
+
|
|
99
|
+
std::ifstream file(path);
|
|
100
|
+
if (!file.is_open()) {
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
uint64_t smidr = 0;
|
|
105
|
+
if (!(file >> std::hex >> smidr)) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Arm ARM: SMIDR_EL1
|
|
110
|
+
const uint32_t sh = (uint32_t)((smidr >> 13) & 0x3);
|
|
111
|
+
// Build an "affinity-like" identifier for shared SMCUs.
|
|
112
|
+
// Keep the original packing logic, but isolate it here.
|
|
113
|
+
const uint32_t id = (uint32_t)((smidr & 0xFFFu) | ((smidr >> 20) & 0xFFFFF000u));
|
|
114
|
+
|
|
115
|
+
switch (sh) {
|
|
116
|
+
case 0b10: // private SMCU
|
|
117
|
+
++num_private;
|
|
118
|
+
break;
|
|
119
|
+
case 0b11: // shared SMCU
|
|
120
|
+
shared_ids.emplace(id);
|
|
121
|
+
break;
|
|
122
|
+
case 0b00:
|
|
123
|
+
// Ambiguous / implementation-defined. Be conservative:
|
|
124
|
+
// treat id==0 as private, otherwise as shared.
|
|
125
|
+
if (id == 0) ++num_private;
|
|
126
|
+
else shared_ids.emplace(id);
|
|
127
|
+
break;
|
|
128
|
+
default:
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return num_private + shared_ids.size();
|
|
134
|
+
|
|
135
|
+
#elif defined(__APPLE__) && defined(__aarch64__)
|
|
136
|
+
// table for known M4 variants. Users can override via GGML_KLEIDIAI_SME=<n>.
|
|
137
|
+
char chip_name[256] = {};
|
|
138
|
+
size_t size = sizeof(chip_name);
|
|
139
|
+
|
|
140
|
+
if (sysctlbyname("machdep.cpu.brand_string", chip_name, &size, nullptr, 0) == 0) {
|
|
141
|
+
const std::string brand(chip_name);
|
|
142
|
+
|
|
143
|
+
struct ModelSMCU { const char *match; size_t smcus; };
|
|
144
|
+
static const ModelSMCU table[] = {
|
|
145
|
+
{ "M4 Ultra", 2 },
|
|
146
|
+
{ "M4 Max", 2 },
|
|
147
|
+
{ "M4 Pro", 2 },
|
|
148
|
+
{ "M4", 1 },
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
for (const auto &e : table) {
|
|
152
|
+
if (brand.find(e.match) != std::string::npos) {
|
|
153
|
+
return e.smcus;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return 1;
|
|
158
|
+
|
|
159
|
+
#else
|
|
160
|
+
return 1;
|
|
161
|
+
#endif
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
static int parse_uint_env(const char *s, const char *name, bool *ok) {
|
|
165
|
+
if (!s) { *ok = false; return 0; }
|
|
166
|
+
char *end = nullptr;
|
|
167
|
+
long v = strtol(s, &end, 10);
|
|
168
|
+
if (end == s || *end != '\0') {
|
|
169
|
+
GGML_LOG_WARN("kleidiai: invalid %s='%s' (expected integer)\n", name, s);
|
|
170
|
+
*ok = false;
|
|
171
|
+
return 0;
|
|
172
|
+
}
|
|
173
|
+
if (v < 0 || v > INT_MAX) {
|
|
174
|
+
GGML_LOG_WARN("kleidiai: out-of-range %s='%s'\n", name, s);
|
|
175
|
+
*ok = false;
|
|
176
|
+
return 0;
|
|
177
|
+
}
|
|
178
|
+
*ok = true;
|
|
179
|
+
return (int)v;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
static void init_kleidiai_context(void) {
|
|
183
|
+
ggml_critical_section_start();
|
|
184
|
+
static bool initialized = false;
|
|
185
|
+
|
|
186
|
+
if (!initialized) {
|
|
187
|
+
initialized = true;
|
|
188
|
+
|
|
189
|
+
const char *env_sme = getenv("GGML_KLEIDIAI_SME");
|
|
190
|
+
const char *env_threads = getenv("GGML_TOTAL_THREADS");
|
|
191
|
+
|
|
192
|
+
const bool cpu_has_sme = ggml_cpu_has_sme();
|
|
193
|
+
size_t detected_smcus = 0;
|
|
194
|
+
|
|
195
|
+
ctx.features = (ggml_cpu_has_dotprod() ? CPU_FEATURE_DOTPROD : CPU_FEATURE_NONE) |
|
|
196
|
+
(ggml_cpu_has_matmul_int8() ? CPU_FEATURE_I8MM : CPU_FEATURE_NONE) |
|
|
197
|
+
((ggml_cpu_has_sve() && ggml_cpu_get_sve_cnt() == QK8_0) ? CPU_FEATURE_SVE : CPU_FEATURE_NONE);
|
|
198
|
+
|
|
199
|
+
if (env_threads) {
|
|
200
|
+
bool ok = false;
|
|
201
|
+
int hint = parse_uint_env(env_threads, "GGML_TOTAL_THREADS", &ok);
|
|
202
|
+
if (ok && hint > 0) {
|
|
203
|
+
ctx.thread_hint = hint;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// SME policy:
|
|
208
|
+
// - If CPU doesn't support SME: SME always off.
|
|
209
|
+
// - Else:
|
|
210
|
+
// - env unset => auto-detect cores; enable if detected > 0.
|
|
211
|
+
// - env=0 => force off.
|
|
212
|
+
// - env>0 => force N cores (skip detection).
|
|
213
|
+
int sme_cores = 0;
|
|
214
|
+
bool sme_env_ok = false;
|
|
215
|
+
bool sme_env_set = (env_sme != nullptr);
|
|
216
|
+
|
|
217
|
+
if (!cpu_has_sme) {
|
|
218
|
+
if (sme_env_set) {
|
|
219
|
+
bool ok = false;
|
|
220
|
+
int req = parse_uint_env(env_sme, "GGML_KLEIDIAI_SME", &ok);
|
|
221
|
+
if (ok && req > 0) {
|
|
222
|
+
GGML_LOG_WARN("kleidiai: GGML_KLEIDIAI_SME=%d but SME is not supported on this CPU; disabling SME\n", req);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
sme_cores = 0;
|
|
226
|
+
} else {
|
|
227
|
+
if (sme_env_set) {
|
|
228
|
+
bool ok = false;
|
|
229
|
+
int v = parse_uint_env(env_sme, "GGML_KLEIDIAI_SME", &ok);
|
|
230
|
+
sme_env_ok = ok;
|
|
231
|
+
|
|
232
|
+
if (!ok) {
|
|
233
|
+
GGML_LOG_WARN("kleidiai: GGML_KLEIDIAI_SME set but parsing failed; falling back to runtime SME-core detection\n");
|
|
234
|
+
detected_smcus = detect_num_smcus();
|
|
235
|
+
sme_cores = detected_smcus > 0 ? (int)detected_smcus : 0;
|
|
236
|
+
} else if (v == 0) {
|
|
237
|
+
sme_cores = 0;
|
|
238
|
+
} else {
|
|
239
|
+
sme_cores = v;
|
|
240
|
+
}
|
|
241
|
+
} else {
|
|
242
|
+
detected_smcus = detect_num_smcus();
|
|
243
|
+
sme_cores = detected_smcus > 0 ? (int)detected_smcus : 0;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (!sme_env_set && sme_cores == 0) {
|
|
247
|
+
GGML_LOG_WARN("kleidiai: SME supported but runtime SME-core detection returned 0; falling back to NEON\n");
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (sme_cores > 0) {
|
|
251
|
+
ctx.features |= CPU_FEATURE_SME;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Kernel selection
|
|
256
|
+
ctx.kernels_q4 = ggml_kleidiai_select_kernels_q4_0(ctx.features);
|
|
257
|
+
ctx.kernels_q8 = ggml_kleidiai_select_kernels_q8_0(ctx.features);
|
|
258
|
+
|
|
259
|
+
if (!ctx.kernels_q4) {
|
|
260
|
+
GGML_LOG_INFO("kleidiai: no compatible q4 kernels found for CPU features mask %d\n", (int)ctx.features);
|
|
261
|
+
} else {
|
|
262
|
+
GGML_LOG_INFO("kleidiai: primary q4 kernel feature %s\n", cpu_feature_to_string(ctx.kernels_q4->required_cpu));
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (!ctx.kernels_q8) {
|
|
266
|
+
GGML_LOG_INFO("kleidiai: no compatible q8 kernels found for CPU features mask %d\n", (int)ctx.features);
|
|
267
|
+
} else {
|
|
268
|
+
GGML_LOG_INFO("kleidiai: primary q8 kernel feature %s\n", cpu_feature_to_string(ctx.kernels_q8->required_cpu));
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
ctx.sme_thread_cap = (ctx.features & CPU_FEATURE_SME) ? sme_cores : 0;
|
|
272
|
+
|
|
273
|
+
if (ctx.features & CPU_FEATURE_SME) {
|
|
274
|
+
if (sme_env_set && sme_env_ok && sme_cores > 0) {
|
|
275
|
+
GGML_LOG_INFO("kleidiai: SME enabled (GGML_KLEIDIAI_SME=%d override)\n", sme_cores);
|
|
276
|
+
} else {
|
|
277
|
+
GGML_LOG_INFO("kleidiai: SME enabled (runtime-detected SME cores=%d)\n", sme_cores);
|
|
278
|
+
}
|
|
279
|
+
} else {
|
|
280
|
+
GGML_LOG_INFO("kleidiai: SME disabled\n");
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
ggml_critical_section_end();
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
static inline int kleidiai_sme_thread_cap() {
|
|
288
|
+
return ctx.sme_thread_cap;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
static inline size_t align_up(size_t value, size_t alignment) {
|
|
292
|
+
if (alignment == 0) {
|
|
293
|
+
return value;
|
|
294
|
+
}
|
|
295
|
+
const size_t remainder = value % alignment;
|
|
296
|
+
return remainder == 0 ? value : value + (alignment - remainder);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
static inline bool kleidiai_pack_fallback_allowed() {
|
|
300
|
+
if (ctx.sme_thread_cap <= 0) {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
if (ctx.thread_hint <= 0) {
|
|
304
|
+
return true;
|
|
305
|
+
}
|
|
306
|
+
return ctx.thread_hint > ctx.sme_thread_cap;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
struct kleidiai_weight_header {
|
|
310
|
+
uint32_t magic;
|
|
311
|
+
uint16_t version;
|
|
312
|
+
uint16_t slot_count;
|
|
313
|
+
uint64_t offsets[GGML_KLEIDIAI_MAX_KERNEL_SLOTS];
|
|
314
|
+
uint64_t sizes[GGML_KLEIDIAI_MAX_KERNEL_SLOTS];
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
static inline kleidiai_weight_header * kleidiai_weight_header_from_ptr(void * data) {
|
|
318
|
+
return reinterpret_cast<kleidiai_weight_header *>(data);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
static inline const kleidiai_weight_header * kleidiai_weight_header_from_ptr(const void * data) {
|
|
322
|
+
return reinterpret_cast<const kleidiai_weight_header *>(data);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
static inline bool kleidiai_is_weight_header_valid(const kleidiai_weight_header * header) {
|
|
326
|
+
if (!header) {
|
|
327
|
+
return false;
|
|
328
|
+
}
|
|
329
|
+
if (header->magic != GGML_KLEIDIAI_PACK_MAGIC || header->version != GGML_KLEIDIAI_PACK_VERSION) {
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
if (header->slot_count == 0 || header->slot_count > GGML_KLEIDIAI_MAX_KERNEL_SLOTS) {
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
335
|
+
return true;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
static inline uint8_t * kleidiai_weight_slot_ptr(kleidiai_weight_header * header, int slot) {
|
|
339
|
+
if (!kleidiai_is_weight_header_valid(header)) {
|
|
340
|
+
return nullptr;
|
|
341
|
+
}
|
|
342
|
+
if (slot < 0 || slot >= header->slot_count) {
|
|
343
|
+
return nullptr;
|
|
344
|
+
}
|
|
345
|
+
return reinterpret_cast<uint8_t *>(header) + header->offsets[slot];
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
static inline const uint8_t * kleidiai_weight_slot_ptr(const kleidiai_weight_header * header, int slot) {
|
|
349
|
+
if (!kleidiai_is_weight_header_valid(header)) {
|
|
350
|
+
return nullptr;
|
|
351
|
+
}
|
|
352
|
+
if (slot < 0 || slot >= header->slot_count) {
|
|
353
|
+
return nullptr;
|
|
354
|
+
}
|
|
355
|
+
return reinterpret_cast<const uint8_t *>(header) + header->offsets[slot];
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
static inline ggml_kleidiai_kernels * kleidiai_primary_kernel_q4() {
|
|
359
|
+
return ctx.kernels_q4;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
static inline ggml_kleidiai_kernels * kleidiai_primary_kernel_q8() {
|
|
363
|
+
return ctx.kernels_q8;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
template <typename SelectFallback>
|
|
367
|
+
static int kleidiai_collect_kernel_chain_common(
|
|
368
|
+
ggml_kleidiai_kernels * primary,
|
|
369
|
+
cpu_feature features,
|
|
370
|
+
std::array<ggml_kleidiai_kernels *, GGML_KLEIDIAI_MAX_KERNEL_SLOTS> & out,
|
|
371
|
+
SelectFallback select_fallback) {
|
|
372
|
+
int count = 0;
|
|
373
|
+
if (!primary) {
|
|
374
|
+
return 0;
|
|
375
|
+
}
|
|
376
|
+
out[count++] = primary;
|
|
377
|
+
|
|
378
|
+
if ((primary->required_cpu & CPU_FEATURE_SME) == CPU_FEATURE_SME) {
|
|
379
|
+
const cpu_feature fallback_mask = static_cast<cpu_feature>(features & ~CPU_FEATURE_SME);
|
|
380
|
+
if (fallback_mask != CPU_FEATURE_NONE) {
|
|
381
|
+
ggml_kleidiai_kernels * fallback = select_fallback(fallback_mask);
|
|
382
|
+
if (fallback && fallback != primary &&
|
|
383
|
+
fallback->lhs_type == primary->lhs_type &&
|
|
384
|
+
fallback->rhs_type == primary->rhs_type &&
|
|
385
|
+
fallback->op_type == primary->op_type) {
|
|
386
|
+
out[count++] = fallback;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
return count;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
static int kleidiai_collect_kernel_chain(const struct ggml_tensor * op,
|
|
395
|
+
std::array<ggml_kleidiai_kernels *, GGML_KLEIDIAI_MAX_KERNEL_SLOTS> & out) {
|
|
396
|
+
ggml_kleidiai_kernels * primary = ggml_kleidiai_select_kernels(ctx.features, op);
|
|
397
|
+
return kleidiai_collect_kernel_chain_common(primary, ctx.features, out,
|
|
398
|
+
[&](cpu_feature mask) { return ggml_kleidiai_select_kernels(mask, op); });
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
static int kleidiai_collect_q4_chain(std::array<ggml_kleidiai_kernels *, GGML_KLEIDIAI_MAX_KERNEL_SLOTS> & out) {
|
|
402
|
+
ggml_kleidiai_kernels * primary = kleidiai_primary_kernel_q4();
|
|
403
|
+
return kleidiai_collect_kernel_chain_common(primary, ctx.features, out,
|
|
404
|
+
[&](cpu_feature mask) { return ggml_kleidiai_select_kernels_q4_0(mask); });
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
static int kleidiai_collect_q8_chain(std::array<ggml_kleidiai_kernels *, GGML_KLEIDIAI_MAX_KERNEL_SLOTS> & out) {
|
|
408
|
+
ggml_kleidiai_kernels * primary = kleidiai_primary_kernel_q8();
|
|
409
|
+
return kleidiai_collect_kernel_chain_common(primary, ctx.features, out,
|
|
410
|
+
[&](cpu_feature mask) { return ggml_kleidiai_select_kernels_q8_0(mask); });
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
static inline int64_t ggml_ne(const ggml_tensor * tensor, int dim) {
|
|
414
|
+
GGML_ASSERT(dim >= 0 && dim < GGML_MAX_DIMS);
|
|
415
|
+
return tensor->ne[dim];
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
namespace ggml::cpu::kleidiai {
|
|
419
|
+
|
|
420
|
+
static size_t round_down(size_t x, size_t y) {
|
|
421
|
+
return y == 0 ? x : x - (x % y);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
static void transpose_f32kxn_f16nxk(size_t n, size_t k, float * dst, const uint16_t * src, size_t rhs_stride) {
|
|
425
|
+
size_t src_stride = rhs_stride / sizeof(uint16_t);
|
|
426
|
+
size_t dst_stride = n;
|
|
427
|
+
|
|
428
|
+
for (size_t k_idx = 0; k_idx < k; ++k_idx) {
|
|
429
|
+
for (size_t n_idx = 0; n_idx < n; ++n_idx) {
|
|
430
|
+
uint16_t v = *(src + k_idx + n_idx * src_stride);
|
|
431
|
+
*(dst + n_idx + k_idx * dst_stride) = kai_cast_f32_f16(v);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
class tensor_traits : public ggml::cpu::tensor_traits {
|
|
437
|
+
bool work_size(int /* n_threads */, const struct ggml_tensor * op, size_t & size) override {
|
|
438
|
+
if (op->op != GGML_OP_MUL_MAT) {
|
|
439
|
+
return false;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
std::array<ggml_kleidiai_kernels *, GGML_KLEIDIAI_MAX_KERNEL_SLOTS> kernel_chain;
|
|
443
|
+
const int slot_count = kleidiai_collect_kernel_chain(op, kernel_chain);
|
|
444
|
+
if (slot_count == 0) {
|
|
445
|
+
return false;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
const bool is_gemv = op->src[1]->ne[1] == 1;
|
|
449
|
+
const size_t k = op->src[0]->ne[0];
|
|
450
|
+
const size_t n = op->src[0]->ne[1];
|
|
451
|
+
const size_t m = op->src[1]->ne[1];
|
|
452
|
+
|
|
453
|
+
if (op->src[0]->type == GGML_TYPE_Q4_0 || op->src[0]->type == GGML_TYPE_Q8_0) {
|
|
454
|
+
const size_t qk = (op->src[0]->type == GGML_TYPE_Q4_0) ? QK4_0 : QK8_0;
|
|
455
|
+
|
|
456
|
+
size_t cursor = 0;
|
|
457
|
+
bool any_slot = false;
|
|
458
|
+
|
|
459
|
+
for (int slot = 0; slot < slot_count; ++slot) {
|
|
460
|
+
ggml_kleidiai_kernels * kernels = kernel_chain[slot];
|
|
461
|
+
lhs_packing_info * lhs_info = is_gemv ? &kernels->gemv_lhs_info : &kernels->gemm_lhs_info;
|
|
462
|
+
kernel_info * kernel = is_gemv ? &kernels->gemv : &kernels->gemm;
|
|
463
|
+
|
|
464
|
+
if (!lhs_info || !lhs_info->packed_size_ex || !kernel) {
|
|
465
|
+
return false;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
const size_t mr = kernel->get_mr();
|
|
469
|
+
const size_t kr = kernel->get_kr();
|
|
470
|
+
const size_t sr = kernel->get_sr();
|
|
471
|
+
|
|
472
|
+
const size_t packed = lhs_info->packed_size_ex(m, k, qk, mr, kr, sr);
|
|
473
|
+
|
|
474
|
+
cursor = align_up(cursor, GGML_KLEIDIAI_PACK_ALIGN);
|
|
475
|
+
cursor += packed;
|
|
476
|
+
any_slot = true;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
if (!any_slot) {
|
|
480
|
+
return false;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
size = cursor;
|
|
484
|
+
return true;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
if (op->src[0]->type == GGML_TYPE_F16) {
|
|
488
|
+
const int64_t lhs_batch_size0 = op->src[1]->ne[2];
|
|
489
|
+
const int64_t rhs_batch_size0 = op->src[0]->ne[2];
|
|
490
|
+
GGML_ASSERT(rhs_batch_size0 > 0);
|
|
491
|
+
const int64_t r = lhs_batch_size0 / rhs_batch_size0;
|
|
492
|
+
|
|
493
|
+
size_t cursor = 0;
|
|
494
|
+
bool any_slot = false;
|
|
495
|
+
|
|
496
|
+
for (int slot = 0; slot < slot_count; ++slot) {
|
|
497
|
+
ggml_kleidiai_kernels * kernels = kernel_chain[slot];
|
|
498
|
+
lhs_packing_info * lhs_info = is_gemv ? &kernels->gemv_lhs_info : &kernels->gemm_lhs_info;
|
|
499
|
+
kernel_info * kernel = is_gemv ? &kernels->gemv : &kernels->gemm;
|
|
500
|
+
if (!lhs_info || !lhs_info->packed_size_ex || !kernels->rhs_info.packed_size_ex || !kernel) {
|
|
501
|
+
return false;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
const size_t mr = kernel->get_mr();
|
|
505
|
+
const size_t kr = kernel->get_kr();
|
|
506
|
+
const size_t sr = kernel->get_sr();
|
|
507
|
+
|
|
508
|
+
cursor = align_up(cursor, GGML_KLEIDIAI_PACK_ALIGN);
|
|
509
|
+
cursor += lhs_info->packed_size_ex(m * r, k, 0, mr, kr, sr);
|
|
510
|
+
any_slot = true;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
for (int slot = 0; slot < slot_count; ++slot) {
|
|
514
|
+
ggml_kleidiai_kernels * kernels = kernel_chain[slot];
|
|
515
|
+
kernel_info * kernel = is_gemv ? &kernels->gemv : &kernels->gemm;
|
|
516
|
+
if (!kernel || !kernels->rhs_info.packed_size_ex) {
|
|
517
|
+
return false;
|
|
518
|
+
}
|
|
519
|
+
cursor = align_up(cursor, GGML_KLEIDIAI_PACK_ALIGN);
|
|
520
|
+
cursor += kernels->rhs_info.packed_size_ex(n, k, kernel->get_nr(), kernel->get_kr(), 0);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
cursor = align_up(cursor, GGML_KLEIDIAI_PACK_ALIGN);
|
|
524
|
+
cursor += k * n * sizeof(float);
|
|
525
|
+
cursor = align_up(cursor, GGML_KLEIDIAI_PACK_ALIGN);
|
|
526
|
+
cursor += n * sizeof(float);
|
|
527
|
+
|
|
528
|
+
if (!any_slot) {
|
|
529
|
+
return false;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
size = cursor;
|
|
533
|
+
return true;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
return false;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
bool compute_forward(struct ggml_compute_params * params, struct ggml_tensor * dst) override {
|
|
540
|
+
if (dst->op == GGML_OP_MUL_MAT) {
|
|
541
|
+
if (dst->src[0]->type == GGML_TYPE_Q4_0 || dst->src[0]->type == GGML_TYPE_Q8_0) {
|
|
542
|
+
return compute_forward_qx(params, dst);
|
|
543
|
+
} else if (dst->src[0]->type == GGML_TYPE_F16) {
|
|
544
|
+
return compute_forward_fp16(params, dst);
|
|
545
|
+
}
|
|
546
|
+
} else if (dst->op == GGML_OP_GET_ROWS) {
|
|
547
|
+
if (dst->src[0]->type == GGML_TYPE_Q4_0 || dst->src[0]->type == GGML_TYPE_Q8_0) {
|
|
548
|
+
return compute_forward_get_rows(params, dst);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
return false;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
bool compute_forward_fp16(ggml_compute_params * params, struct ggml_tensor * dst) {
|
|
555
|
+
const ggml_tensor * src0 = dst->src[0];
|
|
556
|
+
const ggml_tensor * src1 = dst->src[1];
|
|
557
|
+
|
|
558
|
+
GGML_TENSOR_BINARY_OP_LOCALS
|
|
559
|
+
|
|
560
|
+
ggml_kleidiai_kernels *kernels = ggml_kleidiai_select_kernels(ctx.features, dst);
|
|
561
|
+
if (!kernels) {
|
|
562
|
+
return false;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
const bool is_gemv = src1->ne[1] == 1;
|
|
566
|
+
kernel_info * kernel = is_gemv ? &kernels->gemv : &kernels->gemm;
|
|
567
|
+
lhs_packing_info * lhs_info = is_gemv ? &kernels->gemv_lhs_info : &kernels->gemm_lhs_info;
|
|
568
|
+
GGML_ASSERT(kernel);
|
|
569
|
+
if (!kernels->rhs_info.pack_func_ex ||
|
|
570
|
+
!kernel->get_lhs_offset_ex || !kernel->get_rhs_packed_offset_ex || !kernel->run_kernel_ex) {
|
|
571
|
+
return false;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
const int nth = params->nth;
|
|
575
|
+
const int ith = params->ith;
|
|
576
|
+
|
|
577
|
+
const int64_t lhs_batch_size0 = ne12;
|
|
578
|
+
const int64_t rhs_batch_size0 = ne02;
|
|
579
|
+
const int64_t batch_size = lhs_batch_size0;
|
|
580
|
+
|
|
581
|
+
GGML_ASSERT(rhs_batch_size0 > 0);
|
|
582
|
+
GGML_ASSERT(lhs_batch_size0 % rhs_batch_size0 == 0);
|
|
583
|
+
const int64_t r = lhs_batch_size0 / rhs_batch_size0;
|
|
584
|
+
|
|
585
|
+
const int64_t m_group = ne11;
|
|
586
|
+
const int64_t m = m_group;
|
|
587
|
+
const int64_t n = ne01;
|
|
588
|
+
const int64_t k = ne00;
|
|
589
|
+
|
|
590
|
+
const size_t lhs_stride = src1->nb[1];
|
|
591
|
+
const size_t rhs_stride = src0->nb[1];
|
|
592
|
+
const size_t dst_stride = dst->nb[1];
|
|
593
|
+
|
|
594
|
+
const int64_t mr = (int64_t) kernel->get_mr();
|
|
595
|
+
const int64_t nr = (int64_t) kernel->get_nr();
|
|
596
|
+
const int64_t kr = (int64_t) kernel->get_kr();
|
|
597
|
+
const int64_t sr = (int64_t) kernel->get_sr();
|
|
598
|
+
|
|
599
|
+
const size_t lhs_packed_size = lhs_info->packed_size_ex(m, k, 0, mr, kr, sr);
|
|
600
|
+
const size_t rhs_packed_size = kernels->rhs_info.packed_size_ex(n, k, nr, kr, 0);
|
|
601
|
+
const size_t kxn_size = k * n * sizeof(float);
|
|
602
|
+
const size_t bias_size = n * sizeof(float);
|
|
603
|
+
|
|
604
|
+
const size_t wsize_required = lhs_packed_size + rhs_packed_size + kxn_size + bias_size;
|
|
605
|
+
GGML_ASSERT(wsize_required <= params->wsize);
|
|
606
|
+
|
|
607
|
+
uint8_t * lhs_packed = static_cast<uint8_t *>(params->wdata);
|
|
608
|
+
uint8_t * rhs_packed = lhs_packed + lhs_packed_size;
|
|
609
|
+
uint8_t * rhs_kxn = rhs_packed + rhs_packed_size;
|
|
610
|
+
uint8_t * bias = rhs_kxn + kxn_size;
|
|
611
|
+
|
|
612
|
+
for (int64_t batch_idx = 0; batch_idx < batch_size; ++batch_idx) {
|
|
613
|
+
const int64_t rhs_batch_idx = batch_idx / r;
|
|
614
|
+
const uint8_t * rhs_batch_base = static_cast<const uint8_t *>(src0->data) + rhs_batch_idx * src0->nb[2];
|
|
615
|
+
uint8_t * dst_batch_base = static_cast<uint8_t *>(dst->data) + batch_idx * dst->nb[2];
|
|
616
|
+
|
|
617
|
+
// LHS packing (threaded over m, honoring mr alignment and KV groups)
|
|
618
|
+
{
|
|
619
|
+
const int64_t m_roundup_mr = kai_roundup(m, mr);
|
|
620
|
+
const int64_t num_threads = KAI_MIN(m_roundup_mr / mr, nth);
|
|
621
|
+
|
|
622
|
+
if (ith < num_threads) {
|
|
623
|
+
const int64_t num_m_per_thread0 = round_down((size_t)(m_roundup_mr / num_threads), (size_t)mr);
|
|
624
|
+
const int64_t num_m_per_threadN_1 = m - (num_threads - 1) * num_m_per_thread0;
|
|
625
|
+
|
|
626
|
+
const int64_t m_start = ith * num_m_per_thread0;
|
|
627
|
+
const int64_t m_count = (ith == num_threads - 1) ? num_m_per_threadN_1 : num_m_per_thread0;
|
|
628
|
+
|
|
629
|
+
// Base packed offset (aligned) and per-row stride in bytes
|
|
630
|
+
const size_t base_packed_off = lhs_info->get_packed_offset_ex(m_start, k, 0, mr, kr, sr);
|
|
631
|
+
const size_t next_block_off = lhs_info->get_packed_offset_ex(m_start + mr, k, 0, mr, kr, sr);
|
|
632
|
+
const size_t row_stride_bytes = (next_block_off - base_packed_off) / (size_t)mr;
|
|
633
|
+
|
|
634
|
+
int64_t remaining = m_count;
|
|
635
|
+
int64_t cur = m_start;
|
|
636
|
+
|
|
637
|
+
while (remaining > 0) {
|
|
638
|
+
const int64_t row_in_group = cur;
|
|
639
|
+
const int64_t avail = m_group - row_in_group;
|
|
640
|
+
const int64_t take = std::min(avail, remaining);
|
|
641
|
+
|
|
642
|
+
const uint8_t * lhs_batch_base = static_cast<const uint8_t *>(src1->data) + batch_idx * src1->nb[2];
|
|
643
|
+
const void * src_ptr = lhs_batch_base + (size_t)row_in_group * lhs_stride;
|
|
644
|
+
const size_t dst_off = base_packed_off + (size_t)(cur - m_start) * row_stride_bytes;
|
|
645
|
+
void * dst_ptr = lhs_packed + dst_off;
|
|
646
|
+
|
|
647
|
+
lhs_info->pack_func_ex(take, k, 0, mr, kr, sr, 0, src_ptr, lhs_stride, dst_ptr);
|
|
648
|
+
|
|
649
|
+
cur += take;
|
|
650
|
+
remaining -= take;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
// RHS packing (single thread), then synchronize
|
|
656
|
+
if (ith == 0) {
|
|
657
|
+
memset(bias, 0, (size_t)n * sizeof(float));
|
|
658
|
+
transpose_f32kxn_f16nxk((size_t)n, (size_t)k,
|
|
659
|
+
reinterpret_cast<float *>(rhs_kxn),
|
|
660
|
+
reinterpret_cast<const uint16_t *>(rhs_batch_base),
|
|
661
|
+
rhs_stride);
|
|
662
|
+
|
|
663
|
+
kernels->rhs_info.pack_func_ex(1, n, k, nr, kr, sr, 0, n * sizeof(float),
|
|
664
|
+
rhs_kxn, bias, nullptr, rhs_packed, 0, nullptr);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
ggml_barrier(params->threadpool);
|
|
668
|
+
|
|
669
|
+
// Matmul (threaded over n)
|
|
670
|
+
{
|
|
671
|
+
const int64_t n_step = (int64_t) kernel->get_n_step();
|
|
672
|
+
int64_t num_threads_n = KAI_MIN(n / n_step, nth);
|
|
673
|
+
if (num_threads_n <= 0) {
|
|
674
|
+
num_threads_n = 1;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
if (ith < num_threads_n) {
|
|
678
|
+
const int64_t num_n_per_thread0 = round_down((size_t)(n / num_threads_n), (size_t)n_step);
|
|
679
|
+
const int64_t num_n_per_threadN_1 = n - (num_threads_n - 1) * num_n_per_thread0;
|
|
680
|
+
|
|
681
|
+
const int64_t n_start = ith * num_n_per_thread0;
|
|
682
|
+
const int64_t n_to_process = (ith == num_threads_n - 1) ? num_n_per_threadN_1 : num_n_per_thread0;
|
|
683
|
+
|
|
684
|
+
// LHS packed base at row 0 (consistent with packing above)
|
|
685
|
+
const size_t lhs_packed_offset0 = lhs_info->get_packed_offset_ex(0, k, 0, mr, kr, sr);
|
|
686
|
+
const size_t rhs_packed_offset = kernel->get_rhs_packed_offset_ex(n_start, k, 0);
|
|
687
|
+
const size_t dst_offset = kernel->get_dst_offset((size_t)0, (size_t)n_start, dst_stride);
|
|
688
|
+
|
|
689
|
+
const void * lhs_ptr = lhs_packed + lhs_packed_offset0;
|
|
690
|
+
const void * rhs_ptr = rhs_packed + rhs_packed_offset;
|
|
691
|
+
float * dst_ptr = reinterpret_cast<float *>(dst_batch_base + dst_offset);
|
|
692
|
+
|
|
693
|
+
kernel->run_kernel_ex(m, n_to_process, k, 0, lhs_ptr, rhs_ptr, dst_ptr, dst_stride, sizeof(float), -FLT_MAX, FLT_MAX);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
if (batch_idx != batch_size - 1) {
|
|
698
|
+
ggml_barrier(params->threadpool);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
return true;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
bool compute_forward_qx(struct ggml_compute_params * params, struct ggml_tensor * dst) {
|
|
706
|
+
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_Q4_0 || dst->src[0]->type == GGML_TYPE_Q8_0);
|
|
707
|
+
|
|
708
|
+
const ggml_tensor * src0 = dst->src[0];
|
|
709
|
+
const ggml_tensor * src1 = dst->src[1];
|
|
710
|
+
|
|
711
|
+
GGML_TENSOR_BINARY_OP_LOCALS
|
|
712
|
+
|
|
713
|
+
const kleidiai_weight_header * header = kleidiai_weight_header_from_ptr(src0->data);
|
|
714
|
+
const bool has_header = kleidiai_is_weight_header_valid(header);
|
|
715
|
+
const bool is_gemv = src1->ne[1] == 1;
|
|
716
|
+
std::array<ggml_kleidiai_kernels *, GGML_KLEIDIAI_MAX_KERNEL_SLOTS> kernel_chain;
|
|
717
|
+
const int slot_total = kleidiai_collect_kernel_chain(dst, kernel_chain);
|
|
718
|
+
|
|
719
|
+
auto weight_for_slot = [&](int slot_index, size_t & size_out) -> const uint8_t * {
|
|
720
|
+
if (slot_index < 0 || slot_index >= slot_total) {
|
|
721
|
+
return nullptr;
|
|
722
|
+
}
|
|
723
|
+
if (has_header) {
|
|
724
|
+
if (slot_index < header->slot_count) {
|
|
725
|
+
size_out = static_cast<size_t>(header->sizes[slot_index]);
|
|
726
|
+
return kleidiai_weight_slot_ptr(header, slot_index);
|
|
727
|
+
}
|
|
728
|
+
return nullptr;
|
|
729
|
+
}
|
|
730
|
+
if (slot_index == 0) {
|
|
731
|
+
size_out = ggml_nbytes(src0);
|
|
732
|
+
return static_cast<const uint8_t *>(src0->data);
|
|
733
|
+
}
|
|
734
|
+
return nullptr;
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
struct runtime_slot {
|
|
738
|
+
int slot_index;
|
|
739
|
+
ggml_kleidiai_kernels * kernels;
|
|
740
|
+
kernel_info * kernel;
|
|
741
|
+
lhs_packing_info * lhs_info;
|
|
742
|
+
size_t mr;
|
|
743
|
+
size_t nr;
|
|
744
|
+
size_t kr;
|
|
745
|
+
size_t sr;
|
|
746
|
+
size_t n_step;
|
|
747
|
+
size_t lhs_packed_size;
|
|
748
|
+
size_t lhs_offset;
|
|
749
|
+
size_t n_offset;
|
|
750
|
+
size_t n_cols;
|
|
751
|
+
int assigned_threads;
|
|
752
|
+
int thread_begin;
|
|
753
|
+
int thread_end;
|
|
754
|
+
const uint8_t * rhs_base;
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
std::array<runtime_slot, GGML_KLEIDIAI_MAX_KERNEL_SLOTS> runtime{};
|
|
758
|
+
int runtime_count = 0;
|
|
759
|
+
|
|
760
|
+
for (int slot = 0; slot < slot_total && runtime_count < GGML_KLEIDIAI_MAX_KERNEL_SLOTS; ++slot) {
|
|
761
|
+
ggml_kleidiai_kernels * kernels = kernel_chain[slot];
|
|
762
|
+
kernel_info * kinfo = is_gemv ? &kernels->gemv : &kernels->gemm;
|
|
763
|
+
lhs_packing_info * linfo = is_gemv ? &kernels->gemv_lhs_info : &kernels->gemm_lhs_info;
|
|
764
|
+
if (!kinfo || !linfo || !linfo->packed_size_ex || !linfo->pack_func_ex || !linfo->get_offset ||
|
|
765
|
+
!kinfo->get_rhs_packed_offset_ex || !kinfo->run_kernel_ex || !kinfo->get_dst_offset) {
|
|
766
|
+
continue;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
size_t rhs_size = 0;
|
|
770
|
+
const uint8_t * rhs_ptr = weight_for_slot(slot, rhs_size);
|
|
771
|
+
if (!rhs_ptr || rhs_size == 0) {
|
|
772
|
+
continue;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
runtime[runtime_count] = {
|
|
776
|
+
slot,
|
|
777
|
+
kernels,
|
|
778
|
+
kinfo,
|
|
779
|
+
linfo,
|
|
780
|
+
kinfo->get_mr(),
|
|
781
|
+
kinfo->get_nr(),
|
|
782
|
+
kinfo->get_kr(),
|
|
783
|
+
kinfo->get_sr(),
|
|
784
|
+
kinfo->get_n_step(),
|
|
785
|
+
0,
|
|
786
|
+
0,
|
|
787
|
+
0,
|
|
788
|
+
0,
|
|
789
|
+
0,
|
|
790
|
+
0,
|
|
791
|
+
0,
|
|
792
|
+
rhs_ptr
|
|
793
|
+
};
|
|
794
|
+
++runtime_count;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
if (runtime_count == 0) {
|
|
798
|
+
ggml_kleidiai_kernels * fallback = ggml_kleidiai_select_kernels(ctx.features, dst);
|
|
799
|
+
if (!fallback) {
|
|
800
|
+
return false;
|
|
801
|
+
}
|
|
802
|
+
kernel_info * kinfo = is_gemv ? &fallback->gemv : &fallback->gemm;
|
|
803
|
+
lhs_packing_info * linfo = is_gemv ? &fallback->gemv_lhs_info : &fallback->gemm_lhs_info;
|
|
804
|
+
rhs_packing_info * rinfo = &fallback->rhs_info;
|
|
805
|
+
if (!kinfo || !linfo || !linfo->packed_size_ex || !linfo->pack_func_ex ||
|
|
806
|
+
!kinfo->get_rhs_packed_offset_ex || !kinfo->run_kernel_ex || !kinfo->get_dst_offset ||
|
|
807
|
+
!rinfo || !rinfo->pack_func_ex || !rinfo->packed_size_ex) {
|
|
808
|
+
return false;
|
|
809
|
+
}
|
|
810
|
+
kernel_chain[0] = fallback;
|
|
811
|
+
runtime[0] = {
|
|
812
|
+
0,
|
|
813
|
+
fallback,
|
|
814
|
+
kinfo,
|
|
815
|
+
linfo,
|
|
816
|
+
kinfo->get_mr(),
|
|
817
|
+
kinfo->get_nr(),
|
|
818
|
+
kinfo->get_kr(),
|
|
819
|
+
kinfo->get_sr(),
|
|
820
|
+
kinfo->get_n_step(),
|
|
821
|
+
0,
|
|
822
|
+
0,
|
|
823
|
+
0,
|
|
824
|
+
0,
|
|
825
|
+
0,
|
|
826
|
+
0,
|
|
827
|
+
0,
|
|
828
|
+
nullptr
|
|
829
|
+
};
|
|
830
|
+
size_t rhs_size_fallback = 0;
|
|
831
|
+
const uint8_t * rhs_base = weight_for_slot(0, rhs_size_fallback);
|
|
832
|
+
if (!rhs_base) {
|
|
833
|
+
rhs_base = static_cast<const uint8_t *>(src0->data);
|
|
834
|
+
}
|
|
835
|
+
runtime[0].rhs_base = rhs_base;
|
|
836
|
+
runtime_count = 1;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
const int nth_total = params->nth > 0 ? params->nth : 1;
|
|
840
|
+
const int ith_total = params->ith;
|
|
841
|
+
|
|
842
|
+
int sme_slot = -1;
|
|
843
|
+
for (int i = 0; i < runtime_count; ++i) {
|
|
844
|
+
if ((runtime[i].kernels->required_cpu & CPU_FEATURE_SME) == CPU_FEATURE_SME) {
|
|
845
|
+
sme_slot = i;
|
|
846
|
+
break;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
const int sme_cap_limit = ctx.sme_thread_cap;
|
|
851
|
+
const bool use_hybrid = sme_cap_limit > 0 &&
|
|
852
|
+
runtime_count > 1 &&
|
|
853
|
+
nth_total > sme_cap_limit;
|
|
854
|
+
// Heuristic: disable hybrid for very small workloads where per-slot overhead dominates.
|
|
855
|
+
// If rows are small or average columns per thread are small, keep single-slot.
|
|
856
|
+
size_t min_cols_per_thread = 0;
|
|
857
|
+
if (runtime_count > 0 && nth_total > 0) {
|
|
858
|
+
min_cols_per_thread = (size_t) std::max<int64_t>(1, (int64_t)ne01 / (int64_t)nth_total);
|
|
859
|
+
}
|
|
860
|
+
const bool too_small_for_hybrid = (min_cols_per_thread < 2) || (ne11 < 128);
|
|
861
|
+
|
|
862
|
+
const bool hybrid_enabled = use_hybrid && !too_small_for_hybrid;
|
|
863
|
+
|
|
864
|
+
if (!hybrid_enabled) {
|
|
865
|
+
int chosen_slot = 0;
|
|
866
|
+
if (too_small_for_hybrid && sme_slot != -1) {
|
|
867
|
+
chosen_slot = sme_slot;
|
|
868
|
+
} else if (runtime_count > 1 && ctx.sme_thread_cap > 0 && nth_total > ctx.sme_thread_cap) {
|
|
869
|
+
chosen_slot = 1;
|
|
870
|
+
}
|
|
871
|
+
if (chosen_slot != 0 && chosen_slot < runtime_count) {
|
|
872
|
+
runtime[0] = runtime[chosen_slot];
|
|
873
|
+
}
|
|
874
|
+
runtime_count = runtime_count > 0 ? 1 : 0;
|
|
875
|
+
|
|
876
|
+
// Recompute SME slot based on the collapsed runtime[0]
|
|
877
|
+
sme_slot = -1;
|
|
878
|
+
if (runtime_count > 0 &&
|
|
879
|
+
(runtime[0].kernels->required_cpu & CPU_FEATURE_SME) == CPU_FEATURE_SME) {
|
|
880
|
+
sme_slot = 0;
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
int sme_cap = kleidiai_sme_thread_cap();
|
|
885
|
+
if (sme_cap < 0) {
|
|
886
|
+
sme_cap = nth_total;
|
|
887
|
+
}
|
|
888
|
+
sme_cap = std::min(sme_cap, nth_total);
|
|
889
|
+
|
|
890
|
+
int threads_remaining = nth_total;
|
|
891
|
+
if (sme_slot != -1) {
|
|
892
|
+
int sme_threads = std::min(std::max(sme_cap, 0), threads_remaining);
|
|
893
|
+
runtime[sme_slot].assigned_threads = sme_threads;
|
|
894
|
+
threads_remaining -= sme_threads;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
int fallback_indices[GGML_KLEIDIAI_MAX_KERNEL_SLOTS];
|
|
898
|
+
int fallback_count = 0;
|
|
899
|
+
for (int i = 0; i < runtime_count; ++i) {
|
|
900
|
+
if (i == sme_slot) {
|
|
901
|
+
continue;
|
|
902
|
+
}
|
|
903
|
+
fallback_indices[fallback_count++] = i;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
for (int fi = 0; fi < fallback_count; ++fi) {
|
|
907
|
+
if (threads_remaining <= 0) {
|
|
908
|
+
break;
|
|
909
|
+
}
|
|
910
|
+
const int slot_index = fallback_indices[fi];
|
|
911
|
+
const int slots_left = fallback_count - fi;
|
|
912
|
+
int share = (threads_remaining + slots_left - 1) / slots_left;
|
|
913
|
+
share = std::min(share, threads_remaining);
|
|
914
|
+
runtime[slot_index].assigned_threads = share;
|
|
915
|
+
threads_remaining -= share;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
if (threads_remaining > 0) {
|
|
919
|
+
const int fallback_slot = (sme_slot != -1) ? sme_slot : 0;
|
|
920
|
+
runtime[fallback_slot].assigned_threads += threads_remaining;
|
|
921
|
+
threads_remaining = 0;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
int thread_cursor = 0;
|
|
925
|
+
for (int i = 0; i < runtime_count; ++i) {
|
|
926
|
+
runtime[i].thread_begin = thread_cursor;
|
|
927
|
+
thread_cursor += runtime[i].assigned_threads;
|
|
928
|
+
runtime[i].thread_end = thread_cursor;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
if (thread_cursor < nth_total && runtime_count > 0) {
|
|
932
|
+
runtime[runtime_count - 1].assigned_threads += nth_total - thread_cursor;
|
|
933
|
+
runtime[runtime_count - 1].thread_end = nth_total;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
int local_slot = -1;
|
|
937
|
+
int local_ith = 0;
|
|
938
|
+
for (int i = 0; i < runtime_count; ++i) {
|
|
939
|
+
if (ith_total >= runtime[i].thread_begin && ith_total < runtime[i].thread_end) {
|
|
940
|
+
local_slot = i;
|
|
941
|
+
local_ith = ith_total - runtime[i].thread_begin;
|
|
942
|
+
break;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
if (local_slot == -1) {
|
|
946
|
+
return false;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
const size_t k = ne00;
|
|
950
|
+
const size_t m = ne11;
|
|
951
|
+
const size_t n = ne01;
|
|
952
|
+
|
|
953
|
+
size_t cursor = 0;
|
|
954
|
+
for (int i = 0; i < runtime_count; ++i) {
|
|
955
|
+
const ggml_type slot_rhs_type = runtime[i].kernels->rhs_type;
|
|
956
|
+
const size_t slot_pack_size_arg = slot_rhs_type == GGML_TYPE_Q4_0 ? QK4_0 :
|
|
957
|
+
slot_rhs_type == GGML_TYPE_Q8_0 ? QK8_0 : 0;
|
|
958
|
+
runtime[i].lhs_packed_size = runtime[i].lhs_info->packed_size_ex(m, k, slot_pack_size_arg, runtime[i].mr, runtime[i].kr, runtime[i].sr);
|
|
959
|
+
cursor = align_up(cursor, GGML_KLEIDIAI_PACK_ALIGN);
|
|
960
|
+
runtime[i].lhs_offset = cursor;
|
|
961
|
+
cursor += runtime[i].lhs_packed_size;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
GGML_ASSERT(cursor <= params->wsize);
|
|
965
|
+
uint8_t * scratch = static_cast<uint8_t *>(params->wdata);
|
|
966
|
+
|
|
967
|
+
size_t assigned_cols = 0;
|
|
968
|
+
uint64_t weighted_total = 0;
|
|
969
|
+
if (runtime_count > 1 && sme_slot != -1) {
|
|
970
|
+
for (int i = 0; i < runtime_count; ++i) {
|
|
971
|
+
const uint64_t weight = (i == sme_slot) ? (sme_cap << 1) : 1;
|
|
972
|
+
weighted_total += (uint64_t)runtime[i].assigned_threads * weight;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
for (int i = 0; i < runtime_count; ++i) {
|
|
976
|
+
runtime[i].n_offset = assigned_cols;
|
|
977
|
+
if (runtime[i].assigned_threads == 0) {
|
|
978
|
+
runtime[i].n_cols = 0;
|
|
979
|
+
continue;
|
|
980
|
+
}
|
|
981
|
+
const size_t remaining_cols = n - assigned_cols;
|
|
982
|
+
if (remaining_cols == 0) {
|
|
983
|
+
runtime[i].n_cols = 0;
|
|
984
|
+
continue;
|
|
985
|
+
}
|
|
986
|
+
const size_t step = runtime[i].n_step ? runtime[i].n_step : 1;
|
|
987
|
+
size_t target = 0;
|
|
988
|
+
if (weighted_total > 0) {
|
|
989
|
+
const uint64_t weight = (i == sme_slot) ? (sme_cap << 1) : 1;
|
|
990
|
+
target = (size_t)(((uint64_t)n * runtime[i].assigned_threads * weight) / weighted_total);
|
|
991
|
+
} else {
|
|
992
|
+
target = (size_t)(((uint64_t)n * runtime[i].assigned_threads) / nth_total);
|
|
993
|
+
}
|
|
994
|
+
target = std::min(target, remaining_cols);
|
|
995
|
+
size_t aligned = round_down(target, step);
|
|
996
|
+
if (aligned == 0 && remaining_cols >= step) {
|
|
997
|
+
aligned = step;
|
|
998
|
+
}
|
|
999
|
+
runtime[i].n_cols = aligned;
|
|
1000
|
+
assigned_cols += aligned;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
if (assigned_cols < n) {
|
|
1004
|
+
for (int i = runtime_count - 1; i >= 0; --i) {
|
|
1005
|
+
if (runtime[i].assigned_threads > 0) {
|
|
1006
|
+
runtime[i].n_cols += n - assigned_cols;
|
|
1007
|
+
break;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
const size_t dst_stride = dst->nb[1];
|
|
1012
|
+
|
|
1013
|
+
for (int64_t batch_idx = 0; batch_idx < ne12; ++batch_idx) {
|
|
1014
|
+
const uint8_t * lhs_batch_base = static_cast<const uint8_t *>(src1->data) + batch_idx * src1->nb[2];
|
|
1015
|
+
uint8_t * dst_batch_base = static_cast<uint8_t *>(dst->data) + batch_idx * dst->nb[2];
|
|
1016
|
+
|
|
1017
|
+
if (runtime[local_slot].assigned_threads > 0) {
|
|
1018
|
+
runtime_slot & slot = runtime[local_slot];
|
|
1019
|
+
const ggml_type slot_rhs_type = slot.kernels->rhs_type;
|
|
1020
|
+
const size_t slot_lhs_exec_arg = slot_rhs_type == GGML_TYPE_Q4_0 ? QK4_0 :
|
|
1021
|
+
slot_rhs_type == GGML_TYPE_Q8_0 ? 0 : 0;
|
|
1022
|
+
const int64_t m_roundup_mr = kai_roundup((int64_t)m, (int64_t)slot.mr);
|
|
1023
|
+
int64_t max_threads = slot.mr ? (m_roundup_mr / (int64_t)slot.mr) : slot.assigned_threads;
|
|
1024
|
+
max_threads = std::max<int64_t>(1, max_threads);
|
|
1025
|
+
const int64_t use_threads = std::min<int64_t>(slot.assigned_threads, max_threads);
|
|
1026
|
+
|
|
1027
|
+
if (local_ith < use_threads) {
|
|
1028
|
+
const int64_t num_m_per_thread0 = round_down((size_t)(m_roundup_mr / use_threads), slot.mr);
|
|
1029
|
+
const int64_t num_m_per_threadN_1 = (int64_t)m - (use_threads - 1) * num_m_per_thread0;
|
|
1030
|
+
|
|
1031
|
+
const int64_t m_start = (int64_t)local_ith * num_m_per_thread0;
|
|
1032
|
+
const int64_t m_count = (local_ith == use_threads - 1) ? num_m_per_threadN_1 : num_m_per_thread0;
|
|
1033
|
+
|
|
1034
|
+
const size_t base_packed_off = slot.lhs_info->get_packed_offset_ex(m_start, k, slot_lhs_exec_arg, slot.mr, slot.kr, slot.sr);
|
|
1035
|
+
const size_t next_block_off = slot.lhs_info->get_packed_offset_ex(m_start + slot.mr, k, slot_lhs_exec_arg, slot.mr, slot.kr, slot.sr);
|
|
1036
|
+
const size_t row_stride_bytes = slot.mr ? (next_block_off - base_packed_off) / slot.mr : 0;
|
|
1037
|
+
|
|
1038
|
+
int64_t remaining = m_count;
|
|
1039
|
+
int64_t cur = m_start;
|
|
1040
|
+
|
|
1041
|
+
uint8_t * lhs_packed = scratch + slot.lhs_offset;
|
|
1042
|
+
while (remaining > 0) {
|
|
1043
|
+
const int64_t row_in_group = cur;
|
|
1044
|
+
const int64_t avail = (int64_t)m - row_in_group;
|
|
1045
|
+
const int64_t take = std::min(avail, remaining);
|
|
1046
|
+
|
|
1047
|
+
const size_t src_off = slot.lhs_info->get_offset(row_in_group, src1->nb[1]);
|
|
1048
|
+
const void * src_ptr = lhs_batch_base + src_off;
|
|
1049
|
+
const size_t dst_off = base_packed_off + (size_t)(cur - m_start) * row_stride_bytes;
|
|
1050
|
+
void * dst_ptr = lhs_packed + dst_off;
|
|
1051
|
+
|
|
1052
|
+
slot.lhs_info->pack_func_ex(take, k, slot_lhs_exec_arg, slot.mr, slot.kr, slot.sr, 0, src_ptr, src1->nb[1], dst_ptr);
|
|
1053
|
+
|
|
1054
|
+
cur += take;
|
|
1055
|
+
remaining -= take;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
ggml_barrier(params->threadpool);
|
|
1061
|
+
|
|
1062
|
+
runtime_slot & slot = runtime[local_slot];
|
|
1063
|
+
if (slot.n_cols > 0 && slot.assigned_threads > 0) {
|
|
1064
|
+
int64_t active_threads = slot.assigned_threads;
|
|
1065
|
+
const int64_t max_threads = slot.n_step ? (slot.n_cols / slot.n_step) : slot.assigned_threads;
|
|
1066
|
+
if (max_threads > 0) {
|
|
1067
|
+
active_threads = std::min<int64_t>(active_threads, std::max<int64_t>(1, max_threads));
|
|
1068
|
+
}
|
|
1069
|
+
active_threads = std::max<int64_t>(1, active_threads);
|
|
1070
|
+
|
|
1071
|
+
if (local_ith < active_threads) {
|
|
1072
|
+
const size_t step = slot.n_step ? slot.n_step : 1;
|
|
1073
|
+
const size_t chunk0 = round_down((size_t)(slot.n_cols / active_threads), step);
|
|
1074
|
+
const size_t chunkN = slot.n_cols - (active_threads - 1) * chunk0;
|
|
1075
|
+
const size_t local_start = (size_t)local_ith * chunk0;
|
|
1076
|
+
const size_t cols = (local_ith == active_threads - 1) ? chunkN : chunk0;
|
|
1077
|
+
|
|
1078
|
+
if (cols > 0) {
|
|
1079
|
+
const ggml_type slot_rhs_type = slot.kernels->rhs_type;
|
|
1080
|
+
const size_t slot_lhs_exec_arg = slot_rhs_type == GGML_TYPE_Q4_0 ? QK4_0 :
|
|
1081
|
+
slot_rhs_type == GGML_TYPE_Q8_0 ? 0 : 0;
|
|
1082
|
+
const size_t slot_rhs_block_arg = slot_rhs_type == GGML_TYPE_Q4_0 ? QK4_0 :
|
|
1083
|
+
slot_rhs_type == GGML_TYPE_Q8_0 ? 0 : 0;
|
|
1084
|
+
const size_t global_start = slot.n_offset + local_start;
|
|
1085
|
+
const size_t lhs_packed_offset = slot.lhs_info->get_packed_offset_ex(0, k, slot_lhs_exec_arg, slot.mr, slot.kr, slot.sr);
|
|
1086
|
+
const size_t rhs_packed_offset = slot.kernel->get_rhs_packed_offset_ex(global_start, k, slot_rhs_block_arg);
|
|
1087
|
+
const size_t dst_offset = slot.kernel->get_dst_offset(0, global_start, dst_stride);
|
|
1088
|
+
|
|
1089
|
+
const uint8_t * lhs_ptr = scratch + slot.lhs_offset + lhs_packed_offset;
|
|
1090
|
+
const uint8_t * rhs_ptr = slot.rhs_base + rhs_packed_offset;
|
|
1091
|
+
float * dst_ptr = reinterpret_cast<float *>(dst_batch_base + dst_offset);
|
|
1092
|
+
|
|
1093
|
+
slot.kernel->run_kernel_ex(m, cols, k, slot_rhs_block_arg,
|
|
1094
|
+
lhs_ptr,
|
|
1095
|
+
rhs_ptr,
|
|
1096
|
+
dst_ptr,
|
|
1097
|
+
dst_stride,
|
|
1098
|
+
sizeof(float),
|
|
1099
|
+
-FLT_MAX,
|
|
1100
|
+
FLT_MAX);
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
if (batch_idx != ne12 - 1) {
|
|
1106
|
+
ggml_barrier(params->threadpool);
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
return true;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
bool compute_forward_get_rows(struct ggml_compute_params * params, struct ggml_tensor * dst) {
|
|
1114
|
+
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_Q4_0 || dst->src[0]->type == GGML_TYPE_Q8_0);
|
|
1115
|
+
const ggml_tensor * src0 = dst->src[0];
|
|
1116
|
+
const ggml_tensor * src1 = dst->src[1];
|
|
1117
|
+
|
|
1118
|
+
GGML_TENSOR_BINARY_OP_LOCALS
|
|
1119
|
+
|
|
1120
|
+
const kleidiai_weight_header * header = kleidiai_weight_header_from_ptr(src0->data);
|
|
1121
|
+
const bool has_header = kleidiai_is_weight_header_valid(header);
|
|
1122
|
+
|
|
1123
|
+
std::array<ggml_kleidiai_kernels *, GGML_KLEIDIAI_MAX_KERNEL_SLOTS> kernel_chain;
|
|
1124
|
+
const bool want_q8 = src0->type == GGML_TYPE_Q8_0;
|
|
1125
|
+
const int chain_count = want_q8 ? kleidiai_collect_q8_chain(kernel_chain)
|
|
1126
|
+
: kleidiai_collect_q4_chain(kernel_chain);
|
|
1127
|
+
|
|
1128
|
+
ggml_kleidiai_kernels * kernels = nullptr;
|
|
1129
|
+
const uint8_t * packed_base = static_cast<const uint8_t *>(src0->data);
|
|
1130
|
+
|
|
1131
|
+
if (has_header && chain_count > 0) {
|
|
1132
|
+
int select_slot = 0;
|
|
1133
|
+
if (select_slot >= header->slot_count) {
|
|
1134
|
+
select_slot = header->slot_count - 1;
|
|
1135
|
+
}
|
|
1136
|
+
if (select_slot >= 0 && select_slot < chain_count) {
|
|
1137
|
+
kernels = kernel_chain[select_slot];
|
|
1138
|
+
const uint8_t * slot_ptr = kleidiai_weight_slot_ptr(header, select_slot);
|
|
1139
|
+
if (slot_ptr) {
|
|
1140
|
+
packed_base = slot_ptr;
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
if (!kernels && chain_count > 0) {
|
|
1146
|
+
kernels = kernel_chain[0];
|
|
1147
|
+
if (has_header) {
|
|
1148
|
+
const uint8_t * slot_ptr = kleidiai_weight_slot_ptr(header, 0);
|
|
1149
|
+
if (slot_ptr) {
|
|
1150
|
+
packed_base = slot_ptr;
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
if (!kernels) {
|
|
1156
|
+
return false;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
rhs_packing_info * rhs_info = &kernels->rhs_info;
|
|
1160
|
+
kernel_info * kernel = &kernels->gemm;
|
|
1161
|
+
if (!rhs_info->to_float || !kernel->get_nr) {
|
|
1162
|
+
return false;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
const int64_t nc = ne00;
|
|
1166
|
+
const int64_t nr = ggml_nelements(src1);
|
|
1167
|
+
|
|
1168
|
+
const ggml_type rhs_type = kernels->rhs_type;
|
|
1169
|
+
size_t block_len = 0;
|
|
1170
|
+
size_t num_bytes_multiplier = 0;
|
|
1171
|
+
if (rhs_type == GGML_TYPE_Q4_0) {
|
|
1172
|
+
block_len = QK4_0;
|
|
1173
|
+
num_bytes_multiplier = sizeof(uint16_t);
|
|
1174
|
+
} else if (rhs_type == GGML_TYPE_Q8_0) {
|
|
1175
|
+
block_len = QK8_0;
|
|
1176
|
+
num_bytes_multiplier = sizeof(float);
|
|
1177
|
+
} else {
|
|
1178
|
+
return false;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
const size_t block_rows = kernel->get_nr();
|
|
1182
|
+
const size_t kr = kernel->get_kr();
|
|
1183
|
+
|
|
1184
|
+
const size_t packed_stride = rhs_info->packed_stride(nc, block_rows, kr, block_len);
|
|
1185
|
+
|
|
1186
|
+
const int ith = params->ith;
|
|
1187
|
+
const int nth = params->nth;
|
|
1188
|
+
|
|
1189
|
+
const int dr = (nr + nth - 1) / nth;
|
|
1190
|
+
const int ir0 = dr * ith;
|
|
1191
|
+
const int ir1 = MIN(ir0 + dr, nr);
|
|
1192
|
+
|
|
1193
|
+
for (int64_t i = ir0; i < ir1; ++i) {
|
|
1194
|
+
GGML_ASSERT(src1->type == GGML_TYPE_I32);
|
|
1195
|
+
int64_t row_idx = ((const int32_t *)src1->data)[i];
|
|
1196
|
+
GGML_ASSERT(row_idx >= 0 && row_idx < src0->ne[1]);
|
|
1197
|
+
|
|
1198
|
+
float *out = (float *)((char *)dst->data + i * nb1);
|
|
1199
|
+
rhs_info->to_float(packed_base, row_idx, nc, out, block_rows, packed_stride, kr, block_len, num_bytes_multiplier);
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
return true;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
public:
|
|
1206
|
+
int repack(struct ggml_tensor * tensor, const void * data, size_t data_size) {
|
|
1207
|
+
GGML_ASSERT(tensor->type == GGML_TYPE_Q4_0 || tensor->type == GGML_TYPE_Q8_0);
|
|
1208
|
+
const size_t n = tensor->ne[1];
|
|
1209
|
+
const size_t k = tensor->ne[0];
|
|
1210
|
+
|
|
1211
|
+
kleidiai_weight_header * header = kleidiai_weight_header_from_ptr(tensor->data);
|
|
1212
|
+
if (!header) {
|
|
1213
|
+
return -1;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
header->magic = GGML_KLEIDIAI_PACK_MAGIC;
|
|
1217
|
+
header->version = GGML_KLEIDIAI_PACK_VERSION;
|
|
1218
|
+
header->slot_count = 0;
|
|
1219
|
+
|
|
1220
|
+
uint8_t * base_ptr = static_cast<uint8_t *>(tensor->data);
|
|
1221
|
+
size_t cursor = sizeof(kleidiai_weight_header);
|
|
1222
|
+
cursor = align_up(cursor, GGML_KLEIDIAI_PACK_ALIGN);
|
|
1223
|
+
|
|
1224
|
+
std::array<ggml_kleidiai_kernels *, GGML_KLEIDIAI_MAX_KERNEL_SLOTS> kernel_chain;
|
|
1225
|
+
const bool want_q8 = tensor->type == GGML_TYPE_Q8_0;
|
|
1226
|
+
const int slot_total = want_q8 ? kleidiai_collect_q8_chain(kernel_chain)
|
|
1227
|
+
: kleidiai_collect_q4_chain(kernel_chain);
|
|
1228
|
+
const bool allow_fallback = kleidiai_pack_fallback_allowed();
|
|
1229
|
+
|
|
1230
|
+
std::vector<int8_t> qdata;
|
|
1231
|
+
std::vector<float> scales;
|
|
1232
|
+
|
|
1233
|
+
if (want_q8 && slot_total > 0) {
|
|
1234
|
+
qdata.resize(n * k, 0);
|
|
1235
|
+
scales.resize(n, 0.0f);
|
|
1236
|
+
|
|
1237
|
+
const size_t row_stride = tensor->nb[1];
|
|
1238
|
+
const size_t k_blocks = (k + QK8_0 - 1) / QK8_0;
|
|
1239
|
+
|
|
1240
|
+
for (size_t row = 0; row < n; ++row) {
|
|
1241
|
+
const auto * row_blocks = reinterpret_cast<const block_q8_0 *>(
|
|
1242
|
+
static_cast<const uint8_t *>(data) + row * row_stride);
|
|
1243
|
+
|
|
1244
|
+
float max_abs = 0.0f;
|
|
1245
|
+
for (size_t block = 0; block < k_blocks; ++block) {
|
|
1246
|
+
const block_q8_0 & blk = row_blocks[block];
|
|
1247
|
+
const float d = GGML_FP16_TO_FP32(blk.d);
|
|
1248
|
+
for (size_t l = 0; l < QK8_0; ++l) {
|
|
1249
|
+
const size_t linear_idx = block * QK8_0 + l;
|
|
1250
|
+
if (linear_idx >= k) {
|
|
1251
|
+
break;
|
|
1252
|
+
}
|
|
1253
|
+
const float value = d * static_cast<float>(blk.qs[l]);
|
|
1254
|
+
max_abs = std::max(max_abs, std::fabs(value));
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
float scale = max_abs > 0.0f ? max_abs / 127.0f : 0.0f;
|
|
1259
|
+
scales[row] = scale;
|
|
1260
|
+
const float inv_scale = scale > 0.0f ? 1.0f / scale : 0.0f;
|
|
1261
|
+
|
|
1262
|
+
for (size_t block = 0; block < k_blocks; ++block) {
|
|
1263
|
+
const block_q8_0 & blk = row_blocks[block];
|
|
1264
|
+
const float d = GGML_FP16_TO_FP32(blk.d);
|
|
1265
|
+
for (size_t l = 0; l < QK8_0; ++l) {
|
|
1266
|
+
const size_t linear_idx = block * QK8_0 + l;
|
|
1267
|
+
if (linear_idx >= k) {
|
|
1268
|
+
break;
|
|
1269
|
+
}
|
|
1270
|
+
const float value = d * static_cast<float>(blk.qs[l]);
|
|
1271
|
+
int32_t q = scale > 0.0f ? static_cast<int32_t>(std::lround(value * inv_scale)) : 0;
|
|
1272
|
+
q = std::clamp(q, -127, 127);
|
|
1273
|
+
qdata[row * k + linear_idx] = static_cast<int8_t>(q);
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
for (int slot = 0; slot < slot_total && slot < GGML_KLEIDIAI_MAX_KERNEL_SLOTS; ++slot) {
|
|
1280
|
+
if (!allow_fallback && slot > 0) {
|
|
1281
|
+
break;
|
|
1282
|
+
}
|
|
1283
|
+
ggml_kleidiai_kernels * kernels = kernel_chain[slot];
|
|
1284
|
+
kernel_info * kernel = &kernels->gemm;
|
|
1285
|
+
rhs_packing_info * rhs_info = &kernels->rhs_info;
|
|
1286
|
+
if (!rhs_info || !rhs_info->pack_func_ex || !rhs_info->packed_size_ex || !kernel) {
|
|
1287
|
+
continue;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
const size_t nr = kernel->get_nr();
|
|
1291
|
+
const size_t kr = kernel->get_kr();
|
|
1292
|
+
const size_t sr = kernel->get_sr();
|
|
1293
|
+
const ggml_type rhs_type = kernels->rhs_type;
|
|
1294
|
+
const size_t block_len = rhs_type == GGML_TYPE_Q8_0 ? QK8_0 :
|
|
1295
|
+
rhs_type == GGML_TYPE_Q4_0 ? QK4_0 : 0;
|
|
1296
|
+
if (block_len == 0) {
|
|
1297
|
+
continue;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
const size_t packed_size = rhs_info->packed_size_ex(n, k, nr, kr, block_len);
|
|
1301
|
+
const size_t aligned_cursor = align_up(cursor, GGML_KLEIDIAI_PACK_ALIGN);
|
|
1302
|
+
|
|
1303
|
+
uint8_t * dst_ptr = base_ptr + aligned_cursor;
|
|
1304
|
+
|
|
1305
|
+
if (rhs_type == GGML_TYPE_Q4_0) {
|
|
1306
|
+
struct kai_rhs_pack_qs4cxs1s0_param params;
|
|
1307
|
+
params.lhs_zero_point = 1;
|
|
1308
|
+
params.rhs_zero_point = 8;
|
|
1309
|
+
rhs_info->pack_func_ex(1, n, k, nr, kr, sr, QK4_0, 0,
|
|
1310
|
+
static_cast<const uint8_t *>(data), nullptr, nullptr,
|
|
1311
|
+
dst_ptr, 0, ¶ms);
|
|
1312
|
+
} else if (rhs_type == GGML_TYPE_Q8_0) {
|
|
1313
|
+
struct kai_rhs_pack_qsi8cx_params params;
|
|
1314
|
+
params.lhs_zero_point = 1;
|
|
1315
|
+
params.scale_multiplier = 1.0f;
|
|
1316
|
+
rhs_info->pack_func_ex(1, n, k, nr, kr, sr, 0, 0,
|
|
1317
|
+
qdata.data(), nullptr, scales.data(),
|
|
1318
|
+
dst_ptr, 0, ¶ms);
|
|
1319
|
+
} else {
|
|
1320
|
+
continue;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
header->offsets[header->slot_count] = aligned_cursor;
|
|
1324
|
+
header->sizes[header->slot_count] = packed_size;
|
|
1325
|
+
++header->slot_count;
|
|
1326
|
+
|
|
1327
|
+
cursor = aligned_cursor + packed_size;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
if (header->slot_count == 0) {
|
|
1331
|
+
header->magic = 0;
|
|
1332
|
+
header->version = 0;
|
|
1333
|
+
memcpy(tensor->data, data, data_size);
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
return 0;
|
|
1337
|
+
}
|
|
1338
|
+
};
|
|
1339
|
+
|
|
1340
|
+
static ggml::cpu::tensor_traits * get_tensor_traits(ggml_backend_buffer_t, struct ggml_tensor *) {
|
|
1341
|
+
static tensor_traits traits;
|
|
1342
|
+
return &traits;
|
|
1343
|
+
}
|
|
1344
|
+
} // namespace ggml::cpu::kleidiai
|
|
1345
|
+
|
|
1346
|
+
static enum ggml_status ggml_backend_cpu_kleidiai_buffer_init_tensor(ggml_backend_buffer_t buffer, struct ggml_tensor * tensor) {
|
|
1347
|
+
tensor->extra = (void *) ggml::cpu::kleidiai::get_tensor_traits(buffer, tensor);
|
|
1348
|
+
|
|
1349
|
+
return GGML_STATUS_SUCCESS;
|
|
1350
|
+
GGML_UNUSED(buffer);
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
static void ggml_backend_cpu_kleidiai_buffer_set_tensor(ggml_backend_buffer_t buffer, struct ggml_tensor * tensor,
|
|
1354
|
+
const void * data, size_t offset, size_t size) {
|
|
1355
|
+
GGML_ASSERT(offset == 0);
|
|
1356
|
+
GGML_ASSERT(size == ggml_nbytes(tensor));
|
|
1357
|
+
|
|
1358
|
+
auto tensor_traits = (ggml::cpu::kleidiai::tensor_traits *) tensor->extra;
|
|
1359
|
+
auto OK = tensor_traits->repack(tensor, data, size);
|
|
1360
|
+
|
|
1361
|
+
GGML_ASSERT(OK == 0);
|
|
1362
|
+
GGML_UNUSED(buffer);
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
static const char * ggml_backend_cpu_kleidiai_buffer_type_get_name(ggml_backend_buffer_type_t buft) {
|
|
1366
|
+
GGML_UNUSED(buft);
|
|
1367
|
+
return "CPU_KLEIDIAI";
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
static ggml_backend_buffer_t ggml_backend_cpu_kleidiai_buffer_type_alloc_buffer(ggml_backend_buffer_type_t buft, size_t size) {
|
|
1371
|
+
ggml_backend_buffer_t buffer = ggml_backend_buft_alloc_buffer(ggml_backend_cpu_buffer_type(), size);
|
|
1372
|
+
|
|
1373
|
+
if (buffer == nullptr) {
|
|
1374
|
+
return nullptr;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
buffer->buft = buft;
|
|
1378
|
+
buffer->iface.init_tensor = ggml_backend_cpu_kleidiai_buffer_init_tensor;
|
|
1379
|
+
buffer->iface.set_tensor = ggml_backend_cpu_kleidiai_buffer_set_tensor;
|
|
1380
|
+
buffer->iface.get_tensor = nullptr;
|
|
1381
|
+
buffer->iface.cpy_tensor = nullptr;
|
|
1382
|
+
return buffer;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
static size_t ggml_backend_cpu_kleidiai_buffer_type_get_alignment(ggml_backend_buffer_type_t buft) {
|
|
1386
|
+
GGML_UNUSED(buft);
|
|
1387
|
+
return TENSOR_ALIGNMENT;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
static size_t ggml_backend_cpu_kleidiai_buffer_type_get_alloc_size(ggml_backend_buffer_type_t buft, const struct ggml_tensor * tensor) {
|
|
1391
|
+
GGML_UNUSED(buft);
|
|
1392
|
+
|
|
1393
|
+
if (tensor->type != GGML_TYPE_Q4_0 && tensor->type != GGML_TYPE_Q8_0) {
|
|
1394
|
+
return ggml_nbytes(tensor);
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
const size_t n = tensor->ne[1];
|
|
1398
|
+
const size_t k = tensor->ne[0];
|
|
1399
|
+
|
|
1400
|
+
size_t cursor = sizeof(kleidiai_weight_header);
|
|
1401
|
+
cursor = align_up(cursor, GGML_KLEIDIAI_PACK_ALIGN);
|
|
1402
|
+
|
|
1403
|
+
std::array<ggml_kleidiai_kernels *, GGML_KLEIDIAI_MAX_KERNEL_SLOTS> kernel_chain;
|
|
1404
|
+
const bool want_q8 = tensor->type == GGML_TYPE_Q8_0;
|
|
1405
|
+
const int slot_total = want_q8 ? kleidiai_collect_q8_chain(kernel_chain)
|
|
1406
|
+
: kleidiai_collect_q4_chain(kernel_chain);
|
|
1407
|
+
const bool allow_fallback = kleidiai_pack_fallback_allowed();
|
|
1408
|
+
|
|
1409
|
+
size_t slot_count = 0;
|
|
1410
|
+
for (int slot = 0; slot < slot_total; ++slot) {
|
|
1411
|
+
if (!allow_fallback && slot > 0) {
|
|
1412
|
+
break;
|
|
1413
|
+
}
|
|
1414
|
+
ggml_kleidiai_kernels * kernels = kernel_chain[slot];
|
|
1415
|
+
if (!kernels) {
|
|
1416
|
+
continue;
|
|
1417
|
+
}
|
|
1418
|
+
kernel_info * kernel = &kernels->gemm;
|
|
1419
|
+
rhs_packing_info * rhs_info = &kernels->rhs_info;
|
|
1420
|
+
if (!kernel || !rhs_info || !rhs_info->packed_size_ex) {
|
|
1421
|
+
continue;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
const ggml_type rhs_type = kernels->rhs_type;
|
|
1425
|
+
const size_t block_len = rhs_type == GGML_TYPE_Q4_0 ? QK4_0 :
|
|
1426
|
+
rhs_type == GGML_TYPE_Q8_0 ? QK8_0 : 0;
|
|
1427
|
+
if (block_len == 0) {
|
|
1428
|
+
continue;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
cursor = align_up(cursor, GGML_KLEIDIAI_PACK_ALIGN);
|
|
1432
|
+
cursor += rhs_info->packed_size_ex(n, k, kernel->get_nr(), kernel->get_kr(), block_len);
|
|
1433
|
+
++slot_count;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
if (slot_count == 0) {
|
|
1437
|
+
return ggml_nbytes(tensor);
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
return std::max(cursor, ggml_nbytes(tensor));
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
namespace ggml::cpu::kleidiai {
|
|
1444
|
+
class extra_buffer_type : ggml::cpu::extra_buffer_type {
|
|
1445
|
+
bool supports_op(ggml_backend_dev_t, const struct ggml_tensor * op) override {
|
|
1446
|
+
std::array<ggml_kleidiai_kernels *, GGML_KLEIDIAI_MAX_KERNEL_SLOTS> kernel_chain;
|
|
1447
|
+
const int slot_total = kleidiai_collect_kernel_chain(op, kernel_chain);
|
|
1448
|
+
if ((op->op == GGML_OP_MUL_MAT || op->op == GGML_OP_GET_ROWS) &&
|
|
1449
|
+
(op->src[0]->type == GGML_TYPE_Q4_0 || op->src[0]->type == GGML_TYPE_Q8_0) &&
|
|
1450
|
+
op->src[0]->buffer &&
|
|
1451
|
+
(ggml_n_dims(op->src[0]) == 2) &&
|
|
1452
|
+
op->src[0]->buffer->buft == ggml_backend_cpu_kleidiai_buffer_type() &&
|
|
1453
|
+
slot_total > 0) {
|
|
1454
|
+
if (op->src[0]->type == GGML_TYPE_Q4_0 && ctx.kernels_q4 == nullptr) {
|
|
1455
|
+
return false;
|
|
1456
|
+
}
|
|
1457
|
+
if (op->src[0]->type == GGML_TYPE_Q8_0 && ctx.kernels_q8 == nullptr) {
|
|
1458
|
+
return false;
|
|
1459
|
+
}
|
|
1460
|
+
if (op->src[1]->buffer && !ggml_backend_buft_is_host(op->src[1]->buffer->buft)) {
|
|
1461
|
+
return false;
|
|
1462
|
+
}
|
|
1463
|
+
if ((op->src[1]->type == GGML_TYPE_F32 || op->src[1]->type == GGML_TYPE_I32) &&
|
|
1464
|
+
ggml_ne(op->src[1], 3) == 1) {
|
|
1465
|
+
return true;
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
return false;
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
ggml::cpu::tensor_traits * get_tensor_traits(const struct ggml_tensor * op) override {
|
|
1472
|
+
if (op->op == GGML_OP_MUL_MAT || op->op == GGML_OP_GET_ROWS) {
|
|
1473
|
+
if (op->src[0]->buffer && op->src[0]->buffer->buft == ggml_backend_cpu_kleidiai_buffer_type()) {
|
|
1474
|
+
return (ggml::cpu::tensor_traits *) op->src[0]->extra;
|
|
1475
|
+
} else {
|
|
1476
|
+
if (op->src[0]->type != GGML_TYPE_F16) {
|
|
1477
|
+
return nullptr;
|
|
1478
|
+
}
|
|
1479
|
+
std::array<ggml_kleidiai_kernels *, GGML_KLEIDIAI_MAX_KERNEL_SLOTS> kernel_chain;
|
|
1480
|
+
const int slot_total = kleidiai_collect_kernel_chain(op, kernel_chain);
|
|
1481
|
+
if (slot_total > 0 && op->src[1]->ne[1] > 1) {
|
|
1482
|
+
if ((op->src[0]->nb[1] * op->src[0]->ne[1] != op->src[0]->nb[2]) ||
|
|
1483
|
+
(op->src[1]->nb[1] * op->src[1]->ne[1] != op->src[1]->nb[2])) {
|
|
1484
|
+
return nullptr;
|
|
1485
|
+
}
|
|
1486
|
+
return ggml::cpu::kleidiai::get_tensor_traits(NULL, NULL);
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
return nullptr;
|
|
1491
|
+
}
|
|
1492
|
+
};
|
|
1493
|
+
} // namespace ggml::cpu::kleidiai
|
|
1494
|
+
|
|
1495
|
+
ggml_backend_buffer_type_t ggml_backend_cpu_kleidiai_buffer_type(void) {
|
|
1496
|
+
static ggml::cpu::kleidiai::extra_buffer_type ctx;
|
|
1497
|
+
static struct ggml_backend_buffer_type ggml_backend_cpu_buffer_type_kleidiai = {
|
|
1498
|
+
/* .iface = */ {
|
|
1499
|
+
/* .get_name = */ ggml_backend_cpu_kleidiai_buffer_type_get_name,
|
|
1500
|
+
/* .alloc_buffer = */ ggml_backend_cpu_kleidiai_buffer_type_alloc_buffer,
|
|
1501
|
+
/* .get_alignment = */ ggml_backend_cpu_kleidiai_buffer_type_get_alignment,
|
|
1502
|
+
/* .get_max_size = */ nullptr, // defaults to SIZE_MAX
|
|
1503
|
+
/* .get_alloc_size = */ ggml_backend_cpu_kleidiai_buffer_type_get_alloc_size,
|
|
1504
|
+
/* .is_host = */ nullptr,
|
|
1505
|
+
},
|
|
1506
|
+
/* .device = */ ggml_backend_reg_dev_get(ggml_backend_cpu_reg(), 0),
|
|
1507
|
+
/* .context = */ &ctx,
|
|
1508
|
+
};
|
|
1509
|
+
|
|
1510
|
+
init_kleidiai_context();
|
|
1511
|
+
|
|
1512
|
+
return &ggml_backend_cpu_buffer_type_kleidiai;
|
|
1513
|
+
}
|