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,1740 @@
|
|
|
1
|
+
#define GGML_COMMON_IMPL_CPP
|
|
2
|
+
#define GGML_COMMON_DECL_CPP
|
|
3
|
+
|
|
4
|
+
#include "ime.h"
|
|
5
|
+
|
|
6
|
+
#include "binary-ops.h"
|
|
7
|
+
#include "common.h"
|
|
8
|
+
#include "ggml-backend-impl.h"
|
|
9
|
+
#include "ggml-common.h"
|
|
10
|
+
#include "ggml-cpu.h"
|
|
11
|
+
#include "ime_env.h"
|
|
12
|
+
#include "ime_kernels.h"
|
|
13
|
+
#include "ops.h"
|
|
14
|
+
#include "repack.h"
|
|
15
|
+
#include "rvv_kernels.h"
|
|
16
|
+
#include "spine_mem_pool.h"
|
|
17
|
+
#include "traits.h"
|
|
18
|
+
#include "vec.h"
|
|
19
|
+
|
|
20
|
+
#include <fcntl.h>
|
|
21
|
+
#include <sys/mman.h>
|
|
22
|
+
#include <unistd.h>
|
|
23
|
+
|
|
24
|
+
#include <algorithm>
|
|
25
|
+
#include <atomic>
|
|
26
|
+
#include <cassert>
|
|
27
|
+
#include <cerrno>
|
|
28
|
+
#include <cmath>
|
|
29
|
+
#include <cstdio> // for GGML_ASSERT
|
|
30
|
+
#include <stdexcept>
|
|
31
|
+
#include <thread>
|
|
32
|
+
// clang-format off
|
|
33
|
+
#if defined(__riscv)
|
|
34
|
+
|
|
35
|
+
#if !defined(__riscv_v) || !defined(__riscv_v_intrinsic)
|
|
36
|
+
#error "riscv v extension or v_intrinsic not enabled"
|
|
37
|
+
#else
|
|
38
|
+
#include <riscv_vector.h>
|
|
39
|
+
#endif
|
|
40
|
+
|
|
41
|
+
#if !defined(__riscv_zfh) || !defined(__riscv_zvfh)
|
|
42
|
+
#error "riscv zfh extension not enabled, GGML_RV_ZFH and GGML_RV_ZVFH must be defined to 1"
|
|
43
|
+
#endif
|
|
44
|
+
|
|
45
|
+
#if !defined(__riscv_zba)
|
|
46
|
+
#error "riscv zba extension not enabled, GGML_RV_ZBA must be defined to 1"
|
|
47
|
+
#endif
|
|
48
|
+
|
|
49
|
+
#if defined(RISCV64_SPACEMIT_IME1) || defined(RISCV64_SPACEMIT_IME2)
|
|
50
|
+
#else
|
|
51
|
+
#error "RISCV64_SPACEMIT_IME1 or RISCV64_SPACEMIT_IME2 not defined"
|
|
52
|
+
#endif
|
|
53
|
+
|
|
54
|
+
#else
|
|
55
|
+
|
|
56
|
+
#error "riscv not enabled in this build"
|
|
57
|
+
|
|
58
|
+
#endif
|
|
59
|
+
|
|
60
|
+
#if defined(__GNUC__)
|
|
61
|
+
#pragma GCC diagnostic ignored "-Woverlength-strings"
|
|
62
|
+
#pragma GCC diagnostic ignored "-Wcast-qual"
|
|
63
|
+
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
|
64
|
+
#endif
|
|
65
|
+
|
|
66
|
+
// clang-format on
|
|
67
|
+
|
|
68
|
+
extern "C" {
|
|
69
|
+
extern void ggml_threadpool_chunk_set(struct ggml_threadpool * tp, int value);
|
|
70
|
+
extern int ggml_threadpool_chunk_add(struct ggml_threadpool * tp, int value);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
namespace ggml::cpu::riscv64_spacemit {
|
|
74
|
+
|
|
75
|
+
struct TLSContext {
|
|
76
|
+
int cpu_id{ -1 };
|
|
77
|
+
cpu_set_t cpuset;
|
|
78
|
+
void * tcm_buffer{ nullptr };
|
|
79
|
+
size_t tcm_buffer_size{ 0 };
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
thread_local TLSContext tls_context;
|
|
83
|
+
|
|
84
|
+
template <typename BLOC_TYPE, int64_t INTER_SIZE, int64_t NB_COLS> constexpr size_t get_repacked_block_type_size() {
|
|
85
|
+
if constexpr (std::is_same_v<BLOC_TYPE, block_q6_K> || std::is_same_v<BLOC_TYPE, block_q8_0>) {
|
|
86
|
+
return sizeof(block_q8_0);
|
|
87
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_q4_0>) {
|
|
88
|
+
return sizeof(block_q4_0) * INTER_SIZE / QK4_0;
|
|
89
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_q4_1> || std::is_same_v<BLOC_TYPE, block_q4_K>) {
|
|
90
|
+
return (sizeof(block_q4_0) + sizeof(uint8_t)) * INTER_SIZE / QK4_1;
|
|
91
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_q2_K>) {
|
|
92
|
+
return sizeof(spacemit_kernels::nrow_block_q2_k<1>);
|
|
93
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_q3_K>) {
|
|
94
|
+
return sizeof(spacemit_kernels::nrow_block_q3_k<1>);
|
|
95
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_mxfp4>) {
|
|
96
|
+
return sizeof(spacemit_kernels::nrow_block_mxfp4<1>);
|
|
97
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_q5_1> || std::is_same_v<BLOC_TYPE, block_q5_K>) {
|
|
98
|
+
return sizeof(spacemit_kernels::nrow_block_q5_1<1>);
|
|
99
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_q5_0>) {
|
|
100
|
+
return sizeof(spacemit_kernels::nrow_block_q5_0<1>);
|
|
101
|
+
} else {
|
|
102
|
+
assert(false);
|
|
103
|
+
return 0;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
template <typename BLOC_TYPE> constexpr bool block_type_has_zp() {
|
|
108
|
+
if constexpr (std::is_same_v<BLOC_TYPE, block_q6_K> || std::is_same_v<BLOC_TYPE, block_q8_0> ||
|
|
109
|
+
std::is_same_v<BLOC_TYPE, block_q3_K> || std::is_same_v<BLOC_TYPE, block_q4_0> ||
|
|
110
|
+
std::is_same_v<BLOC_TYPE, block_mxfp4> || std::is_same_v<BLOC_TYPE, block_q5_0>) {
|
|
111
|
+
return false;
|
|
112
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_q4_1> || std::is_same_v<BLOC_TYPE, block_q4_K> ||
|
|
113
|
+
std::is_same_v<BLOC_TYPE, block_q2_K> || std::is_same_v<BLOC_TYPE, block_q5_1> ||
|
|
114
|
+
std::is_same_v<BLOC_TYPE, block_q5_K>) {
|
|
115
|
+
return true;
|
|
116
|
+
} else {
|
|
117
|
+
assert(false);
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
class tensor_traits_base : public ggml::cpu::tensor_traits {
|
|
123
|
+
public:
|
|
124
|
+
virtual int repack(ggml_tensor * t, const void * data, size_t data_size) = 0;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
template <typename BLOC_TYPE, int64_t INTER_SIZE, int64_t NB_COLS> class tensor_traits : public tensor_traits_base {
|
|
128
|
+
bool work_size(int /* n_threads */, const ggml_tensor * op, size_t & size) override {
|
|
129
|
+
switch (op->op) {
|
|
130
|
+
case GGML_OP_MUL_MAT:
|
|
131
|
+
{
|
|
132
|
+
int64_t src1_nelements = ggml_nelements(op->src[1]);
|
|
133
|
+
|
|
134
|
+
if constexpr (std::is_same_v<BLOC_TYPE, block_q2_K> || std::is_same_v<BLOC_TYPE, block_q3_K>) {
|
|
135
|
+
size =
|
|
136
|
+
spacemit_kernels::div_round_up(src1_nelements, QK_K) * spacemit_kernels::q8k_blk_size(QK_K);
|
|
137
|
+
} else if constexpr (INTER_SIZE == QK4_0) {
|
|
138
|
+
size = spacemit_kernels::div_round_up(src1_nelements, QK4_0) *
|
|
139
|
+
spacemit_kernels::q8_blk_size(QK4_0, true);
|
|
140
|
+
} else if constexpr (INTER_SIZE == 256) {
|
|
141
|
+
size = spacemit_kernels::div_round_up(src1_nelements, 256) *
|
|
142
|
+
spacemit_kernels::q8_hp_blk_size(256, true, true);
|
|
143
|
+
} else {
|
|
144
|
+
GGML_ABORT("unsupported block type");
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
size = GGML_PAD(size, sizeof(int64_t));
|
|
148
|
+
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
case GGML_OP_MUL_MAT_ID:
|
|
152
|
+
{
|
|
153
|
+
int64_t src1_nelements = ggml_nelements(op->src[1]);
|
|
154
|
+
|
|
155
|
+
if constexpr (std::is_same_v<BLOC_TYPE, block_q2_K> || std::is_same_v<BLOC_TYPE, block_q3_K>) {
|
|
156
|
+
size =
|
|
157
|
+
spacemit_kernels::div_round_up(src1_nelements, QK_K) * spacemit_kernels::q8k_blk_size(QK_K);
|
|
158
|
+
} else if constexpr (INTER_SIZE == QK4_0) {
|
|
159
|
+
size = spacemit_kernels::div_round_up(src1_nelements, QK4_0) *
|
|
160
|
+
spacemit_kernels::q8_blk_size(QK4_0, true);
|
|
161
|
+
} else if constexpr (INTER_SIZE == 256) {
|
|
162
|
+
size = spacemit_kernels::div_round_up(src1_nelements, 256) *
|
|
163
|
+
spacemit_kernels::q8_hp_blk_size(256, true, true);
|
|
164
|
+
} else {
|
|
165
|
+
GGML_ABORT("unsupported block type");
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
size = GGML_PAD(size, sizeof(int64_t));
|
|
169
|
+
|
|
170
|
+
const int64_t ne02 = op->src[0]->ne[2]; // n_as, n_expert
|
|
171
|
+
const int64_t ne12 = op->src[1]->ne[2]; // n_tokens
|
|
172
|
+
|
|
173
|
+
const size_t sizeof_mmid_row_mapping = sizeof(int64_t);
|
|
174
|
+
size += sizeof_mmid_row_mapping * ne02 * (ne12 + 1) + (ne02 + 1) * sizeof(int64_t);
|
|
175
|
+
|
|
176
|
+
size = GGML_PAD(size, sizeof(int64_t));
|
|
177
|
+
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
default:
|
|
181
|
+
// GGML_ABORT("fatal error");
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
bool compute_forward(ggml_compute_params * params, ggml_tensor * op) override {
|
|
188
|
+
switch (op->op) {
|
|
189
|
+
case GGML_OP_MUL_MAT:
|
|
190
|
+
switch (op->src[0]->type) {
|
|
191
|
+
case GGML_TYPE_Q2_K:
|
|
192
|
+
case GGML_TYPE_Q3_K:
|
|
193
|
+
case GGML_TYPE_Q4_0:
|
|
194
|
+
case GGML_TYPE_Q4_1:
|
|
195
|
+
case GGML_TYPE_Q4_K:
|
|
196
|
+
case GGML_TYPE_Q6_K:
|
|
197
|
+
case GGML_TYPE_Q8_0:
|
|
198
|
+
case GGML_TYPE_Q5_1:
|
|
199
|
+
case GGML_TYPE_Q5_K:
|
|
200
|
+
//case GGML_TYPE_MXFP4:
|
|
201
|
+
forward_mul_mat(params, op);
|
|
202
|
+
return true;
|
|
203
|
+
default:
|
|
204
|
+
// GGML_ABORT("fatal error: unsupported type for src0 in MUL_MAT");
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
break;
|
|
208
|
+
case GGML_OP_MUL_MAT_ID:
|
|
209
|
+
switch (op->src[0]->type) {
|
|
210
|
+
case GGML_TYPE_Q2_K:
|
|
211
|
+
case GGML_TYPE_Q3_K:
|
|
212
|
+
case GGML_TYPE_Q4_0:
|
|
213
|
+
case GGML_TYPE_Q4_1:
|
|
214
|
+
case GGML_TYPE_Q4_K:
|
|
215
|
+
case GGML_TYPE_Q6_K:
|
|
216
|
+
case GGML_TYPE_Q8_0:
|
|
217
|
+
case GGML_TYPE_Q5_1:
|
|
218
|
+
case GGML_TYPE_Q5_K:
|
|
219
|
+
//case GGML_TYPE_MXFP4:
|
|
220
|
+
forward_mul_mat_id(params, op);
|
|
221
|
+
return true;
|
|
222
|
+
default:
|
|
223
|
+
// GGML_ABORT("fatal error: unsupported type for src0 in MUL_MAT_ID");
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
break;
|
|
227
|
+
default:
|
|
228
|
+
// GGML_ABORT("fatal error");
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
void forward_mul_mat(ggml_compute_params * params, ggml_tensor * op) {
|
|
235
|
+
constexpr size_t a_blk_len = INTER_SIZE;
|
|
236
|
+
constexpr size_t b_blk_len = INTER_SIZE;
|
|
237
|
+
|
|
238
|
+
const ggml_tensor * src0 = op->src[0];
|
|
239
|
+
const ggml_tensor * src1 = op->src[1];
|
|
240
|
+
ggml_tensor * dst = op;
|
|
241
|
+
|
|
242
|
+
GGML_TENSOR_BINARY_OP_LOCALS
|
|
243
|
+
|
|
244
|
+
int ith = params->ith;
|
|
245
|
+
int nth = params->nth;
|
|
246
|
+
|
|
247
|
+
[[maybe_unused]] const enum ggml_type type = src0->type;
|
|
248
|
+
|
|
249
|
+
void * w_data = (void *) src0->data;
|
|
250
|
+
const float * feature = (const float *) src1->data;
|
|
251
|
+
float * output = (float *) dst->data;
|
|
252
|
+
|
|
253
|
+
const int64_t gemm_m = ne11 * ne12 * ne13;
|
|
254
|
+
const int64_t gemm_k = ne10;
|
|
255
|
+
const int64_t gemm_n = ne01;
|
|
256
|
+
|
|
257
|
+
spacemit_kernels::quantize_a_row_def quantize_a_row_i8;
|
|
258
|
+
spacemit_kernels::quantize_a_row_def quantize_a_4row_i8;
|
|
259
|
+
spacemit_kernels::gemm_kernel_quantize_def gemm_kernel;
|
|
260
|
+
bool set_kernel_impl = false;
|
|
261
|
+
|
|
262
|
+
int64_t block_stride_a = spacemit_kernels::q8_blk_size(a_blk_len);
|
|
263
|
+
|
|
264
|
+
#if defined(RISCV64_SPACEMIT_IME2)
|
|
265
|
+
if (!set_kernel_impl && (global_spine_env_info.use_ime2)) {
|
|
266
|
+
quantize_a_row_i8 = spacemit_kernels::rvv::quantize_a_row_i8;
|
|
267
|
+
quantize_a_4row_i8 = spacemit_kernels::rvv::quantize_a_4row_i8;
|
|
268
|
+
block_stride_a = spacemit_kernels::q8_blk_size(a_blk_len, true);
|
|
269
|
+
|
|
270
|
+
if constexpr (std::is_same_v<BLOC_TYPE, block_q6_K> || std::is_same_v<BLOC_TYPE, block_q8_0>) {
|
|
271
|
+
gemm_kernel = spacemit_kernels::ime2::gemm_kernel_i8i8;
|
|
272
|
+
set_kernel_impl = true;
|
|
273
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_q4_0> || std::is_same_v<BLOC_TYPE, block_q4_1> ||
|
|
274
|
+
std::is_same_v<BLOC_TYPE, block_q4_K>) {
|
|
275
|
+
if constexpr (INTER_SIZE == 256) {
|
|
276
|
+
gemm_kernel = spacemit_kernels::ime2::gemm_kernel_i8i4_hp;
|
|
277
|
+
quantize_a_row_i8 = spacemit_kernels::rvv::quantize_a_row_i8_hp;
|
|
278
|
+
quantize_a_4row_i8 = spacemit_kernels::rvv::quantize_a_4row_i8_hp;
|
|
279
|
+
block_stride_a = spacemit_kernels::q8_hp_blk_size(a_blk_len, true, true);
|
|
280
|
+
set_kernel_impl = true;
|
|
281
|
+
} else {
|
|
282
|
+
gemm_kernel = spacemit_kernels::ime2::gemm_kernel_i8i4;
|
|
283
|
+
quantize_a_row_i8 = spacemit_kernels::rvv::quantize_a_row_i8;
|
|
284
|
+
quantize_a_4row_i8 = spacemit_kernels::rvv::quantize_a_4row_i8;
|
|
285
|
+
block_stride_a = spacemit_kernels::q8_blk_size(a_blk_len, true);
|
|
286
|
+
set_kernel_impl = true;
|
|
287
|
+
}
|
|
288
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_q2_K>) {
|
|
289
|
+
quantize_a_row_i8 = spacemit_kernels::rvv::quantize_a_row_i8k;
|
|
290
|
+
quantize_a_4row_i8 = spacemit_kernels::rvv::quantize_a_4row_i8k;
|
|
291
|
+
block_stride_a = spacemit_kernels::q8k_blk_size(a_blk_len);
|
|
292
|
+
|
|
293
|
+
gemm_kernel = spacemit_kernels::ime2::gemm_kernel_i8i2k;
|
|
294
|
+
set_kernel_impl = true;
|
|
295
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_q3_K>) {
|
|
296
|
+
quantize_a_row_i8 = spacemit_kernels::rvv::quantize_a_row_i8k;
|
|
297
|
+
quantize_a_4row_i8 = spacemit_kernels::rvv::quantize_a_4row_i8k;
|
|
298
|
+
block_stride_a = spacemit_kernels::q8k_blk_size(a_blk_len);
|
|
299
|
+
|
|
300
|
+
gemm_kernel = spacemit_kernels::ime2::gemm_kernel_i8i3k;
|
|
301
|
+
set_kernel_impl = true;
|
|
302
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_mxfp4>) {
|
|
303
|
+
gemm_kernel = spacemit_kernels::ime2::gemm_kernel_i8mxfp4;
|
|
304
|
+
set_kernel_impl = true;
|
|
305
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_q5_1> || std::is_same_v<BLOC_TYPE, block_q5_K> ||
|
|
306
|
+
std::is_same_v<BLOC_TYPE, block_q5_0>) {
|
|
307
|
+
gemm_kernel = spacemit_kernels::ime2::gemm_kernel_i8i5;
|
|
308
|
+
set_kernel_impl = true;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
#endif
|
|
312
|
+
|
|
313
|
+
#if defined(RISCV64_SPACEMIT_IME1)
|
|
314
|
+
if (!set_kernel_impl && (global_spine_env_info.use_ime1)) {
|
|
315
|
+
quantize_a_row_i8 = spacemit_kernels::ime1::quantize_a_row_i8;
|
|
316
|
+
quantize_a_4row_i8 = spacemit_kernels::ime1::quantize_a_4row_i8;
|
|
317
|
+
|
|
318
|
+
if constexpr (std::is_same_v<BLOC_TYPE, block_q4_0> || std::is_same_v<BLOC_TYPE, block_q4_1> ||
|
|
319
|
+
std::is_same_v<BLOC_TYPE, block_q4_K>) {
|
|
320
|
+
gemm_kernel = spacemit_kernels::ime1::gemm_kernel_i8i4;
|
|
321
|
+
set_kernel_impl = true;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
#endif
|
|
325
|
+
if (!set_kernel_impl) {
|
|
326
|
+
GGML_ABORT("no kernel implementation found for the block type");
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
const int64_t a_k_blks = spacemit_kernels::div_round_up(gemm_k, a_blk_len);
|
|
330
|
+
const int64_t b_k_blks = spacemit_kernels::div_round_up(gemm_k, b_blk_len);
|
|
331
|
+
|
|
332
|
+
const int64_t row_stride_a = a_k_blks * block_stride_a;
|
|
333
|
+
const int64_t gemm_workspace_size = GGML_PAD(gemm_m * row_stride_a, alignof(int64_t));
|
|
334
|
+
|
|
335
|
+
if (ith == 0 && params->wsize < gemm_workspace_size) {
|
|
336
|
+
GGML_ABORT("wsize less than gemm_workspace_size");
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
uintptr_t ws_ptr = reinterpret_cast<uintptr_t>(params->wdata);
|
|
340
|
+
|
|
341
|
+
void * tcm_buffer = ggml::cpu::riscv64_spacemit::tls_context.tcm_buffer;
|
|
342
|
+
const int64_t tcm_buffer_size = ggml::cpu::riscv64_spacemit::tls_context.tcm_buffer_size;
|
|
343
|
+
|
|
344
|
+
auto * quant_a_buffer = reinterpret_cast<uint8_t *>(ws_ptr);
|
|
345
|
+
|
|
346
|
+
constexpr int64_t row_align = 4;
|
|
347
|
+
const int64_t row_blks = spacemit_kernels::div_round_up(gemm_m, row_align);
|
|
348
|
+
|
|
349
|
+
const int64_t row_stride_b = b_k_blks * get_repacked_block_type_size<BLOC_TYPE, INTER_SIZE, NB_COLS>();
|
|
350
|
+
const int64_t per_mb_rows_wsize = row_align * row_stride_a;
|
|
351
|
+
const int64_t per_nb_cols_wsize = NB_COLS * row_stride_b;
|
|
352
|
+
|
|
353
|
+
const int64_t barrier_idx = static_cast<int64_t>(ith / 2);
|
|
354
|
+
|
|
355
|
+
GGML_ASSERT(global_spine_env_info.init_barrier != nullptr);
|
|
356
|
+
GGML_ASSERT(barrier_idx < spine_init_barrier_count);
|
|
357
|
+
spine_barrier_t * cur_barrier = &global_spine_env_info.init_barrier[barrier_idx];
|
|
358
|
+
|
|
359
|
+
if (gemm_m == 1) {
|
|
360
|
+
int task_per_thread = spacemit_kernels::div_round_up(a_k_blks, nth);
|
|
361
|
+
int a_blk_start = ith * task_per_thread;
|
|
362
|
+
int a_blk_end = std::min(a_blk_start + task_per_thread, (int) a_k_blks);
|
|
363
|
+
if (a_blk_start < a_blk_end) {
|
|
364
|
+
quantize_a_row_i8(a_blk_len, feature + a_blk_start * a_blk_len, (a_blk_end - a_blk_start) * a_blk_len,
|
|
365
|
+
quant_a_buffer + a_blk_start * block_stride_a);
|
|
366
|
+
}
|
|
367
|
+
} else {
|
|
368
|
+
int task_per_thread = spacemit_kernels::div_round_up(row_blks, nth);
|
|
369
|
+
int m_row_blk_start = ith * task_per_thread;
|
|
370
|
+
int m_row_blk_end = std::min(m_row_blk_start + task_per_thread, (int) row_blks);
|
|
371
|
+
for (int m_row_blk = m_row_blk_start; m_row_blk < m_row_blk_end; m_row_blk++) {
|
|
372
|
+
int m_idx = m_row_blk * row_align;
|
|
373
|
+
int rows_tobe_handled = (gemm_m - m_idx) > row_align ? row_align : (gemm_m - m_idx);
|
|
374
|
+
|
|
375
|
+
if (rows_tobe_handled == row_align && quantize_a_4row_i8 != nullptr) {
|
|
376
|
+
const float * a_row_ptr = feature + m_idx * gemm_k;
|
|
377
|
+
auto * quant_a_row_ptr = quant_a_buffer + m_idx * row_stride_a;
|
|
378
|
+
quantize_a_4row_i8(a_blk_len, a_row_ptr, gemm_k, quant_a_row_ptr);
|
|
379
|
+
} else {
|
|
380
|
+
while (rows_tobe_handled) {
|
|
381
|
+
const float * a_row_ptr = feature + m_idx * gemm_k;
|
|
382
|
+
auto * quant_a_row_ptr = quant_a_buffer + m_idx * row_stride_a;
|
|
383
|
+
quantize_a_row_i8(a_blk_len, a_row_ptr, gemm_k, quant_a_row_ptr);
|
|
384
|
+
rows_tobe_handled -= 1;
|
|
385
|
+
m_idx += 1;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
ggml_barrier(params->threadpool);
|
|
392
|
+
|
|
393
|
+
const int64_t gemm_m_stride = gemm_n / gemm_m > 64 ? gemm_m : 16;
|
|
394
|
+
const int64_t gemm_m_blocked = spacemit_kernels::div_round_up(gemm_m, gemm_m_stride);
|
|
395
|
+
const int64_t max_gemm_n_stride = spacemit_kernels::div_round_up(gemm_n * gemm_m_blocked, nth);
|
|
396
|
+
|
|
397
|
+
int64_t gemm_n_stride = gemm_n;
|
|
398
|
+
if (max_gemm_n_stride < gemm_n) {
|
|
399
|
+
gemm_n_stride =
|
|
400
|
+
std::min(gemm_n_stride, spacemit_kernels::div_round_up(max_gemm_n_stride, NB_COLS) * NB_COLS);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
if (gemm_n_stride == gemm_n && tcm_buffer != nullptr && per_mb_rows_wsize <= tcm_buffer_size) {
|
|
404
|
+
for (int64_t m_start = ith * row_align; m_start < gemm_m; m_start += row_align * nth) {
|
|
405
|
+
uint8_t * b_col = reinterpret_cast<uint8_t *>(w_data);
|
|
406
|
+
uint8_t * b_col_zp = block_type_has_zp<BLOC_TYPE>() ? b_col : nullptr;
|
|
407
|
+
|
|
408
|
+
int64_t m_row_real = std::min(gemm_m - m_start, row_align);
|
|
409
|
+
|
|
410
|
+
spacemit_kernels::rvv::memcpy1d(tcm_buffer, quant_a_buffer + m_start * row_stride_a,
|
|
411
|
+
m_row_real * row_stride_a);
|
|
412
|
+
|
|
413
|
+
int64_t n_blk_real = 0;
|
|
414
|
+
for (int64_t ni = 0; ni < gemm_n; ni += n_blk_real, b_col += n_blk_real * row_stride_b) {
|
|
415
|
+
n_blk_real = std::min(gemm_n - ni, (int64_t) NB_COLS);
|
|
416
|
+
|
|
417
|
+
uint8_t * a_row_ptr = (uint8_t *) tcm_buffer;
|
|
418
|
+
float * c_blk = output + m_start * gemm_n + ni;
|
|
419
|
+
|
|
420
|
+
int32_t rows_remaining = m_row_real;
|
|
421
|
+
|
|
422
|
+
while (rows_remaining > 0) {
|
|
423
|
+
auto rows_handled = gemm_kernel(b_blk_len, a_row_ptr, b_col, b_col_zp, c_blk, rows_remaining,
|
|
424
|
+
n_blk_real, b_k_blks, gemm_n);
|
|
425
|
+
|
|
426
|
+
c_blk += rows_handled * gemm_n;
|
|
427
|
+
a_row_ptr += rows_handled * row_stride_a;
|
|
428
|
+
|
|
429
|
+
rows_remaining -= rows_handled;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
} else if (tcm_buffer != nullptr && per_nb_cols_wsize <= tcm_buffer_size) {
|
|
434
|
+
uint8_t * a_row = quant_a_buffer;
|
|
435
|
+
uint8_t * b_col = reinterpret_cast<uint8_t *>(tcm_buffer);
|
|
436
|
+
if ((gemm_workspace_size + per_nb_cols_wsize) <= tcm_buffer_size) {
|
|
437
|
+
a_row = (uint8_t *) tcm_buffer;
|
|
438
|
+
b_col = reinterpret_cast<uint8_t *>(tcm_buffer) + gemm_workspace_size;
|
|
439
|
+
}
|
|
440
|
+
uint8_t * b_col_zp = block_type_has_zp<BLOC_TYPE>() ? b_col : nullptr;
|
|
441
|
+
|
|
442
|
+
int64_t ni = ith * NB_COLS;
|
|
443
|
+
int64_t nb_real = std::min(gemm_n - ni, NB_COLS);
|
|
444
|
+
|
|
445
|
+
if (ith % 2 == 0 && nb_real > 0) {
|
|
446
|
+
spacemit_kernels::rvv::memcpy1d(b_col, reinterpret_cast<uint8_t *>(w_data) + ni * row_stride_b,
|
|
447
|
+
nb_real * row_stride_b);
|
|
448
|
+
if (a_row != quant_a_buffer) {
|
|
449
|
+
spacemit_kernels::rvv::memcpy1d(a_row, quant_a_buffer, gemm_workspace_size);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
spine_barrier_wait(cur_barrier);
|
|
454
|
+
|
|
455
|
+
if (ith % 2 != 0 && nb_real > 0) {
|
|
456
|
+
if (a_row != quant_a_buffer) {
|
|
457
|
+
spacemit_kernels::rvv::memcpy1d(a_row, quant_a_buffer, gemm_workspace_size);
|
|
458
|
+
}
|
|
459
|
+
spacemit_kernels::rvv::memcpy1d(b_col, reinterpret_cast<uint8_t *>(w_data) + ni * row_stride_b,
|
|
460
|
+
nb_real * row_stride_b);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
for (; ni < gemm_n; ni += NB_COLS * nth) {
|
|
464
|
+
int64_t rows_remaining = gemm_m;
|
|
465
|
+
float * c_blk = output + ni;
|
|
466
|
+
auto * a_row_cur = a_row;
|
|
467
|
+
|
|
468
|
+
if (ith % 2 != 0) {
|
|
469
|
+
spine_barrier_wait(cur_barrier);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
while (rows_remaining > 0) {
|
|
473
|
+
auto rows_handled = gemm_kernel(b_blk_len, a_row_cur, b_col, b_col_zp, c_blk, rows_remaining,
|
|
474
|
+
nb_real, b_k_blks, gemm_n);
|
|
475
|
+
|
|
476
|
+
c_blk += rows_handled * gemm_n;
|
|
477
|
+
a_row_cur += rows_handled * row_stride_a;
|
|
478
|
+
|
|
479
|
+
rows_remaining -= rows_handled;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
if (ith % 2 == 0) {
|
|
483
|
+
spine_barrier_wait(cur_barrier);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
const int64_t next_ni = ni + NB_COLS * nth;
|
|
487
|
+
if (next_ni < gemm_n) {
|
|
488
|
+
nb_real = std::min(gemm_n - next_ni, NB_COLS);
|
|
489
|
+
spacemit_kernels::rvv::memcpy1d(b_col, reinterpret_cast<uint8_t *>(w_data) + next_ni * row_stride_b,
|
|
490
|
+
nb_real * row_stride_b);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
} else {
|
|
494
|
+
const int64_t task_count_m = spacemit_kernels::div_round_up(gemm_m, gemm_m_stride);
|
|
495
|
+
const int64_t task_count_n = spacemit_kernels::div_round_up(gemm_n, gemm_n_stride);
|
|
496
|
+
|
|
497
|
+
int64_t task_count = task_count_m * task_count_n;
|
|
498
|
+
int64_t task_per_thread = (task_count + nth - 1) / nth;
|
|
499
|
+
int64_t start = ith * task_per_thread;
|
|
500
|
+
int64_t end = std::min((ith + 1) * task_per_thread, task_count);
|
|
501
|
+
for (int64_t compute_idx = start; compute_idx < end; compute_idx++) {
|
|
502
|
+
const auto tid_n = compute_idx / task_count_m;
|
|
503
|
+
const auto tid_m = compute_idx % task_count_m;
|
|
504
|
+
|
|
505
|
+
const int64_t m_start = tid_m * gemm_m_stride;
|
|
506
|
+
const int64_t m_count = std::min(gemm_m - m_start, (int64_t) gemm_m_stride);
|
|
507
|
+
|
|
508
|
+
const int64_t n_start = tid_n * gemm_n_stride;
|
|
509
|
+
const int64_t n_count = std::min(gemm_n - n_start, (int64_t) gemm_n_stride);
|
|
510
|
+
|
|
511
|
+
const int64_t n_blk = m_count == 1 ? n_count : NB_COLS;
|
|
512
|
+
|
|
513
|
+
uint8_t * b_col = reinterpret_cast<uint8_t *>(w_data) + n_start * row_stride_b;
|
|
514
|
+
uint8_t * b_col_zp = block_type_has_zp<BLOC_TYPE>() ? b_col : nullptr;
|
|
515
|
+
|
|
516
|
+
int64_t n_blk_real = 0;
|
|
517
|
+
for (int64_t ni = 0; ni < n_count; ni += n_blk_real, b_col += n_blk_real * row_stride_b) {
|
|
518
|
+
n_blk_real = std::min(n_count - ni, n_blk);
|
|
519
|
+
|
|
520
|
+
uint8_t * a_row = quant_a_buffer + m_start * row_stride_a;
|
|
521
|
+
|
|
522
|
+
float * c_blk = output + m_start * gemm_n + n_start + ni;
|
|
523
|
+
|
|
524
|
+
int64_t rows_remaining = m_count;
|
|
525
|
+
|
|
526
|
+
uint8_t * b_col_cur = b_col;
|
|
527
|
+
uint8_t * b_col_zp_cur = b_col_zp;
|
|
528
|
+
|
|
529
|
+
while (rows_remaining > 0) {
|
|
530
|
+
auto rows_handled = gemm_kernel(b_blk_len, a_row, b_col_cur, b_col_zp_cur, c_blk,
|
|
531
|
+
rows_remaining, n_blk_real, b_k_blks, gemm_n);
|
|
532
|
+
|
|
533
|
+
c_blk += rows_handled * gemm_n;
|
|
534
|
+
a_row += rows_handled * row_stride_a;
|
|
535
|
+
|
|
536
|
+
rows_remaining -= rows_handled;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
void forward_mul_mat_id(ggml_compute_params * params, ggml_tensor * op) {
|
|
544
|
+
constexpr size_t a_blk_len = INTER_SIZE;
|
|
545
|
+
constexpr size_t b_blk_len = INTER_SIZE;
|
|
546
|
+
|
|
547
|
+
const ggml_tensor * src0 = op->src[0];
|
|
548
|
+
const ggml_tensor * src1 = op->src[1];
|
|
549
|
+
const ggml_tensor * ids = op->src[2];
|
|
550
|
+
ggml_tensor * dst = op;
|
|
551
|
+
|
|
552
|
+
GGML_TENSOR_BINARY_OP_LOCALS
|
|
553
|
+
|
|
554
|
+
int ith = params->ith;
|
|
555
|
+
int nth = params->nth;
|
|
556
|
+
|
|
557
|
+
// row groups
|
|
558
|
+
const int n_ids = ids->ne[0]; // n_expert_used
|
|
559
|
+
const int n_as = ne02; // n_expert
|
|
560
|
+
|
|
561
|
+
struct mmid_row_mapping {
|
|
562
|
+
int32_t i1;
|
|
563
|
+
int32_t i2;
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
spacemit_kernels::quantize_a_row_def quantize_a_row_i8;
|
|
567
|
+
spacemit_kernels::gemm_kernel_quantize_def gemm_kernel;
|
|
568
|
+
spacemit_kernels::moe_gemm_kernel_quantize_def moe_gemm_kernel_m2;
|
|
569
|
+
bool set_kernel_impl = false;
|
|
570
|
+
size_t block_stride_a = spacemit_kernels::q8_blk_size(QK4_0);
|
|
571
|
+
|
|
572
|
+
#if defined(RISCV64_SPACEMIT_IME2)
|
|
573
|
+
if (!set_kernel_impl && (global_spine_env_info.use_ime2)) {
|
|
574
|
+
quantize_a_row_i8 = spacemit_kernels::rvv::quantize_a_row_i8;
|
|
575
|
+
block_stride_a = spacemit_kernels::q8_blk_size(QK4_0, true);
|
|
576
|
+
|
|
577
|
+
if constexpr (std::is_same_v<BLOC_TYPE, block_q6_K> || std::is_same_v<BLOC_TYPE, block_q8_0>) {
|
|
578
|
+
gemm_kernel = spacemit_kernels::ime2::gemm_kernel_i8i8;
|
|
579
|
+
set_kernel_impl = true;
|
|
580
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_q4_0> || std::is_same_v<BLOC_TYPE, block_q4_1> ||
|
|
581
|
+
std::is_same_v<BLOC_TYPE, block_q4_K>) {
|
|
582
|
+
if constexpr (INTER_SIZE == 256) {
|
|
583
|
+
gemm_kernel = spacemit_kernels::ime2::gemm_kernel_i8i4_hp;
|
|
584
|
+
quantize_a_row_i8 = spacemit_kernels::rvv::quantize_a_row_i8_hp;
|
|
585
|
+
block_stride_a = spacemit_kernels::q8_hp_blk_size(a_blk_len, true, true);
|
|
586
|
+
set_kernel_impl = true;
|
|
587
|
+
} else {
|
|
588
|
+
gemm_kernel = spacemit_kernels::ime2::gemm_kernel_i8i4;
|
|
589
|
+
moe_gemm_kernel_m2 = spacemit_kernels::ime2::moe_m2_gemm_kernel_i8i4;
|
|
590
|
+
quantize_a_row_i8 = spacemit_kernels::rvv::quantize_a_row_i8;
|
|
591
|
+
block_stride_a = spacemit_kernels::q8_blk_size(a_blk_len, true);
|
|
592
|
+
set_kernel_impl = true;
|
|
593
|
+
}
|
|
594
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_q2_K>) {
|
|
595
|
+
quantize_a_row_i8 = spacemit_kernels::rvv::quantize_a_row_i8k;
|
|
596
|
+
block_stride_a = spacemit_kernels::q8k_blk_size(a_blk_len);
|
|
597
|
+
gemm_kernel = spacemit_kernels::ime2::gemm_kernel_i8i2k;
|
|
598
|
+
set_kernel_impl = true;
|
|
599
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_q3_K>) {
|
|
600
|
+
quantize_a_row_i8 = spacemit_kernels::rvv::quantize_a_row_i8k;
|
|
601
|
+
block_stride_a = spacemit_kernels::q8k_blk_size(a_blk_len);
|
|
602
|
+
gemm_kernel = spacemit_kernels::ime2::gemm_kernel_i8i3k;
|
|
603
|
+
set_kernel_impl = true;
|
|
604
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_mxfp4>) {
|
|
605
|
+
gemm_kernel = spacemit_kernels::ime2::gemm_kernel_i8mxfp4;
|
|
606
|
+
moe_gemm_kernel_m2 = spacemit_kernels::ime2::moe_m2_gemm_kernel_i8mxfp4;
|
|
607
|
+
set_kernel_impl = true;
|
|
608
|
+
} else if constexpr (std::is_same_v<BLOC_TYPE, block_q5_1> || std::is_same_v<BLOC_TYPE, block_q5_K> ||
|
|
609
|
+
std::is_same_v<BLOC_TYPE, block_q5_0>) {
|
|
610
|
+
gemm_kernel = spacemit_kernels::ime2::gemm_kernel_i8i5;
|
|
611
|
+
moe_gemm_kernel_m2 = spacemit_kernels::ime2::moe_m2_gemm_kernel_i8i5;
|
|
612
|
+
set_kernel_impl = true;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
#endif
|
|
616
|
+
|
|
617
|
+
#if defined(RISCV64_SPACEMIT_IME1)
|
|
618
|
+
if (!set_kernel_impl && (global_spine_env_info.use_ime1)) {
|
|
619
|
+
quantize_a_row_i8 = spacemit_kernels::ime1::quantize_a_row_i8;
|
|
620
|
+
|
|
621
|
+
if constexpr (std::is_same_v<BLOC_TYPE, block_q4_0> || std::is_same_v<BLOC_TYPE, block_q4_1> ||
|
|
622
|
+
std::is_same_v<BLOC_TYPE, block_q4_K>) {
|
|
623
|
+
gemm_kernel = spacemit_kernels::ime1::gemm_kernel_i8i4;
|
|
624
|
+
set_kernel_impl = true;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
#endif
|
|
628
|
+
if (!set_kernel_impl) {
|
|
629
|
+
GGML_ABORT("no kernel implementation found for the block type");
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
const size_t a_k_blks = spacemit_kernels::div_round_up(ne10, a_blk_len);
|
|
633
|
+
const size_t b_k_blks = spacemit_kernels::div_round_up(ne10, b_blk_len);
|
|
634
|
+
|
|
635
|
+
const size_t nbw1 = a_k_blks * block_stride_a;
|
|
636
|
+
const size_t nbw2 = ne11 * nbw1;
|
|
637
|
+
const size_t nbw3 = nbw2 * ne12;
|
|
638
|
+
const size_t gemm_workspace_size = GGML_PAD(nbw3, alignof(int64_t));
|
|
639
|
+
|
|
640
|
+
const uintptr_t ws_ptr = reinterpret_cast<uintptr_t>(params->wdata);
|
|
641
|
+
auto * quant_a_buffer = reinterpret_cast<uint8_t *>(ws_ptr);
|
|
642
|
+
|
|
643
|
+
if (ne11 == 1) {
|
|
644
|
+
for (int64_t ii = ith; ii < ne12 * a_k_blks; ii += nth) {
|
|
645
|
+
int64_t i12 = ii / a_k_blks;
|
|
646
|
+
int64_t ak_blk_id = ii % a_k_blks;
|
|
647
|
+
quantize_a_row_i8(a_blk_len, (float *) ((char *) src1->data + i12 * nb12) + ak_blk_id * a_blk_len,
|
|
648
|
+
a_blk_len, quant_a_buffer + i12 * nbw2 + ak_blk_id * block_stride_a);
|
|
649
|
+
}
|
|
650
|
+
} else {
|
|
651
|
+
for (int64_t ii = ith; ii < ne12 * ne11; ii += nth) {
|
|
652
|
+
int64_t i12 = ii / ne11;
|
|
653
|
+
int64_t i11 = ii % ne11;
|
|
654
|
+
quantize_a_row_i8(a_blk_len, (float *) ((char *) src1->data + i12 * nb12 + i11 * nb11), ne10,
|
|
655
|
+
quant_a_buffer + i12 * nbw2 + i11 * nbw1);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
#define MMID_MATRIX_ROW(row_id, i1) matrix_rows[(row_id) *ne12 + (i1)]
|
|
660
|
+
|
|
661
|
+
int64_t * matrix_row_counts = (int64_t *) (ws_ptr + gemm_workspace_size);
|
|
662
|
+
int32_t * valid_ep_count = (int32_t *) (matrix_row_counts + n_as);
|
|
663
|
+
int32_t * valid_act_count = (int32_t *) (valid_ep_count + 1);
|
|
664
|
+
int64_t * valid_matrix_row_counts = (int64_t *) (valid_act_count + 1);
|
|
665
|
+
mmid_row_mapping * matrix_rows = (mmid_row_mapping *) (valid_matrix_row_counts + n_as);
|
|
666
|
+
|
|
667
|
+
if (ith == 0) {
|
|
668
|
+
// initialize matrix_row_counts
|
|
669
|
+
memset(matrix_row_counts, 0, n_as * sizeof(int64_t));
|
|
670
|
+
|
|
671
|
+
// group rows by src0 matrix
|
|
672
|
+
for (int32_t iid1 = 0; iid1 < ids->ne[1]; ++iid1) {
|
|
673
|
+
for (int32_t id = 0; id < n_ids; ++id) {
|
|
674
|
+
const int32_t i02 =
|
|
675
|
+
*(const int32_t *) ((const char *) ids->data + iid1 * ids->nb[1] + id * ids->nb[0]);
|
|
676
|
+
|
|
677
|
+
GGML_ASSERT(i02 >= 0 && i02 < n_as);
|
|
678
|
+
|
|
679
|
+
MMID_MATRIX_ROW(i02, matrix_row_counts[i02]) = { id, iid1 };
|
|
680
|
+
matrix_row_counts[i02] += 1;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
int32_t valid_ep_count_t = 0;
|
|
685
|
+
int32_t valid_act_count_t = 0;
|
|
686
|
+
for (int cur_a = 0; cur_a < n_as; ++cur_a) {
|
|
687
|
+
const int64_t cne1 = matrix_row_counts[cur_a];
|
|
688
|
+
if (cne1 == 0) {
|
|
689
|
+
continue;
|
|
690
|
+
}
|
|
691
|
+
valid_matrix_row_counts[valid_ep_count_t] = cur_a;
|
|
692
|
+
valid_act_count_t += cne1;
|
|
693
|
+
valid_ep_count_t += 1;
|
|
694
|
+
}
|
|
695
|
+
valid_ep_count[0] = valid_ep_count_t;
|
|
696
|
+
valid_act_count[0] = valid_act_count_t;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
const int64_t barrier_idx = static_cast<int64_t>(ith / 2);
|
|
700
|
+
|
|
701
|
+
GGML_ASSERT(global_spine_env_info.init_barrier != nullptr);
|
|
702
|
+
GGML_ASSERT(barrier_idx < spine_init_barrier_count);
|
|
703
|
+
spine_barrier_t * cur_barrier = &global_spine_env_info.init_barrier[barrier_idx];
|
|
704
|
+
|
|
705
|
+
ggml_barrier(params->threadpool);
|
|
706
|
+
|
|
707
|
+
const size_t row_stride_b = b_k_blks * get_repacked_block_type_size<BLOC_TYPE, INTER_SIZE, NB_COLS>();
|
|
708
|
+
const size_t expert_b_stride = ne01 * row_stride_b;
|
|
709
|
+
const size_t per_nb_cols_wsize = NB_COLS * row_stride_b;
|
|
710
|
+
|
|
711
|
+
std::array<const uint8_t *, 2> src_workspaces;
|
|
712
|
+
std::array<float *, 2> dst_workspaces;
|
|
713
|
+
|
|
714
|
+
auto * tcm_buffer = ggml::cpu::riscv64_spacemit::tls_context.tcm_buffer;
|
|
715
|
+
const auto tcm_buffer_size = ggml::cpu::riscv64_spacemit::tls_context.tcm_buffer_size;
|
|
716
|
+
|
|
717
|
+
const auto valid_ep_count_t = valid_ep_count[0];
|
|
718
|
+
const auto valid_act_count_t = valid_act_count[0];
|
|
719
|
+
|
|
720
|
+
int nth_es = 1;
|
|
721
|
+
int nth_n = nth;
|
|
722
|
+
|
|
723
|
+
int ith_es = ith % nth_es;
|
|
724
|
+
int ith_n = (ith / nth_es) % nth_n;
|
|
725
|
+
|
|
726
|
+
if (valid_ep_count_t % nth == 0 && tcm_buffer != nullptr && valid_ep_count_t == n_as &&
|
|
727
|
+
valid_act_count_t == n_as && per_nb_cols_wsize <= tcm_buffer_size) {
|
|
728
|
+
for (int64_t valid_id = ith; valid_id < valid_ep_count_t; valid_id += nth) {
|
|
729
|
+
const int64_t cur_a = valid_matrix_row_counts[valid_id];
|
|
730
|
+
|
|
731
|
+
auto * src0_cur = (uint8_t *) src0->data + cur_a * expert_b_stride;
|
|
732
|
+
|
|
733
|
+
mmid_row_mapping row_mapping = MMID_MATRIX_ROW(cur_a, 0);
|
|
734
|
+
const int id = row_mapping.i1;
|
|
735
|
+
const int64_t i11 = id % ne11;
|
|
736
|
+
const int64_t i12 = row_mapping.i2;
|
|
737
|
+
const int64_t i1 = id;
|
|
738
|
+
const int64_t i2 = i12;
|
|
739
|
+
|
|
740
|
+
auto * src1_col = quant_a_buffer + (i11 * nbw1 + i12 * nbw2);
|
|
741
|
+
float * c_blk = (float *) ((char *) dst->data + (i1 * nb1 + i2 * nb2));
|
|
742
|
+
|
|
743
|
+
uint8_t * a_row = src1_col;
|
|
744
|
+
uint8_t * b_col = reinterpret_cast<uint8_t *>(tcm_buffer);
|
|
745
|
+
if ((nbw1 + per_nb_cols_wsize) <= tcm_buffer_size) {
|
|
746
|
+
a_row = (uint8_t *) tcm_buffer;
|
|
747
|
+
b_col = reinterpret_cast<uint8_t *>(tcm_buffer) + nbw1;
|
|
748
|
+
}
|
|
749
|
+
uint8_t * b_col_zp = block_type_has_zp<BLOC_TYPE>() ? b_col : nullptr;
|
|
750
|
+
|
|
751
|
+
if (ith % 2 == 0) {
|
|
752
|
+
spacemit_kernels::rvv::memcpy1d(b_col, reinterpret_cast<uint8_t *>(src0_cur), per_nb_cols_wsize);
|
|
753
|
+
|
|
754
|
+
if (a_row != src1_col) {
|
|
755
|
+
spacemit_kernels::rvv::memcpy1d(a_row, src1_col, nbw1);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
spine_barrier_wait(cur_barrier);
|
|
760
|
+
|
|
761
|
+
if (ith % 2 != 0) {
|
|
762
|
+
if (a_row != src1_col) {
|
|
763
|
+
spacemit_kernels::rvv::memcpy1d(a_row, src1_col, nbw1);
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
spacemit_kernels::rvv::memcpy1d(b_col, reinterpret_cast<uint8_t *>(src0_cur), per_nb_cols_wsize);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
int64_t nb_real = std::min(ne01, NB_COLS);
|
|
770
|
+
for (int64_t ni = 0; ni < ne01; ni += NB_COLS) {
|
|
771
|
+
if (ith % 2 != 0) {
|
|
772
|
+
spine_barrier_wait(cur_barrier);
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
gemm_kernel(b_blk_len, a_row, b_col, b_col_zp, c_blk + ni, 1, nb_real, b_k_blks, ne01);
|
|
776
|
+
|
|
777
|
+
if (ith % 2 == 0) {
|
|
778
|
+
spine_barrier_wait(cur_barrier);
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
const int64_t next_ni = ni + NB_COLS;
|
|
782
|
+
if (next_ni < ne01) {
|
|
783
|
+
nb_real = std::min(ne01 - next_ni, NB_COLS);
|
|
784
|
+
spacemit_kernels::rvv::memcpy1d(
|
|
785
|
+
b_col, reinterpret_cast<uint8_t *>(src0_cur) + next_ni * row_stride_b, per_nb_cols_wsize);
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
} else {
|
|
790
|
+
for (int64_t valid_id = ith_es; valid_id < valid_ep_count_t; valid_id += nth_es) {
|
|
791
|
+
const int64_t cur_a = valid_matrix_row_counts[valid_id];
|
|
792
|
+
const int64_t cne1 = matrix_row_counts[cur_a];
|
|
793
|
+
|
|
794
|
+
int64_t src1_cur_start = 0;
|
|
795
|
+
int64_t src1_cur_end = cne1;
|
|
796
|
+
|
|
797
|
+
int64_t src0_cur_start = (ith_n * ne01) / nth_n;
|
|
798
|
+
int64_t src0_cur_end = MIN(((ith_n + 1) * ne01) / nth_n, ne01);
|
|
799
|
+
|
|
800
|
+
if (src1_cur_start >= src1_cur_end || src0_cur_start >= src0_cur_end) {
|
|
801
|
+
continue;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
src0_cur_start =
|
|
805
|
+
(src0_cur_start % NB_COLS) ? src0_cur_start + NB_COLS - (src0_cur_start % NB_COLS) : src0_cur_start;
|
|
806
|
+
src0_cur_end =
|
|
807
|
+
(src0_cur_end % NB_COLS) ? src0_cur_end + NB_COLS - (src0_cur_end % NB_COLS) : src0_cur_end;
|
|
808
|
+
|
|
809
|
+
auto * src0_cur = (uint8_t *) src0->data + cur_a * expert_b_stride + src0_cur_start * row_stride_b;
|
|
810
|
+
uint8_t * b_col_zp = block_type_has_zp<BLOC_TYPE>() ? src0_cur : nullptr;
|
|
811
|
+
|
|
812
|
+
size_t extra_tcm_buffer_size = tcm_buffer_size;
|
|
813
|
+
void * extra_tcm_buffer = tcm_buffer;
|
|
814
|
+
if (tcm_buffer != nullptr && (src1_cur_end - src1_cur_start) >= 4 &&
|
|
815
|
+
(src0_cur_end - src0_cur_start) * row_stride_b <= tcm_buffer_size) {
|
|
816
|
+
spacemit_kernels::rvv::memcpy1d(tcm_buffer, src0_cur,
|
|
817
|
+
(src0_cur_end - src0_cur_start) * row_stride_b);
|
|
818
|
+
src0_cur = reinterpret_cast<uint8_t *>(tcm_buffer);
|
|
819
|
+
b_col_zp = block_type_has_zp<BLOC_TYPE>() ? src0_cur : nullptr;
|
|
820
|
+
extra_tcm_buffer_size -= (src0_cur_end - src0_cur_start) * row_stride_b;
|
|
821
|
+
extra_tcm_buffer = reinterpret_cast<void *>(reinterpret_cast<uintptr_t>(tcm_buffer) +
|
|
822
|
+
(src0_cur_end - src0_cur_start) * row_stride_b);
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
int ir1 = src1_cur_start;
|
|
826
|
+
|
|
827
|
+
if (extra_tcm_buffer_size >= nbw1 && extra_tcm_buffer != nullptr) {
|
|
828
|
+
int64_t quant_a_tile_size = extra_tcm_buffer_size / nbw1;
|
|
829
|
+
do {
|
|
830
|
+
quant_a_tile_size = MIN(quant_a_tile_size, src1_cur_end - ir1);
|
|
831
|
+
|
|
832
|
+
uint8_t * quant_a_tile_buffer = reinterpret_cast<uint8_t *>(extra_tcm_buffer);
|
|
833
|
+
|
|
834
|
+
int iir1 = ir1;
|
|
835
|
+
for (; iir1 < (ir1 + quant_a_tile_size); ++iir1) {
|
|
836
|
+
mmid_row_mapping row_mapping = MMID_MATRIX_ROW(cur_a, iir1);
|
|
837
|
+
|
|
838
|
+
const int id = row_mapping.i1; // selected expert index
|
|
839
|
+
|
|
840
|
+
const int64_t i11 = id % ne11;
|
|
841
|
+
const int64_t i12 = row_mapping.i2; // row index in src1
|
|
842
|
+
|
|
843
|
+
auto * src1_col = quant_a_buffer + (i11 * nbw1 + i12 * nbw2);
|
|
844
|
+
spacemit_kernels::rvv::memcpy1d(quant_a_tile_buffer, src1_col, nbw1);
|
|
845
|
+
quant_a_tile_buffer = quant_a_tile_buffer + nbw1;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
quant_a_tile_buffer = reinterpret_cast<uint8_t *>(extra_tcm_buffer);
|
|
849
|
+
iir1 = ir1;
|
|
850
|
+
|
|
851
|
+
if (moe_gemm_kernel_m2 != nullptr) {
|
|
852
|
+
for (; iir1 < (ir1 + quant_a_tile_size - 1); iir1 += 2, quant_a_tile_buffer += 2 * nbw1) {
|
|
853
|
+
mmid_row_mapping row_mapping_0 = MMID_MATRIX_ROW(cur_a, iir1);
|
|
854
|
+
mmid_row_mapping row_mapping_1 = MMID_MATRIX_ROW(cur_a, iir1 + 1);
|
|
855
|
+
|
|
856
|
+
src_workspaces[0] = quant_a_tile_buffer;
|
|
857
|
+
src_workspaces[1] = quant_a_tile_buffer + nbw1;
|
|
858
|
+
|
|
859
|
+
dst_workspaces[0] =
|
|
860
|
+
(float *) ((char *) dst->data + (row_mapping_0.i1 * nb1 + row_mapping_0.i2 * nb2)) +
|
|
861
|
+
src0_cur_start;
|
|
862
|
+
dst_workspaces[1] = (float *) ((char *) dst->data +
|
|
863
|
+
((row_mapping_1.i1) * nb1 + (row_mapping_1.i2) * nb2)) +
|
|
864
|
+
src0_cur_start;
|
|
865
|
+
moe_gemm_kernel_m2(b_blk_len, src_workspaces.data(), src0_cur, b_col_zp,
|
|
866
|
+
dst_workspaces.data(), 1, src0_cur_end - src0_cur_start, b_k_blks,
|
|
867
|
+
ne01);
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
for (; iir1 < (ir1 + quant_a_tile_size); iir1++, quant_a_tile_buffer += nbw1) {
|
|
872
|
+
mmid_row_mapping row_mapping_0 = MMID_MATRIX_ROW(cur_a, iir1);
|
|
873
|
+
|
|
874
|
+
gemm_kernel(
|
|
875
|
+
b_blk_len, quant_a_tile_buffer, src0_cur, b_col_zp,
|
|
876
|
+
(float *) ((char *) dst->data + (row_mapping_0.i1 * nb1 + row_mapping_0.i2 * nb2)) +
|
|
877
|
+
src0_cur_start,
|
|
878
|
+
1, src0_cur_end - src0_cur_start, b_k_blks, ne01);
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
ir1 += quant_a_tile_size;
|
|
882
|
+
} while (ir1 < src1_cur_end);
|
|
883
|
+
} else {
|
|
884
|
+
if (moe_gemm_kernel_m2 != nullptr) {
|
|
885
|
+
for (; ir1 < src1_cur_end - 1; ir1 += 2) {
|
|
886
|
+
for (int iir1 = 0; iir1 < 2; ++iir1) {
|
|
887
|
+
mmid_row_mapping row_mapping = MMID_MATRIX_ROW(cur_a, ir1 + iir1);
|
|
888
|
+
|
|
889
|
+
const int id = row_mapping.i1; // selected expert index
|
|
890
|
+
|
|
891
|
+
const int64_t i11 = id % ne11;
|
|
892
|
+
const int64_t i12 = row_mapping.i2; // row index in src1
|
|
893
|
+
|
|
894
|
+
const int64_t i1 = id; // selected expert index
|
|
895
|
+
const int64_t i2 = i12; // row
|
|
896
|
+
|
|
897
|
+
src_workspaces[iir1] = quant_a_buffer + (i11 * nbw1 + i12 * nbw2);
|
|
898
|
+
|
|
899
|
+
dst_workspaces[iir1] =
|
|
900
|
+
(float *) ((char *) dst->data + (i1 * nb1 + i2 * nb2)) + src0_cur_start;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
moe_gemm_kernel_m2(b_blk_len, src_workspaces.data(), src0_cur, b_col_zp,
|
|
904
|
+
dst_workspaces.data(), 1, src0_cur_end - src0_cur_start, b_k_blks, ne01);
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
for (; ir1 < src1_cur_end; ir1++) {
|
|
909
|
+
mmid_row_mapping row_mapping = MMID_MATRIX_ROW(cur_a, ir1);
|
|
910
|
+
|
|
911
|
+
const int id = row_mapping.i1; // selected expert index
|
|
912
|
+
|
|
913
|
+
const int64_t i11 = id % ne11;
|
|
914
|
+
const int64_t i12 = row_mapping.i2; // row index in src1
|
|
915
|
+
|
|
916
|
+
const int64_t i1 = id; // selected expert index
|
|
917
|
+
const int64_t i2 = i12; // row
|
|
918
|
+
|
|
919
|
+
auto * src1_col = quant_a_buffer + (i11 * nbw1 + i12 * nbw2);
|
|
920
|
+
|
|
921
|
+
gemm_kernel(b_blk_len, src1_col, src0_cur, b_col_zp,
|
|
922
|
+
(float *) ((char *) dst->data + (i1 * nb1 + i2 * nb2)) + src0_cur_start, 1,
|
|
923
|
+
src0_cur_end - src0_cur_start, b_k_blks, ne01);
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
#undef MMID_MATRIX_ROW
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
int repack(ggml_tensor * t, const void * data, size_t data_size) override {
|
|
932
|
+
GGML_LOG_DEBUG("%s: repack tensor %s with %s_%dx%d\n", __func__, t->name, ggml_type_name(t->type),
|
|
933
|
+
(int) NB_COLS, (int) INTER_SIZE);
|
|
934
|
+
return ggml::cpu::riscv64_spacemit::repack<BLOC_TYPE, INTER_SIZE, NB_COLS>(t, data, data_size);
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
|
|
938
|
+
class tensor_traits_common : public tensor_traits_base {
|
|
939
|
+
bool work_size(int n_threads, const ggml_tensor * op, size_t & size) override {
|
|
940
|
+
switch (op->op) {
|
|
941
|
+
case GGML_OP_FLASH_ATTN_EXT:
|
|
942
|
+
{
|
|
943
|
+
const int n_tasks = n_threads;
|
|
944
|
+
const int64_t neq2 = op->src[0]->ne[2]; // number of query heads
|
|
945
|
+
const int64_t DK = op->src[1]->ne[0];
|
|
946
|
+
const int64_t DV = op->src[2]->ne[0]; // DV
|
|
947
|
+
|
|
948
|
+
// Tiled flash attention scratch (tile sizes defined in common.h)
|
|
949
|
+
// Per-thread: Q_q + KQ + mask + VKQ32 + V32 + K_f32 + padding
|
|
950
|
+
size_t prefill = sizeof(float) *
|
|
951
|
+
(GGML_FA_TILE_Q * DK + 2 * GGML_FA_TILE_Q * GGML_FA_TILE_KV + GGML_FA_TILE_Q * DV +
|
|
952
|
+
GGML_FA_TILE_KV * DV + GGML_FA_TILE_KV * DK) *
|
|
953
|
+
n_tasks;
|
|
954
|
+
|
|
955
|
+
// Decode path: n_kv_chunks = n_tasks (one chunk per thread)
|
|
956
|
+
// Per-thread: VKQ accmulator (DV), partial M, partial S + intra-thread scratch for V, Q and VKQ
|
|
957
|
+
size_t n_chunks = n_tasks;
|
|
958
|
+
size_t decode = sizeof(float) * (neq2 * n_chunks * (2 + DV) + n_tasks * (DK + 2 * DV));
|
|
959
|
+
|
|
960
|
+
size = MAX(prefill, decode);
|
|
961
|
+
}
|
|
962
|
+
return true;
|
|
963
|
+
default:
|
|
964
|
+
break;
|
|
965
|
+
}
|
|
966
|
+
return false;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
bool compute_forward(ggml_compute_params * params, ggml_tensor * op) override {
|
|
970
|
+
switch (op->op) {
|
|
971
|
+
case GGML_OP_NORM:
|
|
972
|
+
switch (op->src[0]->type) {
|
|
973
|
+
case GGML_TYPE_F32:
|
|
974
|
+
spacemit_kernels::rvv::forward_norm_f32(params, op);
|
|
975
|
+
return true;
|
|
976
|
+
default:
|
|
977
|
+
GGML_ABORT("fatal error");
|
|
978
|
+
}
|
|
979
|
+
case GGML_OP_RMS_NORM:
|
|
980
|
+
switch (op->src[0]->type) {
|
|
981
|
+
case GGML_TYPE_F32:
|
|
982
|
+
spacemit_kernels::rvv::forward_rms_norm_f32(params, op);
|
|
983
|
+
return true;
|
|
984
|
+
default:
|
|
985
|
+
GGML_ABORT("fatal error");
|
|
986
|
+
}
|
|
987
|
+
case GGML_OP_ADD:
|
|
988
|
+
switch (op->src[0]->type) {
|
|
989
|
+
case GGML_TYPE_F32:
|
|
990
|
+
spacemit_kernels::rvv::forward_binary<GGML_OP_ADD, float>(params, op);
|
|
991
|
+
return true;
|
|
992
|
+
case GGML_TYPE_F16:
|
|
993
|
+
spacemit_kernels::rvv::forward_binary<GGML_OP_ADD, _Float16>(params, op);
|
|
994
|
+
return true;
|
|
995
|
+
default:
|
|
996
|
+
ggml_compute_forward_add(params, op);
|
|
997
|
+
return true;
|
|
998
|
+
}
|
|
999
|
+
case GGML_OP_SUB:
|
|
1000
|
+
switch (op->src[0]->type) {
|
|
1001
|
+
case GGML_TYPE_F32:
|
|
1002
|
+
spacemit_kernels::rvv::forward_binary<GGML_OP_SUB, float>(params, op);
|
|
1003
|
+
return true;
|
|
1004
|
+
case GGML_TYPE_F16:
|
|
1005
|
+
spacemit_kernels::rvv::forward_binary<GGML_OP_SUB, _Float16>(params, op);
|
|
1006
|
+
return true;
|
|
1007
|
+
default:
|
|
1008
|
+
ggml_compute_forward_sub(params, op);
|
|
1009
|
+
return true;
|
|
1010
|
+
}
|
|
1011
|
+
case GGML_OP_MUL:
|
|
1012
|
+
switch (op->src[0]->type) {
|
|
1013
|
+
case GGML_TYPE_F32:
|
|
1014
|
+
spacemit_kernels::rvv::forward_binary<GGML_OP_MUL, float>(params, op);
|
|
1015
|
+
return true;
|
|
1016
|
+
case GGML_TYPE_F16:
|
|
1017
|
+
spacemit_kernels::rvv::forward_binary<GGML_OP_MUL, _Float16>(params, op);
|
|
1018
|
+
return true;
|
|
1019
|
+
default:
|
|
1020
|
+
ggml_compute_forward_mul(params, op);
|
|
1021
|
+
return true;
|
|
1022
|
+
}
|
|
1023
|
+
case GGML_OP_DIV:
|
|
1024
|
+
switch (op->src[0]->type) {
|
|
1025
|
+
case GGML_TYPE_F32:
|
|
1026
|
+
spacemit_kernels::rvv::forward_binary<GGML_OP_DIV, float>(params, op);
|
|
1027
|
+
return true;
|
|
1028
|
+
case GGML_TYPE_F16:
|
|
1029
|
+
spacemit_kernels::rvv::forward_binary<GGML_OP_DIV, _Float16>(params, op);
|
|
1030
|
+
return true;
|
|
1031
|
+
default:
|
|
1032
|
+
ggml_compute_forward_div(params, op);
|
|
1033
|
+
return true;
|
|
1034
|
+
}
|
|
1035
|
+
case GGML_OP_FLASH_ATTN_EXT:
|
|
1036
|
+
forward_flash_attn_ext_f16(params, op);
|
|
1037
|
+
return true;
|
|
1038
|
+
case GGML_OP_CONT:
|
|
1039
|
+
{
|
|
1040
|
+
const ggml_tensor * src0 = op->src[0];
|
|
1041
|
+
if (op->type == src0->type && op->nb[0] != src0->nb[0] && op->nb[0] == src0->nb[1] &&
|
|
1042
|
+
op->ne[3] * op->ne[2] * op->nb[2] == src0->ne[3] * src0->ne[2] * src0->nb[2]) {
|
|
1043
|
+
spacemit_kernels::rvv::forward_cont_with_permute(params, op);
|
|
1044
|
+
} else {
|
|
1045
|
+
ggml_compute_forward_cont(params, op);
|
|
1046
|
+
}
|
|
1047
|
+
return true;
|
|
1048
|
+
}
|
|
1049
|
+
case GGML_OP_CPY:
|
|
1050
|
+
{
|
|
1051
|
+
const ggml_tensor * src0 = op->src[0];
|
|
1052
|
+
if (op->type == src0->type && op->nb[0] == src0->nb[1] && src0->nb[0] != src0->nb[1] &&
|
|
1053
|
+
ggml_nelements(src0) == ggml_nelements(op)) {
|
|
1054
|
+
spacemit_kernels::rvv::forward_cpy_with_permute(params, op);
|
|
1055
|
+
} else {
|
|
1056
|
+
ggml_compute_forward_cpy(params, op);
|
|
1057
|
+
}
|
|
1058
|
+
return true;
|
|
1059
|
+
}
|
|
1060
|
+
case GGML_OP_REPEAT:
|
|
1061
|
+
{
|
|
1062
|
+
const bool rows_equal = ggml_nrows(op->src[0]) == ggml_nrows(op);
|
|
1063
|
+
const bool broadcast_or_equal = op->src[0]->ne[0] == 1 || op->src[0]->ne[0] == op->ne[0];
|
|
1064
|
+
|
|
1065
|
+
if (rows_equal && broadcast_or_equal) {
|
|
1066
|
+
switch (op->src[0]->type) {
|
|
1067
|
+
case GGML_TYPE_F32:
|
|
1068
|
+
spacemit_kernels::rvv::forward_repeat_nrows<int32_t>(params, op);
|
|
1069
|
+
return true;
|
|
1070
|
+
case GGML_TYPE_F16:
|
|
1071
|
+
spacemit_kernels::rvv::forward_repeat_nrows<int16_t>(params, op);
|
|
1072
|
+
return true;
|
|
1073
|
+
default:
|
|
1074
|
+
break;
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
if (op->src[0]->ne[1] == 1 && op->src[0]->ne[0] == op->ne[0]) {
|
|
1079
|
+
switch (op->src[0]->type) {
|
|
1080
|
+
case GGML_TYPE_F32:
|
|
1081
|
+
spacemit_kernels::rvv::forward_repeat_dim1<int32_t>(params, op);
|
|
1082
|
+
return true;
|
|
1083
|
+
case GGML_TYPE_F16:
|
|
1084
|
+
spacemit_kernels::rvv::forward_repeat_dim1<int16_t>(params, op);
|
|
1085
|
+
return true;
|
|
1086
|
+
default:
|
|
1087
|
+
break;
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
ggml_compute_forward_repeat(params, op);
|
|
1092
|
+
}
|
|
1093
|
+
return true;
|
|
1094
|
+
case GGML_OP_SUM_ROWS:
|
|
1095
|
+
{
|
|
1096
|
+
if (op->src[0]->type == GGML_TYPE_F32 && op->type == GGML_TYPE_F32) {
|
|
1097
|
+
spacemit_kernels::rvv::forward_sum_rows<float>(params, op);
|
|
1098
|
+
} else {
|
|
1099
|
+
ggml_compute_forward_sum_rows(params, op);
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
return true;
|
|
1103
|
+
case GGML_OP_GET_ROWS:
|
|
1104
|
+
{
|
|
1105
|
+
if (op->src[0]->type == op->type) {
|
|
1106
|
+
switch (op->src[0]->type) {
|
|
1107
|
+
case GGML_TYPE_F32:
|
|
1108
|
+
spacemit_kernels::rvv::forward_get_rows<int32_t>(params, op);
|
|
1109
|
+
return true;
|
|
1110
|
+
case GGML_TYPE_F16:
|
|
1111
|
+
spacemit_kernels::rvv::forward_get_rows<int16_t>(params, op);
|
|
1112
|
+
return true;
|
|
1113
|
+
default:
|
|
1114
|
+
break;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
ggml_compute_forward_get_rows(params, op);
|
|
1119
|
+
}
|
|
1120
|
+
return true;
|
|
1121
|
+
case GGML_OP_CONCAT:
|
|
1122
|
+
{
|
|
1123
|
+
const int32_t dim = ggml_get_op_params_i32(op, 0);
|
|
1124
|
+
if (dim == 0 && op->type == op->src[0]->type) {
|
|
1125
|
+
switch (op->src[0]->type) {
|
|
1126
|
+
case GGML_TYPE_F32:
|
|
1127
|
+
spacemit_kernels::rvv::forward_concat<int32_t>(params, op);
|
|
1128
|
+
return true;
|
|
1129
|
+
case GGML_TYPE_F16:
|
|
1130
|
+
spacemit_kernels::rvv::forward_concat<int16_t>(params, op);
|
|
1131
|
+
return true;
|
|
1132
|
+
default:
|
|
1133
|
+
break;
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
ggml_compute_forward_concat(params, op);
|
|
1138
|
+
}
|
|
1139
|
+
return true;
|
|
1140
|
+
// TODO For GGML_OP_GATED_DELTA_NET
|
|
1141
|
+
// case GGML_OP_GATED_DELTA_NET:
|
|
1142
|
+
// return true;
|
|
1143
|
+
default:
|
|
1144
|
+
break;
|
|
1145
|
+
}
|
|
1146
|
+
return false;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
void forward_flash_attn_ext_f16(const ggml_compute_params * params, ggml_tensor * dst) {
|
|
1150
|
+
const ggml_tensor * q = dst->src[0];
|
|
1151
|
+
const ggml_tensor * k = dst->src[1];
|
|
1152
|
+
const ggml_tensor * v = dst->src[2];
|
|
1153
|
+
|
|
1154
|
+
GGML_TENSOR_LOCALS(int64_t, neq, q, ne)
|
|
1155
|
+
GGML_TENSOR_LOCALS(size_t, nbq, q, nb)
|
|
1156
|
+
GGML_TENSOR_LOCALS(int64_t, nek, k, ne)
|
|
1157
|
+
GGML_TENSOR_LOCALS(size_t, nbk, k, nb)
|
|
1158
|
+
GGML_TENSOR_LOCALS(int64_t, nev, v, ne)
|
|
1159
|
+
GGML_TENSOR_LOCALS(size_t, nbv, v, nb)
|
|
1160
|
+
GGML_TENSOR_LOCALS(int64_t, ne, dst, ne)
|
|
1161
|
+
GGML_TENSOR_LOCALS(size_t, nb, dst, nb)
|
|
1162
|
+
|
|
1163
|
+
const int64_t DK = nek0;
|
|
1164
|
+
const int64_t DV = nev0;
|
|
1165
|
+
|
|
1166
|
+
const bool supported_prec = (dst->op_params[3] == GGML_PREC_F32 || dst->op_params[3] == GGML_PREC_DEFAULT);
|
|
1167
|
+
const bool supported_types = (q->type == GGML_TYPE_F32 && k->type == GGML_TYPE_F16 && v->type == GGML_TYPE_F16);
|
|
1168
|
+
const bool supported_shape = (DK > 0 && DK <= 128 && DV > 0 && DV <= 128);
|
|
1169
|
+
const bool supported_vlen = (__riscv_vlenb() == 128);
|
|
1170
|
+
|
|
1171
|
+
if (!(supported_prec && supported_types && supported_shape && supported_vlen)) {
|
|
1172
|
+
ggml_compute_forward_flash_attn_ext(params, dst);
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
// total rows in q
|
|
1177
|
+
const int64_t nr = neq1 * neq2 * neq3;
|
|
1178
|
+
|
|
1179
|
+
// rows per thread
|
|
1180
|
+
const int ith = params->ith;
|
|
1181
|
+
const int nth = params->nth;
|
|
1182
|
+
|
|
1183
|
+
static constexpr int64_t Q_TILE_SZ = ggml_fa_tile_config::Q;
|
|
1184
|
+
const bool use_tiled = !params->use_ref && (neq1 >= Q_TILE_SZ);
|
|
1185
|
+
|
|
1186
|
+
// 4x chunks per thread
|
|
1187
|
+
// int nth_scaled = nth * 4;
|
|
1188
|
+
// int64_t chunk_size = (nr + nth_scaled - 1) / nth_scaled;
|
|
1189
|
+
// int64_t nchunk = (nr + chunk_size - 1) / chunk_size;
|
|
1190
|
+
|
|
1191
|
+
// if (nth == 1 || nchunk < nth) {
|
|
1192
|
+
// nchunk = nth;
|
|
1193
|
+
// }
|
|
1194
|
+
|
|
1195
|
+
int64_t nchunk = nth;
|
|
1196
|
+
|
|
1197
|
+
if (ith == 0) {
|
|
1198
|
+
// Every thread starts at ith, so the first unprocessed chunk is nth. This save a bit of coordination right at the start.
|
|
1199
|
+
ggml_threadpool_chunk_set(params->threadpool, nth);
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
ggml_barrier(params->threadpool);
|
|
1203
|
+
|
|
1204
|
+
// The number of elements in each chunk
|
|
1205
|
+
const int64_t dr = (nr + nchunk - 1) / nchunk;
|
|
1206
|
+
|
|
1207
|
+
// The first chunk comes from our thread_id, the rest will get auto-assigned.
|
|
1208
|
+
int current_chunk = ith;
|
|
1209
|
+
|
|
1210
|
+
while (current_chunk < nchunk) {
|
|
1211
|
+
const int64_t ir0 = dr * current_chunk;
|
|
1212
|
+
const int64_t ir1 = MIN(ir0 + dr, nr);
|
|
1213
|
+
|
|
1214
|
+
if (use_tiled) {
|
|
1215
|
+
spacemit_kernels::rvv::forward_flash_attn_ext_f16_tiled_vlen1024_vf16(
|
|
1216
|
+
params, dst, ir0, ir1, ggml::cpu::riscv64_spacemit::tls_context.tcm_buffer,
|
|
1217
|
+
ggml::cpu::riscv64_spacemit::tls_context.tcm_buffer_size);
|
|
1218
|
+
} else {
|
|
1219
|
+
spacemit_kernels::rvv::forward_flash_attn_ext_f16_one_chunk_vlen1024_vf16(
|
|
1220
|
+
params, dst, ir0, ir1, ggml::cpu::riscv64_spacemit::tls_context.tcm_buffer,
|
|
1221
|
+
ggml::cpu::riscv64_spacemit::tls_context.tcm_buffer_size);
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
current_chunk = ggml_threadpool_chunk_add(params->threadpool, 1);
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
int repack(ggml_tensor * t, const void * data, size_t data_size) override {
|
|
1229
|
+
memcpy(t->data, data, data_size);
|
|
1230
|
+
return 0;
|
|
1231
|
+
}
|
|
1232
|
+
};
|
|
1233
|
+
|
|
1234
|
+
// Impl By IME1
|
|
1235
|
+
static const tensor_traits<block_q4_0, 32, 16> q4_0_16x32_q8_0;
|
|
1236
|
+
static const tensor_traits<block_q4_1, 32, 16> q4_1_16x32_q8_0;
|
|
1237
|
+
static const tensor_traits<block_q4_K, 32, 16> q4_k_16x32_q8_0;
|
|
1238
|
+
// Impl By IME2
|
|
1239
|
+
static const tensor_traits<block_q2_K, 256, 32> q2_k_32x256_q8_0;
|
|
1240
|
+
static const tensor_traits<block_q3_K, 256, 32> q3_k_32x256_q8_0;
|
|
1241
|
+
static const tensor_traits<block_q4_0, 32, 32> q4_0_32x32_q8_0;
|
|
1242
|
+
static const tensor_traits<block_q4_1, 32, 32> q4_1_32x32_q8_0;
|
|
1243
|
+
static const tensor_traits<block_q4_0, 256, 32> q4_0_32x256_q8_0;
|
|
1244
|
+
static const tensor_traits<block_q4_1, 256, 32> q4_1_32x256_q8_0;
|
|
1245
|
+
static const tensor_traits<block_q4_K, 32, 32> q4_k_32x32_q8_0;
|
|
1246
|
+
static const tensor_traits<block_q6_K, 32, 32> q6_k_32x32_q8_0;
|
|
1247
|
+
static const tensor_traits<block_q8_0, 32, 32> q8_0_32x32_q8_0;
|
|
1248
|
+
static const tensor_traits<block_mxfp4, 32, 32> mxfp4_32x32_q8_0;
|
|
1249
|
+
static const tensor_traits<block_q5_K, 32, 32> q5_k_32x32_q8_0;
|
|
1250
|
+
static const tensor_traits<block_q5_1, 32, 32> q5_1_32x32_q8_0;
|
|
1251
|
+
static const tensor_traits<block_q5_0, 32, 32> q5_0_32x32_q8_0;
|
|
1252
|
+
// Impl By RVV
|
|
1253
|
+
static const tensor_traits_common rvv_impl;
|
|
1254
|
+
|
|
1255
|
+
} // namespace ggml::cpu::riscv64_spacemit
|
|
1256
|
+
|
|
1257
|
+
static const ggml::cpu::tensor_traits * ggml_riscv64_spacemit_get_optimal_repack_type(const ggml_tensor * cur) {
|
|
1258
|
+
switch (cur->type) {
|
|
1259
|
+
case GGML_TYPE_Q2_K:
|
|
1260
|
+
{
|
|
1261
|
+
#if defined(RISCV64_SPACEMIT_IME2)
|
|
1262
|
+
if (cur->ne[1] % 32 == 0 && (ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime2)) {
|
|
1263
|
+
return &ggml::cpu::riscv64_spacemit::q2_k_32x256_q8_0;
|
|
1264
|
+
}
|
|
1265
|
+
#endif
|
|
1266
|
+
}
|
|
1267
|
+
break;
|
|
1268
|
+
case GGML_TYPE_Q3_K:
|
|
1269
|
+
{
|
|
1270
|
+
#if defined(RISCV64_SPACEMIT_IME2)
|
|
1271
|
+
if (cur->ne[1] % 32 == 0 && (ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime2)) {
|
|
1272
|
+
return &ggml::cpu::riscv64_spacemit::q3_k_32x256_q8_0;
|
|
1273
|
+
}
|
|
1274
|
+
#endif
|
|
1275
|
+
}
|
|
1276
|
+
break;
|
|
1277
|
+
case GGML_TYPE_Q4_0:
|
|
1278
|
+
{
|
|
1279
|
+
#if defined(RISCV64_SPACEMIT_IME2)
|
|
1280
|
+
if (cur->ne[1] % 32 == 0 && cur->ne[0] % 256 == 0 &&
|
|
1281
|
+
(ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime2)) {
|
|
1282
|
+
return &ggml::cpu::riscv64_spacemit::q4_0_32x256_q8_0;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
if (cur->ne[1] % 32 == 0 && (ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime2)) {
|
|
1286
|
+
return &ggml::cpu::riscv64_spacemit::q4_0_32x32_q8_0;
|
|
1287
|
+
}
|
|
1288
|
+
#endif
|
|
1289
|
+
|
|
1290
|
+
#if defined(RISCV64_SPACEMIT_IME1)
|
|
1291
|
+
if (cur->ne[1] % 16 == 0 && (ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime1)) {
|
|
1292
|
+
return &ggml::cpu::riscv64_spacemit::q4_0_16x32_q8_0;
|
|
1293
|
+
}
|
|
1294
|
+
#endif
|
|
1295
|
+
}
|
|
1296
|
+
break;
|
|
1297
|
+
case GGML_TYPE_Q4_1:
|
|
1298
|
+
{
|
|
1299
|
+
#if defined(RISCV64_SPACEMIT_IME2)
|
|
1300
|
+
// TODO
|
|
1301
|
+
// if (cur->ne[1] % 32 == 0 && cur->ne[0] % 256 == 0 &&
|
|
1302
|
+
// (ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime2)) {
|
|
1303
|
+
// return &ggml::cpu::riscv64_spacemit::q4_1_32x256_q8_0;
|
|
1304
|
+
// }
|
|
1305
|
+
|
|
1306
|
+
if (cur->ne[1] % 32 == 0 && (ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime2)) {
|
|
1307
|
+
return &ggml::cpu::riscv64_spacemit::q4_1_32x32_q8_0;
|
|
1308
|
+
}
|
|
1309
|
+
#endif
|
|
1310
|
+
|
|
1311
|
+
#if defined(RISCV64_SPACEMIT_IME1)
|
|
1312
|
+
if (cur->ne[1] % 16 == 0 && (ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime1)) {
|
|
1313
|
+
return &ggml::cpu::riscv64_spacemit::q4_1_16x32_q8_0;
|
|
1314
|
+
}
|
|
1315
|
+
#endif
|
|
1316
|
+
}
|
|
1317
|
+
break;
|
|
1318
|
+
case GGML_TYPE_Q4_K:
|
|
1319
|
+
{
|
|
1320
|
+
#if defined(RISCV64_SPACEMIT_IME2)
|
|
1321
|
+
if (cur->ne[1] % 32 == 0 && (ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime2)) {
|
|
1322
|
+
return &ggml::cpu::riscv64_spacemit::q4_k_32x32_q8_0;
|
|
1323
|
+
}
|
|
1324
|
+
#endif
|
|
1325
|
+
|
|
1326
|
+
#if defined(RISCV64_SPACEMIT_IME1)
|
|
1327
|
+
if (cur->ne[1] % 16 == 0 && (ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime1)) {
|
|
1328
|
+
return &ggml::cpu::riscv64_spacemit::q4_k_16x32_q8_0;
|
|
1329
|
+
}
|
|
1330
|
+
#endif
|
|
1331
|
+
}
|
|
1332
|
+
break;
|
|
1333
|
+
case GGML_TYPE_Q6_K:
|
|
1334
|
+
{
|
|
1335
|
+
#if defined(RISCV64_SPACEMIT_IME2)
|
|
1336
|
+
if ((ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime2)) {
|
|
1337
|
+
return &ggml::cpu::riscv64_spacemit::q6_k_32x32_q8_0;
|
|
1338
|
+
}
|
|
1339
|
+
#endif
|
|
1340
|
+
}
|
|
1341
|
+
break;
|
|
1342
|
+
case GGML_TYPE_Q8_0:
|
|
1343
|
+
{
|
|
1344
|
+
#if defined(RISCV64_SPACEMIT_IME2)
|
|
1345
|
+
if ((ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime2)) {
|
|
1346
|
+
return &ggml::cpu::riscv64_spacemit::q8_0_32x32_q8_0;
|
|
1347
|
+
}
|
|
1348
|
+
#endif
|
|
1349
|
+
}
|
|
1350
|
+
break;
|
|
1351
|
+
case GGML_TYPE_MXFP4:
|
|
1352
|
+
{
|
|
1353
|
+
#if defined(RISCV64_SPACEMIT_IME2)
|
|
1354
|
+
// TODO
|
|
1355
|
+
// if (cur->ne[1] % 32 == 0 && (ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime2)) {
|
|
1356
|
+
// return &ggml::cpu::riscv64_spacemit::mxfp4_32x32_q8_0;
|
|
1357
|
+
// }
|
|
1358
|
+
#endif
|
|
1359
|
+
}
|
|
1360
|
+
break;
|
|
1361
|
+
case GGML_TYPE_Q5_K:
|
|
1362
|
+
{
|
|
1363
|
+
#if defined(RISCV64_SPACEMIT_IME2)
|
|
1364
|
+
if (cur->ne[1] % 32 == 0 && (ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime2)) {
|
|
1365
|
+
return &ggml::cpu::riscv64_spacemit::q5_k_32x32_q8_0;
|
|
1366
|
+
}
|
|
1367
|
+
#endif
|
|
1368
|
+
}
|
|
1369
|
+
break;
|
|
1370
|
+
case GGML_TYPE_Q5_1:
|
|
1371
|
+
{
|
|
1372
|
+
#if defined(RISCV64_SPACEMIT_IME2)
|
|
1373
|
+
if (cur->ne[1] % 32 == 0 && (ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime2)) {
|
|
1374
|
+
return &ggml::cpu::riscv64_spacemit::q5_1_32x32_q8_0;
|
|
1375
|
+
}
|
|
1376
|
+
#endif
|
|
1377
|
+
}
|
|
1378
|
+
break;
|
|
1379
|
+
case GGML_TYPE_Q5_0:
|
|
1380
|
+
{
|
|
1381
|
+
#if defined(RISCV64_SPACEMIT_IME2)
|
|
1382
|
+
if (cur->ne[1] % 32 == 0 && (ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime2)) {
|
|
1383
|
+
return &ggml::cpu::riscv64_spacemit::q5_0_32x32_q8_0;
|
|
1384
|
+
}
|
|
1385
|
+
#endif
|
|
1386
|
+
}
|
|
1387
|
+
break;
|
|
1388
|
+
default:
|
|
1389
|
+
break;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
return nullptr;
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
static enum ggml_status ggml_backend_riscv64_spacemit_buffer_init_tensor(ggml_backend_buffer_t buffer,
|
|
1396
|
+
ggml_tensor * tensor) {
|
|
1397
|
+
tensor->extra =
|
|
1398
|
+
(void *) const_cast<ggml::cpu::tensor_traits *>(ggml_riscv64_spacemit_get_optimal_repack_type(tensor));
|
|
1399
|
+
|
|
1400
|
+
GGML_UNUSED(buffer);
|
|
1401
|
+
|
|
1402
|
+
return GGML_STATUS_SUCCESS;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
static void ggml_backend_riscv64_spacemit_buffer_free_buffer(ggml_backend_buffer_t buffer) {
|
|
1406
|
+
GGML_ASSERT(buffer);
|
|
1407
|
+
|
|
1408
|
+
void * base = buffer->context;
|
|
1409
|
+
if (base == nullptr) {
|
|
1410
|
+
return;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
ggml::cpu::riscv64_spacemit::spine_mem_pool_free(base);
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
static void * ggml_backend_riscv64_spacemit_buffer_get_base(ggml_backend_buffer_t buffer) {
|
|
1417
|
+
GGML_ASSERT(buffer);
|
|
1418
|
+
|
|
1419
|
+
void * base = buffer->context;
|
|
1420
|
+
GGML_ASSERT(base != nullptr);
|
|
1421
|
+
return base;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
static void ggml_backend_riscv64_spacemit_buffer_memset_tensor(ggml_backend_buffer_t buffer,
|
|
1425
|
+
ggml_tensor * tensor,
|
|
1426
|
+
uint8_t value,
|
|
1427
|
+
size_t offset,
|
|
1428
|
+
size_t size) {
|
|
1429
|
+
GGML_ASSERT(tensor);
|
|
1430
|
+
memset((char *) tensor->data + offset, value, size);
|
|
1431
|
+
|
|
1432
|
+
GGML_UNUSED(buffer);
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
static void ggml_backend_riscv64_spacemit_buffer_clear(ggml_backend_buffer_t buffer, uint8_t value) {
|
|
1436
|
+
GGML_ASSERT(buffer);
|
|
1437
|
+
|
|
1438
|
+
void * base = buffer->context;
|
|
1439
|
+
GGML_ASSERT(base != nullptr);
|
|
1440
|
+
memset(base, value, buffer->size);
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
static void ggml_backend_riscv64_spacemit_buffer_set_tensor(ggml_backend_buffer_t buffer,
|
|
1444
|
+
ggml_tensor * tensor,
|
|
1445
|
+
const void * data,
|
|
1446
|
+
size_t offset,
|
|
1447
|
+
size_t size) {
|
|
1448
|
+
GGML_ASSERT(offset == 0);
|
|
1449
|
+
GGML_ASSERT(size == ggml_nbytes(tensor));
|
|
1450
|
+
|
|
1451
|
+
auto tensor_traits = (ggml::cpu::riscv64_spacemit::tensor_traits_base *) tensor->extra;
|
|
1452
|
+
if (tensor_traits) {
|
|
1453
|
+
auto OK = tensor_traits->repack(tensor, data, size);
|
|
1454
|
+
GGML_ASSERT(OK == 0);
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
GGML_UNUSED(buffer);
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
static const ggml_backend_buffer_i ggml_backend_riscv64_spacemit_buffer_i = {
|
|
1461
|
+
/* .free_buffer = */ ggml_backend_riscv64_spacemit_buffer_free_buffer,
|
|
1462
|
+
/* .get_base = */ ggml_backend_riscv64_spacemit_buffer_get_base,
|
|
1463
|
+
/* .init_tensor = */ ggml_backend_riscv64_spacemit_buffer_init_tensor,
|
|
1464
|
+
/* .memset_tensor = */ ggml_backend_riscv64_spacemit_buffer_memset_tensor,
|
|
1465
|
+
/* .set_tensor = */ ggml_backend_riscv64_spacemit_buffer_set_tensor,
|
|
1466
|
+
/* .get_tensor = */ nullptr,
|
|
1467
|
+
/* .set_tensor_2d = */ nullptr,
|
|
1468
|
+
/* .get_tensor_2d = */ nullptr,
|
|
1469
|
+
/* .cpy_tensor = */ nullptr,
|
|
1470
|
+
/* .clear = */ ggml_backend_riscv64_spacemit_buffer_clear,
|
|
1471
|
+
/* .reset = */ nullptr,
|
|
1472
|
+
};
|
|
1473
|
+
|
|
1474
|
+
static const char * ggml_backend_cpu_riscv64_spacemit_buffer_type_get_name(ggml_backend_buffer_type_t buft) {
|
|
1475
|
+
return "CPU_RISCV64_SPACEMIT";
|
|
1476
|
+
|
|
1477
|
+
GGML_UNUSED(buft);
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
static ggml_backend_buffer_t ggml_backend_cpu_riscv64_spacemit_buffer_type_alloc_buffer(ggml_backend_buffer_type_t buft,
|
|
1481
|
+
size_t size) {
|
|
1482
|
+
void * base = ggml::cpu::riscv64_spacemit::spine_mem_pool_alloc(size, 64);
|
|
1483
|
+
if (base == nullptr) {
|
|
1484
|
+
return nullptr;
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
return ggml_backend_buffer_init(buft, ggml_backend_riscv64_spacemit_buffer_i, base, size);
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
static size_t ggml_backend_cpu_riscv64_spacemit_buffer_type_get_alignment(ggml_backend_buffer_type_t buft) {
|
|
1491
|
+
return 64;
|
|
1492
|
+
|
|
1493
|
+
GGML_UNUSED(buft);
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
static size_t ggml_backend_cpu_riscv64_spacemit_nbytes(ggml_backend_buffer_type_t buft, const ggml_tensor * tensor) {
|
|
1497
|
+
for (int i = 0; i < GGML_MAX_DIMS; ++i) {
|
|
1498
|
+
if (tensor->ne[i] <= 0) {
|
|
1499
|
+
return 0;
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
GGML_UNUSED(buft);
|
|
1504
|
+
|
|
1505
|
+
const auto plain_nbytes = [&]() {
|
|
1506
|
+
size_t total = ggml_type_size(tensor->type);
|
|
1507
|
+
for (int i = 0; i < GGML_MAX_DIMS; ++i) {
|
|
1508
|
+
total += (tensor->ne[i] - 1) * tensor->nb[i];
|
|
1509
|
+
}
|
|
1510
|
+
return total;
|
|
1511
|
+
};
|
|
1512
|
+
|
|
1513
|
+
const size_t blck_size = ggml_blck_size(tensor->type);
|
|
1514
|
+
if (blck_size == 1) {
|
|
1515
|
+
return plain_nbytes();
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
const size_t row_nbytes = tensor->ne[0] * tensor->nb[0] / blck_size;
|
|
1519
|
+
|
|
1520
|
+
const auto add_strided_nbytes = [&](size_t total, size_t src_block_size, size_t dst_block_size) {
|
|
1521
|
+
for (int i = 1; i < GGML_MAX_DIMS; ++i) {
|
|
1522
|
+
total += (tensor->ne[i] - 1) * (tensor->nb[i] / src_block_size) * dst_block_size;
|
|
1523
|
+
}
|
|
1524
|
+
return total;
|
|
1525
|
+
};
|
|
1526
|
+
|
|
1527
|
+
const auto remap_block_nbytes = [&](size_t src_block_size, size_t dst_block_size, int64_t padded_rows = 0) {
|
|
1528
|
+
GGML_ASSERT(row_nbytes % src_block_size == 0);
|
|
1529
|
+
|
|
1530
|
+
size_t total =
|
|
1531
|
+
add_strided_nbytes((row_nbytes / src_block_size) * dst_block_size, src_block_size, dst_block_size);
|
|
1532
|
+
|
|
1533
|
+
if (padded_rows > 0 && tensor->ne[1] % padded_rows != 0) {
|
|
1534
|
+
total += (padded_rows - tensor->ne[1] % padded_rows) * (tensor->nb[1] / src_block_size) * dst_block_size;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
return total;
|
|
1538
|
+
};
|
|
1539
|
+
|
|
1540
|
+
size_t nbytes = row_nbytes;
|
|
1541
|
+
switch (tensor->type) {
|
|
1542
|
+
case GGML_TYPE_Q4_K:
|
|
1543
|
+
nbytes = remap_block_nbytes(sizeof(block_q4_K), sizeof(block_q4_1) * 8);
|
|
1544
|
+
break;
|
|
1545
|
+
case GGML_TYPE_Q6_K:
|
|
1546
|
+
nbytes = remap_block_nbytes(sizeof(block_q6_K), sizeof(block_q8_0) * 8, 32);
|
|
1547
|
+
break;
|
|
1548
|
+
case GGML_TYPE_Q8_0:
|
|
1549
|
+
nbytes = remap_block_nbytes(sizeof(block_q8_0), sizeof(block_q8_0), 32);
|
|
1550
|
+
break;
|
|
1551
|
+
case GGML_TYPE_Q2_K:
|
|
1552
|
+
nbytes = remap_block_nbytes(sizeof(block_q2_K), sizeof(spacemit_kernels::nrow_block_q2_k<1>));
|
|
1553
|
+
break;
|
|
1554
|
+
case GGML_TYPE_Q3_K:
|
|
1555
|
+
nbytes = remap_block_nbytes(sizeof(block_q3_K), sizeof(spacemit_kernels::nrow_block_q3_k<1>));
|
|
1556
|
+
break;
|
|
1557
|
+
case GGML_TYPE_MXFP4:
|
|
1558
|
+
nbytes = remap_block_nbytes(sizeof(block_mxfp4), sizeof(spacemit_kernels::nrow_block_mxfp4<1>));
|
|
1559
|
+
break;
|
|
1560
|
+
case GGML_TYPE_Q5_K:
|
|
1561
|
+
nbytes = remap_block_nbytes(sizeof(block_q5_K), sizeof(spacemit_kernels::nrow_block_q5_1<1>) * 8);
|
|
1562
|
+
break;
|
|
1563
|
+
case GGML_TYPE_Q5_1:
|
|
1564
|
+
nbytes = remap_block_nbytes(sizeof(block_q5_1), sizeof(spacemit_kernels::nrow_block_q5_1<1>));
|
|
1565
|
+
break;
|
|
1566
|
+
case GGML_TYPE_Q5_0:
|
|
1567
|
+
nbytes = remap_block_nbytes(sizeof(block_q5_0), sizeof(spacemit_kernels::nrow_block_q5_0<1>));
|
|
1568
|
+
break;
|
|
1569
|
+
default:
|
|
1570
|
+
nbytes = add_strided_nbytes(row_nbytes, 1, 1);
|
|
1571
|
+
break;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
return nbytes;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
namespace ggml::cpu::riscv64_spacemit {
|
|
1578
|
+
|
|
1579
|
+
class extra_buffer_type : ggml::cpu::extra_buffer_type {
|
|
1580
|
+
bool supports_op(ggml_backend_dev_t, const ggml_tensor * op) override {
|
|
1581
|
+
switch (op->op) {
|
|
1582
|
+
case GGML_OP_MUL_MAT:
|
|
1583
|
+
if (op->src[0]->buffer && (ggml_n_dims(op->src[0]) == 2) &&
|
|
1584
|
+
op->src[0]->buffer->buft == ggml_backend_cpu_riscv64_spacemit_buffer_type() &&
|
|
1585
|
+
ggml_riscv64_spacemit_get_optimal_repack_type(op->src[0])) {
|
|
1586
|
+
if (op->src[1]->buffer && !ggml_backend_buft_is_host(op->src[1]->buffer->buft)) {
|
|
1587
|
+
return false;
|
|
1588
|
+
}
|
|
1589
|
+
if (op->src[1]->type == GGML_TYPE_F32) {
|
|
1590
|
+
return true;
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
break;
|
|
1594
|
+
case GGML_OP_MUL_MAT_ID:
|
|
1595
|
+
if (op->src[0]->buffer && (ggml_n_dims(op->src[0]) == 3) &&
|
|
1596
|
+
op->src[0]->buffer->buft == ggml_backend_cpu_riscv64_spacemit_buffer_type() &&
|
|
1597
|
+
ggml_riscv64_spacemit_get_optimal_repack_type(op->src[0])) {
|
|
1598
|
+
if (op->src[1]->buffer && !ggml_backend_buft_is_host(op->src[1]->buffer->buft)) {
|
|
1599
|
+
return false;
|
|
1600
|
+
}
|
|
1601
|
+
if (op->src[1]->type == GGML_TYPE_F32) {
|
|
1602
|
+
return true;
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
break;
|
|
1606
|
+
default:
|
|
1607
|
+
// GGML_ABORT("fatal error");
|
|
1608
|
+
break;
|
|
1609
|
+
}
|
|
1610
|
+
return false;
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
ggml::cpu::tensor_traits * get_tensor_traits(const ggml_tensor * op) override {
|
|
1614
|
+
switch (op->op) {
|
|
1615
|
+
case GGML_OP_MUL_MAT:
|
|
1616
|
+
case GGML_OP_MUL_MAT_ID:
|
|
1617
|
+
if (op->src[0]->buffer && op->src[0]->buffer->buft == ggml_backend_cpu_riscv64_spacemit_buffer_type()) {
|
|
1618
|
+
return (ggml::cpu::tensor_traits *) op->src[0]->extra;
|
|
1619
|
+
}
|
|
1620
|
+
break;
|
|
1621
|
+
case GGML_OP_NORM:
|
|
1622
|
+
case GGML_OP_RMS_NORM:
|
|
1623
|
+
case GGML_OP_ADD:
|
|
1624
|
+
case GGML_OP_SUB:
|
|
1625
|
+
case GGML_OP_MUL:
|
|
1626
|
+
case GGML_OP_DIV:
|
|
1627
|
+
case GGML_OP_FLASH_ATTN_EXT:
|
|
1628
|
+
case GGML_OP_CONT:
|
|
1629
|
+
case GGML_OP_CPY:
|
|
1630
|
+
case GGML_OP_REPEAT:
|
|
1631
|
+
case GGML_OP_SUM_ROWS:
|
|
1632
|
+
case GGML_OP_GET_ROWS:
|
|
1633
|
+
case GGML_OP_CONCAT:
|
|
1634
|
+
// case GGML_OP_GATED_DELTA_NET:
|
|
1635
|
+
return (ggml::cpu::tensor_traits *) (&ggml::cpu::riscv64_spacemit::rvv_impl);
|
|
1636
|
+
default:
|
|
1637
|
+
// GGML_ABORT("fatal error");
|
|
1638
|
+
break;
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
return nullptr;
|
|
1642
|
+
}
|
|
1643
|
+
};
|
|
1644
|
+
|
|
1645
|
+
} // namespace ggml::cpu::riscv64_spacemit
|
|
1646
|
+
|
|
1647
|
+
ggml_backend_buffer_type_t ggml_backend_cpu_riscv64_spacemit_buffer_type(void) {
|
|
1648
|
+
static ggml_backend_buffer_type ggml_backend_cpu_buffer_type_riscv64_spacemit = {
|
|
1649
|
+
/* .iface = */
|
|
1650
|
+
{
|
|
1651
|
+
/* .get_name = */ ggml_backend_cpu_riscv64_spacemit_buffer_type_get_name,
|
|
1652
|
+
/* .alloc_buffer = */ ggml_backend_cpu_riscv64_spacemit_buffer_type_alloc_buffer,
|
|
1653
|
+
/* .get_alignment = */ ggml_backend_cpu_riscv64_spacemit_buffer_type_get_alignment,
|
|
1654
|
+
/* .get_max_size = */ nullptr,
|
|
1655
|
+
/* .get_alloc_size = */ ggml_backend_cpu_riscv64_spacemit_nbytes,
|
|
1656
|
+
/* .is_host = */ nullptr,
|
|
1657
|
+
},
|
|
1658
|
+
/* .device = */
|
|
1659
|
+
ggml_backend_reg_dev_get(ggml_backend_cpu_reg(), 0),
|
|
1660
|
+
/* .context = */
|
|
1661
|
+
new ggml::cpu::riscv64_spacemit::extra_buffer_type(),
|
|
1662
|
+
};
|
|
1663
|
+
|
|
1664
|
+
return &ggml_backend_cpu_buffer_type_riscv64_spacemit;
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
extern "C" {
|
|
1668
|
+
static int bind_ai_thread() {
|
|
1669
|
+
int fd, bytes;
|
|
1670
|
+
char str[32];
|
|
1671
|
+
|
|
1672
|
+
fd = open("/proc/set_ai_thread", O_WRONLY);
|
|
1673
|
+
if (fd < 0) {
|
|
1674
|
+
GGML_LOG_ERROR("try open /proc/set_ai_thread failed\n");
|
|
1675
|
+
return -1;
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
snprintf(str, 16, "%d", 0);
|
|
1679
|
+
bytes = write(fd, str, strlen(str));
|
|
1680
|
+
if (bytes < 0) {
|
|
1681
|
+
GGML_LOG_ERROR("try write /proc/set_ai_thread failed\n");
|
|
1682
|
+
close(fd);
|
|
1683
|
+
return -1;
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
close(fd);
|
|
1687
|
+
return 0;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
void ggml_backend_cpu_riscv64_spacemit_set_numa_thread_affinity(int thread_n) {
|
|
1691
|
+
int cpu_id = sched_getcpu();
|
|
1692
|
+
if (ggml::cpu::riscv64_spacemit::global_spine_env_info.use_ime2 &&
|
|
1693
|
+
!((1 << cpu_id) & ggml::cpu::riscv64_spacemit::global_spine_env_info.cpu_mask)) {
|
|
1694
|
+
GGML_PRINT_DEBUG("bind_ai_thread for thread %d, pid %d\n", thread_n, getpid());
|
|
1695
|
+
bind_ai_thread();
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
if (ggml::cpu::riscv64_spacemit::global_spine_env_info.use_tcm &&
|
|
1699
|
+
ggml::cpu::riscv64_spacemit::tls_context.cpu_id == -1) {
|
|
1700
|
+
CPU_ZERO(&(ggml::cpu::riscv64_spacemit::tls_context.cpuset));
|
|
1701
|
+
pthread_t main_thread = pthread_self();
|
|
1702
|
+
const auto & perfer_core_ids = ggml::cpu::riscv64_spacemit::global_spine_env_info.perfer_core_ids;
|
|
1703
|
+
if (thread_n < 0 || static_cast<size_t>(thread_n) >= perfer_core_ids.size()) {
|
|
1704
|
+
GGML_ABORT("thread_n %d exceeds perfer_core_ids size %zu\n", thread_n, perfer_core_ids.size());
|
|
1705
|
+
}
|
|
1706
|
+
auto perfer_cpu_id = perfer_core_ids[static_cast<size_t>(thread_n)];
|
|
1707
|
+
CPU_SET(perfer_cpu_id, &(ggml::cpu::riscv64_spacemit::tls_context.cpuset));
|
|
1708
|
+
int s =
|
|
1709
|
+
pthread_setaffinity_np(main_thread, sizeof(cpu_set_t), &(ggml::cpu::riscv64_spacemit::tls_context.cpuset));
|
|
1710
|
+
if (s != 0) {
|
|
1711
|
+
GGML_ABORT("set thread affinity error for thread_n %d, cpu_id %d\n", thread_n, perfer_cpu_id);
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
int ai_cpu_id = perfer_cpu_id - ggml::cpu::riscv64_spacemit::global_spine_env_info.aicpu_id_offset;
|
|
1715
|
+
ggml::cpu::riscv64_spacemit::tls_context.cpu_id = ai_cpu_id;
|
|
1716
|
+
ggml::cpu::riscv64_spacemit::tls_context.tcm_buffer =
|
|
1717
|
+
ggml::cpu::riscv64_spacemit::spine_mem_pool_tcm_mem_get(ai_cpu_id);
|
|
1718
|
+
ggml::cpu::riscv64_spacemit::tls_context.tcm_buffer_size =
|
|
1719
|
+
ggml::cpu::riscv64_spacemit::global_spine_env_info.tcm_blk_size;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
if (ggml::cpu::riscv64_spacemit::tls_context.tcm_buffer != nullptr) {
|
|
1723
|
+
void * rt =
|
|
1724
|
+
ggml::cpu::riscv64_spacemit::spine_mem_pool_tcm_mem_wait(ggml::cpu::riscv64_spacemit::tls_context.cpu_id);
|
|
1725
|
+
if (rt == nullptr) {
|
|
1726
|
+
GGML_ABORT("wait tcm buffer failed for cpu_id: %d", ggml::cpu::riscv64_spacemit::tls_context.cpu_id);
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
void ggml_backend_cpu_riscv64_spacemit_clear_numa_thread_affinity_threaded(int thread_n) {
|
|
1732
|
+
if (ggml::cpu::riscv64_spacemit::tls_context.tcm_buffer != nullptr) {
|
|
1733
|
+
auto rt = ggml::cpu::riscv64_spacemit::spine_mem_pool_tcm_mem_release(
|
|
1734
|
+
ggml::cpu::riscv64_spacemit::tls_context.cpu_id);
|
|
1735
|
+
if (rt != 0) {
|
|
1736
|
+
GGML_ABORT("release tcm buffer failed for cpu_id: %d", ggml::cpu::riscv64_spacemit::tls_context.cpu_id);
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
}
|