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,1233 @@
|
|
|
1
|
+
# lib/toy/llm/engine/llama_seq_engine.rb — sequence-mode forward graph for the
|
|
2
|
+
# llama-family architecture (RMSNorm + SwiGLU + RoPE + GQA).
|
|
3
|
+
#
|
|
4
|
+
# Sibling of lib/toy_smollm2_ffi_kv.rb (KV-cache decode for single
|
|
5
|
+
# positions). This class builds ONE forward graph that processes T
|
|
6
|
+
# token positions in a single compute — the prerequisite for real SFT
|
|
7
|
+
# (F1.2 step 6c/6d) where masked CE across all T positions is the loss.
|
|
8
|
+
#
|
|
9
|
+
# Step 1 (this file): forward only, no LoRA, no training. Parity gate
|
|
10
|
+
# is T=1 vs SmolLM2KVFFICache#decode_step at pos=0; full-T parity smoke
|
|
11
|
+
# (T>1) follows in step 2.
|
|
12
|
+
#
|
|
13
|
+
# Spinel hygiene — see docs/design/m3-seq-forward-2026-05-21.md, risk #6:
|
|
14
|
+
# the M1 full-forward integration was blocked by ivar-type unification
|
|
15
|
+
# across cache classes (t_seq / d_model / d_ff fields colliding). To
|
|
16
|
+
# sidestep it cleanly, every dimension/parameter ivar here uses a
|
|
17
|
+
# `@seq_*` prefix. Verbose but type-isolated.
|
|
18
|
+
|
|
19
|
+
require_relative "../../models/transformer"
|
|
20
|
+
require_relative "../../../toy"
|
|
21
|
+
require_relative "../../models/toy_smollm2"
|
|
22
|
+
require_relative "../../ffi/tinynn"
|
|
23
|
+
require_relative "../primitives/rms_norm"
|
|
24
|
+
require_relative "../primitives/rope"
|
|
25
|
+
require_relative "../primitives/swiglu"
|
|
26
|
+
require_relative "../primitives/gqa"
|
|
27
|
+
require_relative "../blocks/transformer_block"
|
|
28
|
+
require_relative "../archs/llama_arch"
|
|
29
|
+
|
|
30
|
+
module Toy; module LLM; module Engine
|
|
31
|
+
class LlamaSeqEngine
|
|
32
|
+
attr_accessor :sess,
|
|
33
|
+
# P2.5 — the five arch-level persistent handles
|
|
34
|
+
# (t_seq_token_embed, t_seq_final_norm_gamma, t_seq_output,
|
|
35
|
+
# t_seq_w_proj) and the blocks array now LIVE on @seq_arch
|
|
36
|
+
# (Toy::LLM::Archs::LlamaArch). Cache delegators below
|
|
37
|
+
# preserve the public accessor surface so the realize
|
|
38
|
+
# paths, external PCA-init (fcache.t_seq_w_proj=), and the
|
|
39
|
+
# examples (fcache.t_seq_*) keep working by name.
|
|
40
|
+
:seq_arch,
|
|
41
|
+
:seq_has_untied_output, :seq_has_qkv_bias,
|
|
42
|
+
:seq_t, :seq_b, :seq_d_model, :seq_d_ff, :seq_n_heads, :seq_n_kv,
|
|
43
|
+
:seq_d_head, :seq_group_size, :seq_n_layers, :seq_vocab_size,
|
|
44
|
+
:seq_rope_base, :seq_rope_scaling, :t_seq_rope_freq_factors,
|
|
45
|
+
:seq_rms_eps, :seq_realized, :seq_weight_dtype,
|
|
46
|
+
:t_seq_token_ids, :t_seq_positions, :t_seq_attn_mask,
|
|
47
|
+
:t_seq_x_embed, :t_seq_x_final, :t_seq_logits,
|
|
48
|
+
:seq_gguf_handle_keepalive,
|
|
49
|
+
# M3 step 3 LoRA flags. Both must be set BEFORE
|
|
50
|
+
# realize_for_mmap. enable_lora_q!(r) allocates the
|
|
51
|
+
# adapter A/B pair per Q head; enable_lora_q_adamw!
|
|
52
|
+
# additionally allocates persistent Adam m/v alongside
|
|
53
|
+
# them (mirrors F1.2 step 6b).
|
|
54
|
+
:seq_lora_q_enabled, :seq_lora_q_rank,
|
|
55
|
+
:seq_lora_q_adamw_enabled,
|
|
56
|
+
# F3 full fine-tune. When set BEFORE
|
|
57
|
+
# realize_for_full_finetune, every per-block weight
|
|
58
|
+
# tensor is allocated writable F32 in ctx_w with paired
|
|
59
|
+
# Adam m/v and marked set_param; build_training_step
|
|
60
|
+
# then emits opt_step on each.
|
|
61
|
+
:seq_full_finetune_enabled,
|
|
62
|
+
# Per-cache (not per-block) parallel arrays for the
|
|
63
|
+
# global trainable weights — token_embed, final-norm
|
|
64
|
+
# gamma, optional untied output projection. Populated
|
|
65
|
+
# in realize_for_full_finetune; empty otherwise.
|
|
66
|
+
:ft_globals_weights, :ft_globals_m, :ft_globals_v,
|
|
67
|
+
# Opt-in: include the embedding / final-norm /
|
|
68
|
+
# untied-output tensors in full FT. Default off — the
|
|
69
|
+
# embed tensor on Qwen-class models is huge (V=152K ×
|
|
70
|
+
# d=1536 = 233M params F32) and brings the full
|
|
71
|
+
# forward+backward+opt-step memory closer to the GPU
|
|
72
|
+
# limit. Works correctly on CUDA after vendor-patches
|
|
73
|
+
# 0006 chunked the get_rows_back kernel launch
|
|
74
|
+
# (previously hit CUDA's gridDim.y = 65535 cap).
|
|
75
|
+
:ft_train_embeddings_enabled
|
|
76
|
+
|
|
77
|
+
# P2.5 — delegators forwarding the arch-owned handle accessors to
|
|
78
|
+
# @seq_arch (Toy::LLM::Archs::LlamaArch). These preserve the cache's
|
|
79
|
+
# former public attr_accessor surface (the realize paths assign via
|
|
80
|
+
# self.t_seq_token_embed=, external PCA-init writes fcache.t_seq_w_proj=,
|
|
81
|
+
# examples read fcache.t_seq_*). Single source of truth: the arch.
|
|
82
|
+
def t_seq_token_embed; @seq_arch.t_seq_token_embed; end
|
|
83
|
+
def t_seq_token_embed=(v); @seq_arch.t_seq_token_embed = v; end
|
|
84
|
+
def t_seq_final_norm_gamma; @seq_arch.t_seq_final_norm_gamma; end
|
|
85
|
+
def t_seq_final_norm_gamma=(v); @seq_arch.t_seq_final_norm_gamma = v; end
|
|
86
|
+
def t_seq_output; @seq_arch.t_seq_output; end
|
|
87
|
+
def t_seq_output=(v); @seq_arch.t_seq_output = v; end
|
|
88
|
+
def t_seq_w_proj; @seq_arch.t_seq_w_proj; end
|
|
89
|
+
def t_seq_w_proj=(v); @seq_arch.t_seq_w_proj = v; end
|
|
90
|
+
# E2.3 — projection-lens donor width (0 disables the lens). Plain
|
|
91
|
+
# ivar (NOT in the attr_accessor list); the GGUF-fold writer reads it
|
|
92
|
+
# to know the donor->d_model contraction dimension.
|
|
93
|
+
def seq_donor_d_in; @seq_donor_d_in; end
|
|
94
|
+
def seq_blocks_ffi; @seq_arch.seq_blocks_ffi; end
|
|
95
|
+
def seq_blocks_ffi=(v); @seq_arch.seq_blocks_ffi = v; end
|
|
96
|
+
|
|
97
|
+
def initialize
|
|
98
|
+
# P2.5 — the arch owns the arch-level persistent handles + the
|
|
99
|
+
# blocks array (seeded with one block in the arch ctor, matching the
|
|
100
|
+
# former cache seed). Constructed first so the delegators are live.
|
|
101
|
+
@seq_arch = Toy::LLM::Archs::LlamaArch.new
|
|
102
|
+
@seq_realized = false
|
|
103
|
+
@seq_t = 0
|
|
104
|
+
@seq_b = 1
|
|
105
|
+
# GH#9 — mixed-precision compute. 0 = F32 (current behaviour;
|
|
106
|
+
# bit-identical to pre-GH#9). 1 = F16, 30 = BF16. When != 0,
|
|
107
|
+
# weight matmuls inside build_seq_block / build_seq_qhead route
|
|
108
|
+
# through mp_matmul which casts the F32 master to the chosen
|
|
109
|
+
# dtype inline in the forward graph. F32 master is kept (required
|
|
110
|
+
# by opt_step_adamw); the cast result lives in transient scratch.
|
|
111
|
+
@seq_weight_dtype = 0
|
|
112
|
+
@seq_d_model = 0
|
|
113
|
+
@seq_d_ff = 0
|
|
114
|
+
@seq_n_heads = 0
|
|
115
|
+
@seq_n_kv = 0
|
|
116
|
+
@seq_d_head = 0
|
|
117
|
+
@seq_group_size = 0
|
|
118
|
+
@seq_n_layers = 0
|
|
119
|
+
@seq_vocab_size = 0
|
|
120
|
+
@seq_rope_base = 10000.0
|
|
121
|
+
@seq_rope_scaling = Toy::RopeScaling.none
|
|
122
|
+
# Seed a concrete Cfg from the same defaults so the ivar always
|
|
123
|
+
# holds a real Toy::LLM::Primitives::RoPE::Cfg (never nil/RbVal).
|
|
124
|
+
# Rebuilt per realize path once the true dims are known.
|
|
125
|
+
@seq_rope_cfg = Toy::LLM::Primitives::RoPE::Cfg.new(
|
|
126
|
+
@seq_d_head, @seq_rope_base,
|
|
127
|
+
@seq_rope_scaling.freq_scale,
|
|
128
|
+
@seq_rope_scaling.ext_factor,
|
|
129
|
+
@seq_rope_scaling.attn_factor,
|
|
130
|
+
@seq_rope_scaling.beta_fast,
|
|
131
|
+
@seq_rope_scaling.beta_slow)
|
|
132
|
+
@t_seq_rope_freq_factors = TinyNN.tnn_null_ptr
|
|
133
|
+
@seq_rms_eps = 1.0e-5
|
|
134
|
+
@sess = TinyNN.tnn_null_ptr
|
|
135
|
+
# P2.5 — token_embed / final_norm_gamma / output / w_proj and the
|
|
136
|
+
# blocks array are seeded on @seq_arch (see arch ctor); the cache
|
|
137
|
+
# reaches them via the delegators above.
|
|
138
|
+
@seq_has_untied_output = false
|
|
139
|
+
@seq_has_qkv_bias = false
|
|
140
|
+
@seq_gguf_handle_keepalive = TinyNN.tnn_null_ptr
|
|
141
|
+
@t_seq_token_ids = TinyNN.tnn_null_ptr
|
|
142
|
+
@t_seq_positions = TinyNN.tnn_null_ptr
|
|
143
|
+
# GH#7 — batched-training block-causal attention mask. Allocated
|
|
144
|
+
# only when @seq_b > 1 (realize_for_random_init with t_batch > 1);
|
|
145
|
+
# otherwise stays NULL and build_seq_qhead falls back to the
|
|
146
|
+
# diag_mask_inf + softmax path (bit-identical to today at B=1).
|
|
147
|
+
@t_seq_attn_mask = TinyNN.tnn_null_ptr
|
|
148
|
+
@t_seq_x_embed = TinyNN.tnn_null_ptr
|
|
149
|
+
@t_seq_x_final = TinyNN.tnn_null_ptr
|
|
150
|
+
@t_seq_logits = TinyNN.tnn_null_ptr
|
|
151
|
+
@seq_lora_q_enabled = false
|
|
152
|
+
@seq_lora_q_rank = 0
|
|
153
|
+
@seq_lora_q_adamw_enabled = false
|
|
154
|
+
@seq_full_finetune_enabled = false
|
|
155
|
+
@ft_globals_weights = [TinyNN.tnn_null_ptr]; @ft_globals_weights.pop
|
|
156
|
+
@ft_globals_m = [TinyNN.tnn_null_ptr]; @ft_globals_m.pop
|
|
157
|
+
@ft_globals_v = [TinyNN.tnn_null_ptr]; @ft_globals_v.pop
|
|
158
|
+
@ft_train_embeddings_enabled = false
|
|
159
|
+
# E2.3 (towards GH#14) — projection-lens path. donor_d_in is read
|
|
160
|
+
# from cfg in realize_for_random_init; t_seq_w_proj is the
|
|
161
|
+
# trainable [donor_d_in, d_model] linear inserted after the embed
|
|
162
|
+
# get_rows when donor_d_in > 0.
|
|
163
|
+
@seq_donor_d_in = 0
|
|
164
|
+
# P2.5 — t_seq_w_proj is seeded on @seq_arch (arch ctor); cache
|
|
165
|
+
# reaches it via the t_seq_w_proj delegator.
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# F3 — additionally train the embedding / final-norm gamma / untied
|
|
169
|
+
# output. Opt-in: the embed tensor on Qwen-class vocab is large and
|
|
170
|
+
# makes the memory budget noticeably tighter, but the math itself
|
|
171
|
+
# works correctly post vendor-patches/0006 (chunked get_rows_back).
|
|
172
|
+
def enable_full_finetune_embeddings!
|
|
173
|
+
@ft_train_embeddings_enabled = true
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# F3 — turn on full fine-tune. Every per-block weight tensor will
|
|
177
|
+
# be allocated as writable F32 in ctx_w (instead of mmap'd from the
|
|
178
|
+
# GGUF), paired with persistent Adam m/v, and marked trainable.
|
|
179
|
+
# Mutually exclusive with enable_lora_q!. Call BEFORE
|
|
180
|
+
# realize_for_full_finetune.
|
|
181
|
+
def enable_full_finetune!
|
|
182
|
+
@seq_full_finetune_enabled = true
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# M3 step 3 — turn on LoRA on the Q projection. Adapter A is (r, d_model),
|
|
186
|
+
# B is (d_head, r). Standard init: A small Gaussian, B zero → adapter is
|
|
187
|
+
# a no-op at step 0. Call BEFORE realize_for_mmap. Mirrors
|
|
188
|
+
# SmolLM2KVFFICache#enable_lora_q!.
|
|
189
|
+
def enable_lora_q!(r)
|
|
190
|
+
@seq_lora_q_enabled = true
|
|
191
|
+
@seq_lora_q_rank = r
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# M3 step 3 — allocate persistent AdamW moments next to each LoRA pair
|
|
195
|
+
# (parallel to F1.2 step 6b on SmolLM2KVFFICache). Required to keep
|
|
196
|
+
# optimizer state alive across reset_for_rebuild / multi-step training.
|
|
197
|
+
def enable_lora_q_adamw!
|
|
198
|
+
@seq_lora_q_adamw_enabled = true
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# P2.6 — shared config-prologue helper. Writes the @seq_* shape/RoPE
|
|
202
|
+
# ivars that every realize_for_* path needs before allocating tensors.
|
|
203
|
+
# Pure ivar writes reading only cfg.*; no FFI, no graph state. Each
|
|
204
|
+
# realize path keeps its own `@seq_t = t_seq` (and any path-local
|
|
205
|
+
# extras) at the call site and then calls this. Byte-identical to the
|
|
206
|
+
# block that previously lived inline in all four realize_for_* methods.
|
|
207
|
+
def apply_seq_cfg!(cfg)
|
|
208
|
+
@seq_d_model = cfg.d_model
|
|
209
|
+
@seq_d_ff = cfg.d_ff
|
|
210
|
+
@seq_n_heads = cfg.n_heads
|
|
211
|
+
@seq_n_kv = cfg.n_kv
|
|
212
|
+
@seq_d_head = cfg.head_dim
|
|
213
|
+
@seq_group_size = cfg.n_heads / cfg.n_kv
|
|
214
|
+
@seq_n_layers = cfg.n_layers
|
|
215
|
+
@seq_vocab_size = cfg.vocab
|
|
216
|
+
@seq_rope_base = cfg.rope_base
|
|
217
|
+
@seq_rope_scaling = cfg.rope_scaling
|
|
218
|
+
@seq_rope_cfg = Toy::LLM::Primitives::RoPE::Cfg.new(
|
|
219
|
+
@seq_d_head, @seq_rope_base,
|
|
220
|
+
@seq_rope_scaling.freq_scale,
|
|
221
|
+
@seq_rope_scaling.ext_factor,
|
|
222
|
+
@seq_rope_scaling.attn_factor,
|
|
223
|
+
@seq_rope_scaling.beta_fast,
|
|
224
|
+
@seq_rope_scaling.beta_slow)
|
|
225
|
+
@seq_rms_eps = cfg.rms_eps
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# F4 alternative realize for CUDA + Q8 base. Allocates every weight
|
|
229
|
+
# tensor in the standard ggml ctx_w (NOT the BYO mmap region), then
|
|
230
|
+
# verbatim-copies the GGUF bytes in. Buys correctness on CUDA at the
|
|
231
|
+
# cost of holding the weights twice transiently (mmap + ctx_w during
|
|
232
|
+
# load; ctx_w only after). Required because the BYO-pointer cuda
|
|
233
|
+
# buffer's quantized padding zeroing (cudaMemset past tensor data)
|
|
234
|
+
# would otherwise crash on Q8 tensors with `ne0 % 512 != 0`.
|
|
235
|
+
#
|
|
236
|
+
# Use this realize when (a) the GGUF is Q8 AND (b) the backend is
|
|
237
|
+
# CUDA. CPU + Q8 stays on realize_for_mmap (no padding issue).
|
|
238
|
+
def realize_for_q8_copy(gguf_handle, cfg, t_seq, untied, qkv_bias)
|
|
239
|
+
@seq_t = t_seq
|
|
240
|
+
apply_seq_cfg!(cfg)
|
|
241
|
+
|
|
242
|
+
@seq_gguf_handle_keepalive = gguf_handle
|
|
243
|
+
@sess = TinyNN.tnn_session_new(0)
|
|
244
|
+
|
|
245
|
+
# llama3 / LongRoPE: allocate the freq_factors tensor in ctx_w
|
|
246
|
+
# before finalize_weights. Values uploaded post-finalize.
|
|
247
|
+
if @seq_rope_scaling.kind == :llama3
|
|
248
|
+
@t_seq_rope_freq_factors = TinyNN.tnn_rope_freq_factors_alloc(@sess, cfg.head_dim)
|
|
249
|
+
else
|
|
250
|
+
@t_seq_rope_freq_factors = TinyNN.tnn_null_ptr
|
|
251
|
+
end
|
|
252
|
+
@seq_has_untied_output = untied
|
|
253
|
+
@seq_has_qkv_bias = qkv_bias
|
|
254
|
+
|
|
255
|
+
# Read source tensor types so we can allocate ctx_w tensors of the
|
|
256
|
+
# MATCHING type (verbatim copy requires source/target types match).
|
|
257
|
+
eidx = TinyNN.tnn_gguf_find_index(gguf_handle, "token_embd.weight")
|
|
258
|
+
etyp = TinyNN.tnn_gguf_tensor_type(gguf_handle, eidx)
|
|
259
|
+
self.t_seq_token_embed = TinyNN.tnn_input_2d_persistent_typed(@sess,
|
|
260
|
+
@seq_vocab_size, @seq_d_model, etyp)
|
|
261
|
+
self.t_seq_final_norm_gamma = TinyNN.tnn_input_1d_f32_persistent(@sess, @seq_d_model)
|
|
262
|
+
if untied
|
|
263
|
+
oidx = TinyNN.tnn_gguf_find_index(gguf_handle, "output.weight")
|
|
264
|
+
otyp = TinyNN.tnn_gguf_tensor_type(gguf_handle, oidx)
|
|
265
|
+
self.t_seq_output = TinyNN.tnn_input_2d_persistent_typed(@sess,
|
|
266
|
+
@seq_vocab_size, @seq_d_model, otyp)
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# P2.6 Step 2 — seeding loop moved onto the arch (LlamaArch#seed_blocks!).
|
|
270
|
+
@seq_arch.seed_blocks!(@seq_n_layers)
|
|
271
|
+
|
|
272
|
+
# P2.7 pass-3 — the per-block ALLOC-typed loop body moved onto
|
|
273
|
+
# TransformerBlock#alloc_q8_typed_from_gguf! (verbatim; called ONLY
|
|
274
|
+
# from here). Mirrors load_from_gguf_mmap!'s arg-passing exactly: every
|
|
275
|
+
# dim/flag arrives as an arg, NO ivar reads off the block. The q8 path
|
|
276
|
+
# never names LoRA tensors, so the moved body is :str-free (#16-clean)
|
|
277
|
+
# — no lora_name_q! back-calls (unlike load_from_gguf_mmap!).
|
|
278
|
+
li = 0
|
|
279
|
+
while li < @seq_n_layers
|
|
280
|
+
blk = self.seq_blocks_ffi[li]
|
|
281
|
+
blk.alloc_q8_typed_from_gguf!(@sess, gguf_handle, li,
|
|
282
|
+
@seq_n_heads, @seq_n_kv, @seq_d_head, @seq_d_model,
|
|
283
|
+
@seq_d_ff, @seq_vocab_size, @seq_lora_q_enabled,
|
|
284
|
+
@seq_lora_q_rank, @seq_lora_q_adamw_enabled, qkv_bias)
|
|
285
|
+
li = li + 1
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
if @seq_lora_q_enabled
|
|
289
|
+
li2 = 0
|
|
290
|
+
while li2 < @seq_n_layers
|
|
291
|
+
blk2 = self.seq_blocks_ffi[li2]
|
|
292
|
+
hq_p = 0
|
|
293
|
+
while hq_p < @seq_n_heads
|
|
294
|
+
TinyNN.tnn_set_param(blk2.t_seq_w_lora_a_q[hq_p])
|
|
295
|
+
TinyNN.tnn_set_param(blk2.t_seq_w_lora_b_q[hq_p])
|
|
296
|
+
hq_p = hq_p + 1
|
|
297
|
+
end
|
|
298
|
+
li2 = li2 + 1
|
|
299
|
+
end
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
finalize_weights_and_upload_constants!
|
|
303
|
+
|
|
304
|
+
# Load all weight bytes from the GGUF into the now-allocated
|
|
305
|
+
# backend buffers. Verbatim copy keeps Q8 as Q8.
|
|
306
|
+
TinyNN.tnn_gguf_copy_verbatim_to_persistent(gguf_handle, eidx, @sess, self.t_seq_token_embed)
|
|
307
|
+
fnidx = TinyNN.tnn_gguf_find_index(gguf_handle, "output_norm.weight")
|
|
308
|
+
TinyNN.tnn_gguf_copy_1d_to_persistent(gguf_handle, fnidx, @sess, self.t_seq_final_norm_gamma)
|
|
309
|
+
if untied
|
|
310
|
+
oidx2 = TinyNN.tnn_gguf_find_index(gguf_handle, "output.weight")
|
|
311
|
+
TinyNN.tnn_gguf_copy_verbatim_to_persistent(gguf_handle, oidx2, @sess, self.t_seq_output)
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
# P2.7 pass-3 Step 2 — the per-block VERBATIM-COPY loop body moved onto
|
|
315
|
+
# TransformerBlock#copy_q8_bytes_from_gguf! (verbatim; called ONLY from
|
|
316
|
+
# here). The copy phase fills the backend buffers allocated by the
|
|
317
|
+
# alloc_q8_typed_from_gguf! pass; the block reads its OWN t_seq_* handles
|
|
318
|
+
# and writes nothing on itself. NO ivar reads off the cache — every dim
|
|
319
|
+
# (n_heads, n_kv, d_head) and the qkv_bias flag arrive as ARGS. All the
|
|
320
|
+
# moved primitives are tnn_gguf_copy_* / tnn_gguf_find_index — the same
|
|
321
|
+
# :str-at-runtime pattern alloc_q8_typed_from_gguf! already uses, never
|
|
322
|
+
# block class-load scope (#16). The GLOBALS verbatim-copy above (token
|
|
323
|
+
# embed / final norm / untied output) STAYS on the cache — those touch
|
|
324
|
+
# cache-level t_seq_* handles, not the block.
|
|
325
|
+
li_l = 0
|
|
326
|
+
while li_l < @seq_n_layers
|
|
327
|
+
blk = self.seq_blocks_ffi[li_l]
|
|
328
|
+
blk.copy_q8_bytes_from_gguf!(@sess, gguf_handle, li_l,
|
|
329
|
+
@seq_n_heads, @seq_n_kv, @seq_d_head, qkv_bias)
|
|
330
|
+
li_l = li_l + 1
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
if @seq_lora_q_adamw_enabled
|
|
334
|
+
za = Mat.new(@seq_lora_q_rank, @seq_d_model)
|
|
335
|
+
zb = Mat.new(@seq_d_head, @seq_lora_q_rank)
|
|
336
|
+
i = 0
|
|
337
|
+
while i < @seq_lora_q_rank * @seq_d_model; za.flat[i] = 0.0; i = i + 1; end
|
|
338
|
+
j = 0
|
|
339
|
+
while j < @seq_d_head * @seq_lora_q_rank; zb.flat[j] = 0.0; j = j + 1; end
|
|
340
|
+
li_z = 0
|
|
341
|
+
while li_z < @seq_n_layers
|
|
342
|
+
blk_z = self.seq_blocks_ffi[li_z]
|
|
343
|
+
hqz = 0
|
|
344
|
+
while hqz < @seq_n_heads
|
|
345
|
+
TinyNN.upload_row_major(@sess, blk_z.t_seq_w_lora_a_q_m[hqz], za)
|
|
346
|
+
TinyNN.upload_row_major(@sess, blk_z.t_seq_w_lora_a_q_v[hqz], za)
|
|
347
|
+
TinyNN.upload_row_major(@sess, blk_z.t_seq_w_lora_b_q_m[hqz], zb)
|
|
348
|
+
TinyNN.upload_row_major(@sess, blk_z.t_seq_w_lora_b_q_v[hqz], zb)
|
|
349
|
+
hqz = hqz + 1
|
|
350
|
+
end
|
|
351
|
+
li_z = li_z + 1
|
|
352
|
+
end
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
build_and_realize!
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
# Allocate persistent weights mmap'd from `gguf_handle` (caller is
|
|
359
|
+
# responsible for keeping the handle alive — we keepalive it via
|
|
360
|
+
# @seq_gguf_handle_keepalive), compute inputs, and the full forward
|
|
361
|
+
# graph for T = `t_seq` positions. Fixed T; rebuild for a different T.
|
|
362
|
+
#
|
|
363
|
+
# Weight layout matches SmolLM2KVFFICache#realize_for_mmap exactly
|
|
364
|
+
# (same byte offsets + per-head split), so a sharded GGUF can be
|
|
365
|
+
# loaded by either class.
|
|
366
|
+
def realize_for_mmap(gguf_handle, cfg, t_seq, untied, qkv_bias)
|
|
367
|
+
@seq_t = t_seq
|
|
368
|
+
apply_seq_cfg!(cfg)
|
|
369
|
+
|
|
370
|
+
@seq_gguf_handle_keepalive = gguf_handle
|
|
371
|
+
@sess = TinyNN.tnn_session_new(0)
|
|
372
|
+
|
|
373
|
+
# llama3 / LongRoPE: allocate the freq_factors tensor in ctx_w
|
|
374
|
+
# before finalize_weights. Values uploaded post-finalize.
|
|
375
|
+
if @seq_rope_scaling.kind == :llama3
|
|
376
|
+
@t_seq_rope_freq_factors = TinyNN.tnn_rope_freq_factors_alloc(@sess, cfg.head_dim)
|
|
377
|
+
else
|
|
378
|
+
@t_seq_rope_freq_factors = TinyNN.tnn_null_ptr
|
|
379
|
+
end
|
|
380
|
+
@seq_has_untied_output = untied
|
|
381
|
+
@seq_has_qkv_bias = qkv_bias
|
|
382
|
+
|
|
383
|
+
map_base = TinyNN.tnn_gguf_mmap_base(gguf_handle)
|
|
384
|
+
map_size = TinyNN.tnn_gguf_mmap_size(gguf_handle)
|
|
385
|
+
TinyNN.tnn_session_attach_weight_mmap(@sess, map_base, map_size)
|
|
386
|
+
|
|
387
|
+
# Embeddings + final norm + optional untied LM head.
|
|
388
|
+
# P2.6 pass-2 Step 1 — the three arch-owned global mmap allocs moved
|
|
389
|
+
# onto LlamaArch#load_globals_from_gguf_mmap! (verbatim; called ONLY
|
|
390
|
+
# from here). Mirrors the seed_blocks! / alloc_trainable_f32_weights!
|
|
391
|
+
# extraction precedents.
|
|
392
|
+
@seq_arch.load_globals_from_gguf_mmap!(@sess, gguf_handle,
|
|
393
|
+
@seq_vocab_size, @seq_d_model, untied)
|
|
394
|
+
|
|
395
|
+
# P2.6 Step 2 — seeding loop moved onto the arch (LlamaArch#seed_blocks!).
|
|
396
|
+
@seq_arch.seed_blocks!(@seq_n_layers)
|
|
397
|
+
|
|
398
|
+
# P2.7 — the per-block alloc-from-mmap-offsets loop body moved onto
|
|
399
|
+
# TransformerBlock#load_from_gguf_mmap! (verbatim; called ONLY from
|
|
400
|
+
# here). Mirrors the alloc_trainable_f32_weights! / seed_blocks! /
|
|
401
|
+
# load_globals_from_gguf_mmap! extraction precedents. head_nbytes and
|
|
402
|
+
# the LoRA :str tnn_tensor_set_name naming stay on THIS cache and are
|
|
403
|
+
# back-called through the passed `self` ref (lora_name_q! /
|
|
404
|
+
# lora_name_q_adam! issue the :str FFI at this runtime scope, never in
|
|
405
|
+
# block class-load scope — landmine #16).
|
|
406
|
+
li = 0
|
|
407
|
+
while li < @seq_n_layers
|
|
408
|
+
blk = self.seq_blocks_ffi[li]
|
|
409
|
+
blk.load_from_gguf_mmap!(@sess, self, gguf_handle, li,
|
|
410
|
+
@seq_n_heads, @seq_n_kv, @seq_d_head, @seq_d_model,
|
|
411
|
+
@seq_d_ff, @seq_lora_q_enabled, @seq_lora_q_rank,
|
|
412
|
+
@seq_lora_q_adamw_enabled, qkv_bias)
|
|
413
|
+
li = li + 1
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
# Mark LoRA tensors as trainable BEFORE finalize. set_param flips
|
|
417
|
+
# the PARAM flag so build_backward walks them when emitting grad nodes.
|
|
418
|
+
if @seq_lora_q_enabled
|
|
419
|
+
li2 = 0
|
|
420
|
+
while li2 < @seq_n_layers
|
|
421
|
+
blk2 = self.seq_blocks_ffi[li2]
|
|
422
|
+
hq_p = 0
|
|
423
|
+
while hq_p < @seq_n_heads
|
|
424
|
+
TinyNN.tnn_set_param(blk2.t_seq_w_lora_a_q[hq_p])
|
|
425
|
+
TinyNN.tnn_set_param(blk2.t_seq_w_lora_b_q[hq_p])
|
|
426
|
+
hq_p = hq_p + 1
|
|
427
|
+
end
|
|
428
|
+
li2 = li2 + 1
|
|
429
|
+
end
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
finalize_weights_and_upload_constants!
|
|
433
|
+
|
|
434
|
+
# Zero-init persistent AdamW moments. Same contract as F1.2 step 6b
|
|
435
|
+
# on SmolLM2KVFFICache — m and v start at 0 per the AdamW update rule.
|
|
436
|
+
if @seq_lora_q_adamw_enabled
|
|
437
|
+
za = Mat.new(@seq_lora_q_rank, @seq_d_model)
|
|
438
|
+
zb = Mat.new(@seq_d_head, @seq_lora_q_rank)
|
|
439
|
+
i = 0
|
|
440
|
+
while i < @seq_lora_q_rank * @seq_d_model; za.flat[i] = 0.0; i = i + 1; end
|
|
441
|
+
j = 0
|
|
442
|
+
while j < @seq_d_head * @seq_lora_q_rank; zb.flat[j] = 0.0; j = j + 1; end
|
|
443
|
+
li_z = 0
|
|
444
|
+
while li_z < @seq_n_layers
|
|
445
|
+
blk_z = self.seq_blocks_ffi[li_z]
|
|
446
|
+
hqz = 0
|
|
447
|
+
while hqz < @seq_n_heads
|
|
448
|
+
TinyNN.upload_row_major(@sess, blk_z.t_seq_w_lora_a_q_m[hqz], za)
|
|
449
|
+
TinyNN.upload_row_major(@sess, blk_z.t_seq_w_lora_a_q_v[hqz], za)
|
|
450
|
+
TinyNN.upload_row_major(@sess, blk_z.t_seq_w_lora_b_q_m[hqz], zb)
|
|
451
|
+
TinyNN.upload_row_major(@sess, blk_z.t_seq_w_lora_b_q_v[hqz], zb)
|
|
452
|
+
hqz = hqz + 1
|
|
453
|
+
end
|
|
454
|
+
li_z = li_z + 1
|
|
455
|
+
end
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
build_and_realize!
|
|
459
|
+
end
|
|
460
|
+
|
|
461
|
+
# F3 — full fine-tune realize path. Parallel to realize_for_mmap
|
|
462
|
+
# but every per-block weight is allocated writable F32 in ctx_w
|
|
463
|
+
# (no mmap), set_param-marked, paired with Adam m/v, and loaded
|
|
464
|
+
# from the GGUF post-finalize via the dequantize-friendly
|
|
465
|
+
# tnn_gguf_copy_* primitives. The embedding tensor + final_norm
|
|
466
|
+
# gamma stay mmap'd (read-only) — the MVP doesn't train them.
|
|
467
|
+
def realize_for_full_finetune(gguf_handle, cfg, t_seq, untied, qkv_bias)
|
|
468
|
+
@seq_t = t_seq
|
|
469
|
+
apply_seq_cfg!(cfg)
|
|
470
|
+
|
|
471
|
+
@seq_gguf_handle_keepalive = gguf_handle
|
|
472
|
+
@sess = TinyNN.tnn_session_new(0)
|
|
473
|
+
|
|
474
|
+
# llama3 / LongRoPE: allocate the freq_factors tensor in ctx_w
|
|
475
|
+
# before finalize_weights. Values uploaded post-finalize.
|
|
476
|
+
if @seq_rope_scaling.kind == :llama3
|
|
477
|
+
@t_seq_rope_freq_factors = TinyNN.tnn_rope_freq_factors_alloc(@sess, cfg.head_dim)
|
|
478
|
+
else
|
|
479
|
+
@t_seq_rope_freq_factors = TinyNN.tnn_null_ptr
|
|
480
|
+
end
|
|
481
|
+
@seq_has_untied_output = untied
|
|
482
|
+
@seq_has_qkv_bias = qkv_bias
|
|
483
|
+
|
|
484
|
+
# Token embed + final-norm gamma + (untied) output: trainable
|
|
485
|
+
# only when opt-in (ft_train_embeddings_enabled). Otherwise
|
|
486
|
+
# they stay mmap'd / read-only (still need a mmap attach for
|
|
487
|
+
# this branch).
|
|
488
|
+
if @ft_train_embeddings_enabled
|
|
489
|
+
self.t_seq_token_embed = TinyNN.tnn_input_2d_f32_persistent(@sess,
|
|
490
|
+
@seq_vocab_size, @seq_d_model)
|
|
491
|
+
ft_add_global_2d(self.t_seq_token_embed, @seq_vocab_size, @seq_d_model)
|
|
492
|
+
ft_name_last_global("token_embd.weight")
|
|
493
|
+
|
|
494
|
+
self.t_seq_final_norm_gamma = TinyNN.tnn_input_1d_f32_persistent(@sess, @seq_d_model)
|
|
495
|
+
ft_add_global_1d(self.t_seq_final_norm_gamma)
|
|
496
|
+
ft_name_last_global("output_norm.weight")
|
|
497
|
+
|
|
498
|
+
if untied
|
|
499
|
+
self.t_seq_output = TinyNN.tnn_input_2d_f32_persistent(@sess,
|
|
500
|
+
@seq_vocab_size, @seq_d_model)
|
|
501
|
+
ft_add_global_2d(self.t_seq_output, @seq_vocab_size, @seq_d_model)
|
|
502
|
+
ft_name_last_global("output.weight")
|
|
503
|
+
end
|
|
504
|
+
else
|
|
505
|
+
map_base = TinyNN.tnn_gguf_mmap_base(gguf_handle)
|
|
506
|
+
map_size = TinyNN.tnn_gguf_mmap_size(gguf_handle)
|
|
507
|
+
TinyNN.tnn_session_attach_weight_mmap(@sess, map_base, map_size)
|
|
508
|
+
|
|
509
|
+
eidx = TinyNN.tnn_gguf_find_index(gguf_handle, "token_embd.weight")
|
|
510
|
+
eoff = TinyNN.tnn_gguf_tensor_file_offset(gguf_handle, eidx)
|
|
511
|
+
etyp = TinyNN.tnn_gguf_tensor_type(gguf_handle, eidx)
|
|
512
|
+
self.t_seq_token_embed = TinyNN.tnn_input_2d_persistent_mmap(@sess,
|
|
513
|
+
@seq_vocab_size, @seq_d_model, etyp, eoff)
|
|
514
|
+
|
|
515
|
+
fnidx = TinyNN.tnn_gguf_find_index(gguf_handle, "output_norm.weight")
|
|
516
|
+
fnoff = TinyNN.tnn_gguf_tensor_file_offset(gguf_handle, fnidx)
|
|
517
|
+
self.t_seq_final_norm_gamma = TinyNN.tnn_input_1d_persistent_mmap(@sess,
|
|
518
|
+
@seq_d_model, 0, fnoff)
|
|
519
|
+
|
|
520
|
+
if untied
|
|
521
|
+
oidx = TinyNN.tnn_gguf_find_index(gguf_handle, "output.weight")
|
|
522
|
+
ooff = TinyNN.tnn_gguf_tensor_file_offset(gguf_handle, oidx)
|
|
523
|
+
otyp = TinyNN.tnn_gguf_tensor_type(gguf_handle, oidx)
|
|
524
|
+
self.t_seq_output = TinyNN.tnn_input_2d_persistent_mmap(@sess,
|
|
525
|
+
@seq_vocab_size, @seq_d_model, otyp, ooff)
|
|
526
|
+
end
|
|
527
|
+
end
|
|
528
|
+
|
|
529
|
+
# P2.6 Step 2 — seeding loop moved onto the arch (LlamaArch#seed_blocks!).
|
|
530
|
+
@seq_arch.seed_blocks!(@seq_n_layers)
|
|
531
|
+
|
|
532
|
+
# P2-finish — per-block FT alloc lifted onto the block (verbatim:
|
|
533
|
+
# TransformerBlock#alloc_full_finetune_f32_weights!), mirroring how
|
|
534
|
+
# realize_for_random_init drives alloc_trainable_f32_weights!. The block
|
|
535
|
+
# owns its self.t_seq_* handles + the per-block set_param loop; the cache
|
|
536
|
+
# passes @sess + dims + qkv_bias and the ft_add_*/ft_name_last recorders
|
|
537
|
+
# are back-called. Gated byte-exact by prep/full_finetune_gate.rb.
|
|
538
|
+
li = 0
|
|
539
|
+
while li < @seq_n_layers
|
|
540
|
+
blk = self.seq_blocks_ffi[li]
|
|
541
|
+
prefix = "blk." + li.to_s + "."
|
|
542
|
+
blk.alloc_full_finetune_f32_weights!(@sess, self, prefix,
|
|
543
|
+
@seq_d_model, @seq_d_ff, @seq_d_head,
|
|
544
|
+
@seq_n_heads, @seq_n_kv, qkv_bias)
|
|
545
|
+
li = li + 1
|
|
546
|
+
end
|
|
547
|
+
|
|
548
|
+
# Globals are trainable too only when embeddings are opt-in.
|
|
549
|
+
if @ft_train_embeddings_enabled
|
|
550
|
+
gi = 0
|
|
551
|
+
while gi < @ft_globals_weights.length
|
|
552
|
+
TinyNN.tnn_set_param(@ft_globals_weights[gi])
|
|
553
|
+
gi = gi + 1
|
|
554
|
+
end
|
|
555
|
+
end
|
|
556
|
+
|
|
557
|
+
finalize_weights_and_upload_constants!
|
|
558
|
+
|
|
559
|
+
# Post-finalize: load every writable weight from the GGUF.
|
|
560
|
+
if @ft_train_embeddings_enabled
|
|
561
|
+
ft_load_globals(gguf_handle, untied)
|
|
562
|
+
end
|
|
563
|
+
ft_load_from_gguf(gguf_handle, qkv_bias)
|
|
564
|
+
ft_zero_init_adam(qkv_bias)
|
|
565
|
+
if @ft_train_embeddings_enabled
|
|
566
|
+
ft_zero_init_adam_globals
|
|
567
|
+
end
|
|
568
|
+
|
|
569
|
+
build_and_realize!
|
|
570
|
+
end
|
|
571
|
+
|
|
572
|
+
# P2-α: from-scratch training entry. Allocates the same persistent
|
|
573
|
+
# tensor layout as realize_for_full_finetune (embeddings + per-block
|
|
574
|
+
# weights, all trainable F32 in ctx_w), then random-initialises
|
|
575
|
+
# every weight via Ruby-side Gaussian upload — no GGUF needed.
|
|
576
|
+
#
|
|
577
|
+
# Force-enables `@ft_train_embeddings_enabled` so the existing
|
|
578
|
+
# full-FT machinery allocates persistent F32 embeddings instead
|
|
579
|
+
# of the mmap branch. Caller doesn't need to call
|
|
580
|
+
# enable_full_finetune_embeddings! first.
|
|
581
|
+
#
|
|
582
|
+
# Currently Llama-arch only (RMSNorm + GQA + RoPE + SwiGLU). Other
|
|
583
|
+
# architectures (GPT-2 LN, MHA + biases) need a separate trainer
|
|
584
|
+
# cache class; deferred until we actually need GPT-2 from-scratch.
|
|
585
|
+
def realize_for_random_init(cfg, t_seq, t_batch, weight_dtype, untied, qkv_bias, seed, init_scale)
|
|
586
|
+
@ft_train_embeddings_enabled = true # forces persistent-F32 alloc of embeddings
|
|
587
|
+
@seq_full_finetune_enabled = true # build_training_step gates on this
|
|
588
|
+
|
|
589
|
+
@seq_t = t_seq
|
|
590
|
+
# GH#7 — micro-batching. B=1 keeps the codepath bit-identical to
|
|
591
|
+
# the pre-GH#7 single-sequence training. B>1 lays out tokens as a
|
|
592
|
+
# flat [T*B] vector with a block-causal attention mask uploaded
|
|
593
|
+
# post-finalize and applied via soft_max_ext.
|
|
594
|
+
@seq_b = t_batch
|
|
595
|
+
# GH#9 — mixed-precision compute. 0 = F32 (bit-identical to
|
|
596
|
+
# pre-GH#9). 1 = F16, 30 = BF16. See mp_matmul + ivar comment in
|
|
597
|
+
# initialize for the master-copy details.
|
|
598
|
+
@seq_weight_dtype = weight_dtype
|
|
599
|
+
apply_seq_cfg!(cfg)
|
|
600
|
+
|
|
601
|
+
@sess = TinyNN.tnn_session_new(0)
|
|
602
|
+
# GH#17 — per-head decomposition makes node count scale as
|
|
603
|
+
# O(n_layers × n_heads). The default 65536 cap overflows on
|
|
604
|
+
# 24L × 16-head Qwen-shape at backward-expand. Empirically a
|
|
605
|
+
# 24L × 16-head model needs ~450k nodes for forward + backward +
|
|
606
|
+
# AdamW, so we budget ~1000 nodes per (layer × head) cell + floor.
|
|
607
|
+
cap = cfg.n_layers * cfg.n_heads * 1000 + 65536
|
|
608
|
+
TinyNN.tnn_session_set_graph_capacity(@sess, cap)
|
|
609
|
+
@seq_has_untied_output = untied
|
|
610
|
+
@seq_has_qkv_bias = qkv_bias
|
|
611
|
+
@seq_donor_d_in = cfg.donor_d_in # E2.3 — 0 disables projection lens
|
|
612
|
+
|
|
613
|
+
if @seq_rope_scaling.kind == :llama3
|
|
614
|
+
@t_seq_rope_freq_factors = TinyNN.tnn_rope_freq_factors_alloc(@sess, cfg.head_dim)
|
|
615
|
+
else
|
|
616
|
+
@t_seq_rope_freq_factors = TinyNN.tnn_null_ptr
|
|
617
|
+
end
|
|
618
|
+
|
|
619
|
+
# Globals — trainable persistent F32 (+ E2.3 projection-lens branch when
|
|
620
|
+
# @seq_donor_d_in > 0). P2-finish: the alloc lifted onto the arch
|
|
621
|
+
# (LlamaArch#alloc_globals_trainable_f32!), which already owns these handles
|
|
622
|
+
# — verbatim, same order, byte-identical. @ft_globals_* recorders + the
|
|
623
|
+
# frozen-embed namer are back-called through `self`.
|
|
624
|
+
@seq_arch.alloc_globals_trainable_f32!(@sess, self, @seq_vocab_size,
|
|
625
|
+
@seq_d_model, @seq_donor_d_in, untied)
|
|
626
|
+
|
|
627
|
+
# Per-block weights — identical structure to realize_for_full_finetune.
|
|
628
|
+
# P2.6 Step 2 — the block-array seeding loop now lives on the arch
|
|
629
|
+
# (LlamaArch#seed_blocks!), which already owns @seq_blocks_ffi.
|
|
630
|
+
@seq_arch.seed_blocks!(@seq_n_layers)
|
|
631
|
+
|
|
632
|
+
# P2.6 Step 4 — the per-block F32 ALLOC loop body now lives on the
|
|
633
|
+
# block (TransformerBlock#alloc_trainable_f32_weights!), which already
|
|
634
|
+
# OWNS these self.t_seq_* handles at forward time. The block takes
|
|
635
|
+
# @sess + the seq dims + the name prefix as ARGS (no ivar reads on the
|
|
636
|
+
# block) and calls the cache's ft_add_1d / ft_add_2d / ft_name_last
|
|
637
|
+
# recorders BACK through the passed `self` reference — those stay on
|
|
638
|
+
# the cache (they read @sess and issue tnn_tensor_set_name :str at
|
|
639
|
+
# runtime; never migrate into block class-load scope). w_o keeps its
|
|
640
|
+
# random_init shape ne=[d_model, n_heads*d_head] inside the block
|
|
641
|
+
# method (not unified with full_finetune's [d_model,d_model]).
|
|
642
|
+
li = 0
|
|
643
|
+
while li < @seq_n_layers
|
|
644
|
+
blk = self.seq_blocks_ffi[li]
|
|
645
|
+
prefix = "blk." + li.to_s + "."
|
|
646
|
+
blk.alloc_trainable_f32_weights!(@sess, self, prefix,
|
|
647
|
+
@seq_d_model, @seq_d_ff, @seq_d_head,
|
|
648
|
+
@seq_n_heads, @seq_n_kv)
|
|
649
|
+
li = li + 1
|
|
650
|
+
end
|
|
651
|
+
|
|
652
|
+
# Mark globals as params too (gated on @ft_train_embeddings_enabled).
|
|
653
|
+
gi = 0
|
|
654
|
+
while gi < @ft_globals_weights.length
|
|
655
|
+
TinyNN.tnn_set_param(@ft_globals_weights[gi])
|
|
656
|
+
gi = gi + 1
|
|
657
|
+
end
|
|
658
|
+
|
|
659
|
+
finalize_weights_and_upload_constants!
|
|
660
|
+
|
|
661
|
+
# Random-init every weight + zero biases + ones gammas.
|
|
662
|
+
upload_random_init!(seed, init_scale, qkv_bias, untied)
|
|
663
|
+
ft_zero_init_adam(qkv_bias)
|
|
664
|
+
ft_zero_init_adam_globals
|
|
665
|
+
|
|
666
|
+
build_and_realize!
|
|
667
|
+
end
|
|
668
|
+
|
|
669
|
+
# GH#7 — build + upload the block-causal attention mask for B>1.
|
|
670
|
+
# Layout: scores from matmul(K[d_head, T*B], Q[d_head, T*B]) have
|
|
671
|
+
# ne=[T*B, T*B] where ne0 indexes keys and ne1 indexes queries
|
|
672
|
+
# (ggml column-major: flat[ne0_idx + ne1_idx * T*B]). For query
|
|
673
|
+
# position i1 = b_q*T + p_q and key position i0 = b_k*T + p_k:
|
|
674
|
+
# mask = 0.0 iff b_k == b_q AND p_k <= p_q (intra-batch causal)
|
|
675
|
+
# mask = NEG otherwise (cross-batch + future)
|
|
676
|
+
# NEG = -1.0e30 so exp(NEG) == 0.0 in f32 (avoids Float::INFINITY,
|
|
677
|
+
# which would also work but is one less Spinel codegen variable).
|
|
678
|
+
def upload_block_causal_mask!
|
|
679
|
+
tb = @seq_t * @seq_b
|
|
680
|
+
neg = -1.0e30
|
|
681
|
+
mask_arr = [0.0]; mask_arr.pop
|
|
682
|
+
i1 = 0
|
|
683
|
+
while i1 < tb
|
|
684
|
+
b_q = i1 / @seq_t
|
|
685
|
+
p_q = i1 % @seq_t
|
|
686
|
+
i0 = 0
|
|
687
|
+
while i0 < tb
|
|
688
|
+
b_k = i0 / @seq_t
|
|
689
|
+
p_k = i0 % @seq_t
|
|
690
|
+
if b_k == b_q && p_k <= p_q
|
|
691
|
+
mask_arr.push(0.0)
|
|
692
|
+
else
|
|
693
|
+
mask_arr.push(neg)
|
|
694
|
+
end
|
|
695
|
+
i0 = i0 + 1
|
|
696
|
+
end
|
|
697
|
+
i1 = i1 + 1
|
|
698
|
+
end
|
|
699
|
+
TinyNN.tnn_upload_from_float_array(@sess, @t_seq_attn_mask, mask_arr, mask_arr.length)
|
|
700
|
+
end
|
|
701
|
+
|
|
702
|
+
# Fill every persistent weight tensor with N(0, std) values.
|
|
703
|
+
# Norm gammas → 1.0, biases (if present) → 0.0, matmul weights →
|
|
704
|
+
# N(0, init_scale/sqrt(fan_in)). Token embedding uses GPT-2-style
|
|
705
|
+
# N(0, 0.02). All values computed in Ruby, uploaded in bulk via
|
|
706
|
+
# tnn_upload_from_float_array.
|
|
707
|
+
def upload_random_init!(seed, init_scale, qkv_bias, untied)
|
|
708
|
+
state = [seed]
|
|
709
|
+
|
|
710
|
+
# Token embed: width depends on projection lens.
|
|
711
|
+
# When donor_d_in > 0, embed is [vocab, donor_d_in] (caller may
|
|
712
|
+
# overwrite with real donor values after realize); the trainable
|
|
713
|
+
# projection W_proj [donor_d_in, d_model] also gets a Gaussian init.
|
|
714
|
+
embed_cols = @seq_donor_d_in > 0 ? @seq_donor_d_in : @seq_d_model
|
|
715
|
+
upload_gaussian(self.t_seq_token_embed, @seq_vocab_size * embed_cols, 0.02, state)
|
|
716
|
+
if @seq_donor_d_in > 0
|
|
717
|
+
upload_gaussian(self.t_seq_w_proj, @seq_donor_d_in * @seq_d_model,
|
|
718
|
+
1.0 / Math.sqrt(@seq_donor_d_in.to_f), state)
|
|
719
|
+
end
|
|
720
|
+
upload_constant(self.t_seq_final_norm_gamma, @seq_d_model, 1.0)
|
|
721
|
+
if untied
|
|
722
|
+
upload_gaussian(self.t_seq_output, @seq_vocab_size * @seq_d_model, 0.02, state)
|
|
723
|
+
end
|
|
724
|
+
|
|
725
|
+
inv_sqrt_d = init_scale / Math.sqrt(@seq_d_model.to_f)
|
|
726
|
+
inv_sqrt_dff = init_scale / Math.sqrt(@seq_d_ff.to_f)
|
|
727
|
+
|
|
728
|
+
li = 0
|
|
729
|
+
while li < @seq_n_layers
|
|
730
|
+
blk = self.seq_blocks_ffi[li]
|
|
731
|
+
upload_constant(blk.t_seq_rn1_gamma, @seq_d_model, 1.0)
|
|
732
|
+
upload_constant(blk.t_seq_rn2_gamma, @seq_d_model, 1.0)
|
|
733
|
+
|
|
734
|
+
hq = 0
|
|
735
|
+
while hq < @seq_n_heads
|
|
736
|
+
upload_gaussian(blk.t_seq_w_q[hq], @seq_d_head * @seq_d_model, inv_sqrt_d, state)
|
|
737
|
+
hq = hq + 1
|
|
738
|
+
end
|
|
739
|
+
hkv = 0
|
|
740
|
+
while hkv < @seq_n_kv
|
|
741
|
+
upload_gaussian(blk.t_seq_w_k[hkv], @seq_d_head * @seq_d_model, inv_sqrt_d, state)
|
|
742
|
+
upload_gaussian(blk.t_seq_w_v[hkv], @seq_d_head * @seq_d_model, inv_sqrt_d, state)
|
|
743
|
+
hkv = hkv + 1
|
|
744
|
+
end
|
|
745
|
+
|
|
746
|
+
upload_gaussian(blk.t_seq_w_o, @seq_d_model * @seq_n_heads * @seq_d_head, inv_sqrt_d, state)
|
|
747
|
+
upload_gaussian(blk.t_seq_w_gate, @seq_d_ff * @seq_d_model, inv_sqrt_d, state)
|
|
748
|
+
upload_gaussian(blk.t_seq_w_up, @seq_d_ff * @seq_d_model, inv_sqrt_d, state)
|
|
749
|
+
upload_gaussian(blk.t_seq_w_down, @seq_d_model * @seq_d_ff, inv_sqrt_dff, state)
|
|
750
|
+
li = li + 1
|
|
751
|
+
end
|
|
752
|
+
end
|
|
753
|
+
|
|
754
|
+
# Box-Muller from a xorshift64-driven uniform stream. state is a
|
|
755
|
+
# one-element Array<Integer> so the mutable PRNG state survives
|
|
756
|
+
# across calls without using class variables. Always emits exactly
|
|
757
|
+
# `n` Gaussian-distributed F32 values via tnn_upload_from_float_array.
|
|
758
|
+
def upload_gaussian(tensor, n, std, state)
|
|
759
|
+
buf = [0.0]; buf.pop
|
|
760
|
+
pair = 0
|
|
761
|
+
saved = 0.0
|
|
762
|
+
i = 0
|
|
763
|
+
while i < n
|
|
764
|
+
if pair == 0
|
|
765
|
+
u1 = xorshift_uniform!(state)
|
|
766
|
+
u2 = xorshift_uniform!(state)
|
|
767
|
+
if u1 < 1.0e-300; u1 = 1.0e-300; end
|
|
768
|
+
r = Math.sqrt(-2.0 * Math.log(u1))
|
|
769
|
+
theta = 2.0 * Math::PI * u2
|
|
770
|
+
z0 = r * Math.cos(theta) * std
|
|
771
|
+
z1 = r * Math.sin(theta) * std
|
|
772
|
+
buf.push(z0)
|
|
773
|
+
saved = z1
|
|
774
|
+
pair = 1
|
|
775
|
+
else
|
|
776
|
+
buf.push(saved)
|
|
777
|
+
pair = 0
|
|
778
|
+
end
|
|
779
|
+
i = i + 1
|
|
780
|
+
end
|
|
781
|
+
TinyNN.tnn_upload_from_float_array(@sess, tensor, buf, n)
|
|
782
|
+
end
|
|
783
|
+
|
|
784
|
+
def upload_constant(tensor, n, v)
|
|
785
|
+
buf = [0.0]; buf.pop
|
|
786
|
+
i = 0
|
|
787
|
+
while i < n
|
|
788
|
+
buf.push(v)
|
|
789
|
+
i = i + 1
|
|
790
|
+
end
|
|
791
|
+
TinyNN.tnn_upload_from_float_array(@sess, tensor, buf, n)
|
|
792
|
+
end
|
|
793
|
+
|
|
794
|
+
# xorshift64 → uniform in (0, 1). Mutates state[0].
|
|
795
|
+
def xorshift_uniform!(state)
|
|
796
|
+
x = state[0]
|
|
797
|
+
x = x ^ (x << 13)
|
|
798
|
+
x = x & 0xFFFFFFFFFFFFFFFF
|
|
799
|
+
x = x ^ (x >> 7)
|
|
800
|
+
x = x ^ (x << 17)
|
|
801
|
+
x = x & 0xFFFFFFFFFFFFFFFF
|
|
802
|
+
state[0] = x
|
|
803
|
+
(x.to_f / 18446744073709551616.0) + 1.0e-300
|
|
804
|
+
end
|
|
805
|
+
|
|
806
|
+
# Append (weight, m, v) to the block's parallel arrays. Allocates
|
|
807
|
+
# Adam m and v of the same shape as `weight` as a side effect.
|
|
808
|
+
def ft_add_2d(blk, weight, rows, cols)
|
|
809
|
+
blk.ft_weights.push(weight)
|
|
810
|
+
blk.ft_m.push(TinyNN.tnn_input_2d_f32_persistent(@sess, rows, cols))
|
|
811
|
+
blk.ft_v.push(TinyNN.tnn_input_2d_f32_persistent(@sess, rows, cols))
|
|
812
|
+
end
|
|
813
|
+
|
|
814
|
+
def ft_add_1d(blk, weight)
|
|
815
|
+
n = TinyNN.tnn_tensor_nelements(weight)
|
|
816
|
+
blk.ft_weights.push(weight)
|
|
817
|
+
blk.ft_m.push(TinyNN.tnn_input_1d_f32_persistent(@sess, n))
|
|
818
|
+
blk.ft_v.push(TinyNN.tnn_input_1d_f32_persistent(@sess, n))
|
|
819
|
+
end
|
|
820
|
+
|
|
821
|
+
# Name the most-recently-pushed (weight, m, v) triple in a block.
|
|
822
|
+
# Used right after ft_add_2d / ft_add_1d so drift/grad event consumers
|
|
823
|
+
# see llama.cpp-convention names like "blk.0.attn_norm.weight" instead
|
|
824
|
+
# of ggml's auto-generated "node_N". toy#semantic-tensor-names.
|
|
825
|
+
def ft_name_last(blk, name)
|
|
826
|
+
last = blk.ft_weights.length - 1
|
|
827
|
+
TinyNN.tnn_tensor_set_name(blk.ft_weights[last], name)
|
|
828
|
+
TinyNN.tnn_tensor_set_name(blk.ft_m[last], name + ".m")
|
|
829
|
+
TinyNN.tnn_tensor_set_name(blk.ft_v[last], name + ".v")
|
|
830
|
+
end
|
|
831
|
+
|
|
832
|
+
def ft_name_last_global(name)
|
|
833
|
+
last = @ft_globals_weights.length - 1
|
|
834
|
+
TinyNN.tnn_tensor_set_name(@ft_globals_weights[last], name)
|
|
835
|
+
TinyNN.tnn_tensor_set_name(@ft_globals_m[last], name + ".m")
|
|
836
|
+
TinyNN.tnn_tensor_set_name(@ft_globals_v[last], name + ".v")
|
|
837
|
+
end
|
|
838
|
+
|
|
839
|
+
# Name a single FROZEN global (e.g. the projection-lens donor embed, which is
|
|
840
|
+
# NOT pushed to @ft_globals so ft_name_last_global cannot reach it). Kept on
|
|
841
|
+
# the engine so this tnn_tensor_set_name(:str) FFI stays on the cache realize
|
|
842
|
+
# runtime path — same discipline as ft_name_last / lora_name_q!. Back-called
|
|
843
|
+
# by LlamaArch#alloc_globals_trainable_f32!.
|
|
844
|
+
def name_global!(t, name)
|
|
845
|
+
TinyNN.tnn_tensor_set_name(t, name)
|
|
846
|
+
end
|
|
847
|
+
|
|
848
|
+
# P2.7 — LoRA-Q tensor naming callbacks for the extracted block-side
|
|
849
|
+
# mmap loader (TransformerBlock#load_from_gguf_mmap!). The :str
|
|
850
|
+
# tnn_tensor_set_name FFI calls MUST stay on the cache realize RUNTIME
|
|
851
|
+
# path — never migrate into block class-load scope (step_bind / :str
|
|
852
|
+
# landmine #16). The block assembles the runtime name string and hands
|
|
853
|
+
# it here, exactly as it hands ft_name_last its assembled name. Verbatim
|
|
854
|
+
# lift of the former realize_for_mmap loop lines 567-570 / 597-604.
|
|
855
|
+
def lora_name_q!(t_a, t_b, head_prefix)
|
|
856
|
+
TinyNN.tnn_tensor_set_name(t_a, head_prefix + ".lora_a.weight")
|
|
857
|
+
TinyNN.tnn_tensor_set_name(t_b, head_prefix + ".lora_b.weight")
|
|
858
|
+
end
|
|
859
|
+
|
|
860
|
+
def lora_name_q_adam!(t_a_m, t_a_v, t_b_m, t_b_v, head_prefix)
|
|
861
|
+
TinyNN.tnn_tensor_set_name(t_a_m, head_prefix + ".lora_a.m")
|
|
862
|
+
TinyNN.tnn_tensor_set_name(t_a_v, head_prefix + ".lora_a.v")
|
|
863
|
+
TinyNN.tnn_tensor_set_name(t_b_m, head_prefix + ".lora_b.m")
|
|
864
|
+
TinyNN.tnn_tensor_set_name(t_b_v, head_prefix + ".lora_b.v")
|
|
865
|
+
end
|
|
866
|
+
|
|
867
|
+
# Same shape as ft_add_2d / ft_add_1d but writes to the cache-level
|
|
868
|
+
# globals arrays (token_embed, final-norm, untied output).
|
|
869
|
+
def ft_add_global_2d(weight, rows, cols)
|
|
870
|
+
@ft_globals_weights.push(weight)
|
|
871
|
+
@ft_globals_m.push(TinyNN.tnn_input_2d_f32_persistent(@sess, rows, cols))
|
|
872
|
+
@ft_globals_v.push(TinyNN.tnn_input_2d_f32_persistent(@sess, rows, cols))
|
|
873
|
+
end
|
|
874
|
+
|
|
875
|
+
def ft_add_global_1d(weight)
|
|
876
|
+
n = TinyNN.tnn_tensor_nelements(weight)
|
|
877
|
+
@ft_globals_weights.push(weight)
|
|
878
|
+
@ft_globals_m.push(TinyNN.tnn_input_1d_f32_persistent(@sess, n))
|
|
879
|
+
@ft_globals_v.push(TinyNN.tnn_input_1d_f32_persistent(@sess, n))
|
|
880
|
+
end
|
|
881
|
+
|
|
882
|
+
# Load token_embed + final-norm + (untied) output from the GGUF
|
|
883
|
+
# into their now-allocated backend buffers.
|
|
884
|
+
def ft_load_globals(gguf, untied)
|
|
885
|
+
eidx = TinyNN.tnn_gguf_find_index(gguf, "token_embd.weight")
|
|
886
|
+
TinyNN.tnn_gguf_copy_to_persistent(gguf, eidx, @sess, self.t_seq_token_embed)
|
|
887
|
+
fnidx = TinyNN.tnn_gguf_find_index(gguf, "output_norm.weight")
|
|
888
|
+
TinyNN.tnn_gguf_copy_1d_to_persistent(gguf, fnidx, @sess, self.t_seq_final_norm_gamma)
|
|
889
|
+
if untied
|
|
890
|
+
oidx = TinyNN.tnn_gguf_find_index(gguf, "output.weight")
|
|
891
|
+
TinyNN.tnn_gguf_copy_to_persistent(gguf, oidx, @sess, self.t_seq_output)
|
|
892
|
+
end
|
|
893
|
+
end
|
|
894
|
+
|
|
895
|
+
def ft_zero_init_adam_globals
|
|
896
|
+
gi = 0
|
|
897
|
+
while gi < @ft_globals_weights.length
|
|
898
|
+
TinyNN.tnn_zero_tensor(@sess, @ft_globals_m[gi])
|
|
899
|
+
TinyNN.tnn_zero_tensor(@sess, @ft_globals_v[gi])
|
|
900
|
+
gi = gi + 1
|
|
901
|
+
end
|
|
902
|
+
end
|
|
903
|
+
|
|
904
|
+
# Pull bytes from the GGUF into each writable weight. Uses the
|
|
905
|
+
# existing C-side dequantize-and-copy primitives so a Q8 source
|
|
906
|
+
# transparently becomes F32 in the target tensor.
|
|
907
|
+
def ft_load_from_gguf(gguf, qkv_bias)
|
|
908
|
+
li = 0
|
|
909
|
+
while li < @seq_n_layers
|
|
910
|
+
blk = self.seq_blocks_ffi[li]
|
|
911
|
+
prefix = "blk." + li.to_s
|
|
912
|
+
|
|
913
|
+
rn1_idx = TinyNN.tnn_gguf_find_index(gguf, prefix + ".attn_norm.weight")
|
|
914
|
+
rn2_idx = TinyNN.tnn_gguf_find_index(gguf, prefix + ".ffn_norm.weight")
|
|
915
|
+
TinyNN.tnn_gguf_copy_1d_to_persistent(gguf, rn1_idx, @sess, blk.t_seq_rn1_gamma)
|
|
916
|
+
TinyNN.tnn_gguf_copy_1d_to_persistent(gguf, rn2_idx, @sess, blk.t_seq_rn2_gamma)
|
|
917
|
+
|
|
918
|
+
q_idx = TinyNN.tnn_gguf_find_index(gguf, prefix + ".attn_q.weight")
|
|
919
|
+
hq = 0
|
|
920
|
+
while hq < @seq_n_heads
|
|
921
|
+
TinyNN.tnn_gguf_copy_head_slice_to_persistent_native(gguf, q_idx, @sess,
|
|
922
|
+
blk.t_seq_w_q[hq], hq, @seq_n_heads, @seq_d_model, @seq_d_head)
|
|
923
|
+
hq = hq + 1
|
|
924
|
+
end
|
|
925
|
+
|
|
926
|
+
k_idx = TinyNN.tnn_gguf_find_index(gguf, prefix + ".attn_k.weight")
|
|
927
|
+
v_idx = TinyNN.tnn_gguf_find_index(gguf, prefix + ".attn_v.weight")
|
|
928
|
+
hkv = 0
|
|
929
|
+
while hkv < @seq_n_kv
|
|
930
|
+
TinyNN.tnn_gguf_copy_head_slice_to_persistent_native(gguf, k_idx, @sess,
|
|
931
|
+
blk.t_seq_w_k[hkv], hkv, @seq_n_kv, @seq_d_model, @seq_d_head)
|
|
932
|
+
TinyNN.tnn_gguf_copy_head_slice_to_persistent_native(gguf, v_idx, @sess,
|
|
933
|
+
blk.t_seq_w_v[hkv], hkv, @seq_n_kv, @seq_d_model, @seq_d_head)
|
|
934
|
+
hkv = hkv + 1
|
|
935
|
+
end
|
|
936
|
+
|
|
937
|
+
if qkv_bias
|
|
938
|
+
# qbias / kbias / vbias are 1-D head-sliced. We don't have a
|
|
939
|
+
# dedicated head-slice loader for them; fall through and use
|
|
940
|
+
# tnn_gguf_copy_head_bias_slice_to_persistent.
|
|
941
|
+
qb_idx = TinyNN.tnn_gguf_find_index(gguf, prefix + ".attn_q.bias")
|
|
942
|
+
kb_idx = TinyNN.tnn_gguf_find_index(gguf, prefix + ".attn_k.bias")
|
|
943
|
+
vb_idx = TinyNN.tnn_gguf_find_index(gguf, prefix + ".attn_v.bias")
|
|
944
|
+
hbq = 0
|
|
945
|
+
while hbq < @seq_n_heads
|
|
946
|
+
TinyNN.tnn_gguf_copy_head_bias_slice_to_persistent(gguf, qb_idx, @sess,
|
|
947
|
+
blk.t_seq_b_q[hbq], hbq, @seq_d_head)
|
|
948
|
+
hbq = hbq + 1
|
|
949
|
+
end
|
|
950
|
+
hbkv = 0
|
|
951
|
+
while hbkv < @seq_n_kv
|
|
952
|
+
TinyNN.tnn_gguf_copy_head_bias_slice_to_persistent(gguf, kb_idx, @sess,
|
|
953
|
+
blk.t_seq_b_k[hbkv], hbkv, @seq_d_head)
|
|
954
|
+
TinyNN.tnn_gguf_copy_head_bias_slice_to_persistent(gguf, vb_idx, @sess,
|
|
955
|
+
blk.t_seq_b_v[hbkv], hbkv, @seq_d_head)
|
|
956
|
+
hbkv = hbkv + 1
|
|
957
|
+
end
|
|
958
|
+
end
|
|
959
|
+
|
|
960
|
+
o_idx = TinyNN.tnn_gguf_find_index(gguf, prefix + ".attn_output.weight")
|
|
961
|
+
gate_idx = TinyNN.tnn_gguf_find_index(gguf, prefix + ".ffn_gate.weight")
|
|
962
|
+
up_idx = TinyNN.tnn_gguf_find_index(gguf, prefix + ".ffn_up.weight")
|
|
963
|
+
down_idx = TinyNN.tnn_gguf_find_index(gguf, prefix + ".ffn_down.weight")
|
|
964
|
+
TinyNN.tnn_gguf_copy_to_persistent(gguf, o_idx, @sess, blk.t_seq_w_o)
|
|
965
|
+
TinyNN.tnn_gguf_copy_to_persistent(gguf, gate_idx, @sess, blk.t_seq_w_gate)
|
|
966
|
+
TinyNN.tnn_gguf_copy_to_persistent(gguf, up_idx, @sess, blk.t_seq_w_up)
|
|
967
|
+
TinyNN.tnn_gguf_copy_to_persistent(gguf, down_idx, @sess, blk.t_seq_w_down)
|
|
968
|
+
|
|
969
|
+
li = li + 1
|
|
970
|
+
end
|
|
971
|
+
end
|
|
972
|
+
|
|
973
|
+
# Zero-init the Adam moments. m and v both start at 0 per the
|
|
974
|
+
# AdamW step-0 contract. Uses the backend-side memset primitive
|
|
975
|
+
# (tnn_zero_tensor) so a 1 GB Adam state doesn't materialize a
|
|
976
|
+
# Mat-of-zeros in Ruby first.
|
|
977
|
+
def ft_zero_init_adam(qkv_bias)
|
|
978
|
+
li = 0
|
|
979
|
+
while li < @seq_n_layers
|
|
980
|
+
blk = self.seq_blocks_ffi[li]
|
|
981
|
+
i = 0
|
|
982
|
+
while i < blk.ft_weights.length
|
|
983
|
+
TinyNN.tnn_zero_tensor(@sess, blk.ft_m[i])
|
|
984
|
+
TinyNN.tnn_zero_tensor(@sess, blk.ft_v[i])
|
|
985
|
+
i = i + 1
|
|
986
|
+
end
|
|
987
|
+
li = li + 1
|
|
988
|
+
end
|
|
989
|
+
end
|
|
990
|
+
|
|
991
|
+
# P2.6 — finalize the backend weight buffers and upload the
|
|
992
|
+
# per-model constants that depend on the buffers existing. This is
|
|
993
|
+
# the identical head-of-tail shared by all four realize_for_* paths:
|
|
994
|
+
# 1. allocate the B>1 block-causal mask in ctx_w (NULL at B=1),
|
|
995
|
+
# 2. tnn_finalize_weights,
|
|
996
|
+
# 3. upload the llama3 RoPE freq_factors (no-op unless :llama3),
|
|
997
|
+
# 4. upload the B>1 block-causal mask values.
|
|
998
|
+
# Stays a CACHE method: the finalize FFI sequencing is session-scoped.
|
|
999
|
+
# Gate-covered end-to-end by smoke_projection_lens (B=1, non-llama3):
|
|
1000
|
+
# the two inner branches are dead under the gate but relocate verbatim.
|
|
1001
|
+
def finalize_weights_and_upload_constants!
|
|
1002
|
+
# GH#7 — block-causal attention mask for B>1. At B=1 the mask stays
|
|
1003
|
+
# NULL and build_seq_qhead uses diag_mask_inf + softmax. Allocated
|
|
1004
|
+
# in ctx_w as f32 persistent so it survives reset_for_rebuild.
|
|
1005
|
+
if @seq_b > 1
|
|
1006
|
+
tb_alloc = @seq_t * @seq_b
|
|
1007
|
+
@t_seq_attn_mask = TinyNN.tnn_input_2d_f32_persistent(@sess, tb_alloc, tb_alloc)
|
|
1008
|
+
end
|
|
1009
|
+
|
|
1010
|
+
TinyNN.tnn_finalize_weights(@sess)
|
|
1011
|
+
|
|
1012
|
+
# Upload llama3-style RoPE freq_factors once the backend buffer
|
|
1013
|
+
# exists. Per-model constant; never re-uploaded.
|
|
1014
|
+
if @seq_rope_scaling.kind == :llama3
|
|
1015
|
+
ff = Toy::RopeScaling.compute_llama3_freq_factors(
|
|
1016
|
+
@seq_d_head, @seq_rope_base,
|
|
1017
|
+
@seq_rope_scaling.orig_max_pos, @seq_rope_scaling.factor,
|
|
1018
|
+
@seq_rope_scaling.low_freq_factor, @seq_rope_scaling.high_freq_factor)
|
|
1019
|
+
TinyNN.tnn_upload_from_float_array(@sess, @t_seq_rope_freq_factors, ff, ff.length)
|
|
1020
|
+
end
|
|
1021
|
+
|
|
1022
|
+
if @seq_b > 1
|
|
1023
|
+
upload_block_causal_mask!
|
|
1024
|
+
end
|
|
1025
|
+
end
|
|
1026
|
+
|
|
1027
|
+
# P2.6 — the identical tail-of-tail shared by all four realize_for_*
|
|
1028
|
+
# paths: build the forward graph in the current ctx, realize it, and
|
|
1029
|
+
# flip @seq_realized. Stays a CACHE method (build_forward_in_current_ctx
|
|
1030
|
+
# is the cache->arch wrapper; tnn_realize is session-scoped).
|
|
1031
|
+
# Gate-covered by smoke_projection_lens via realize_for_random_init.
|
|
1032
|
+
def build_and_realize!
|
|
1033
|
+
build_forward_in_current_ctx
|
|
1034
|
+
TinyNN.tnn_realize(@sess, @t_seq_logits)
|
|
1035
|
+
@seq_realized = true
|
|
1036
|
+
end
|
|
1037
|
+
|
|
1038
|
+
# Build the forward graph in the CURRENT compute context. Used both
|
|
1039
|
+
# from realize_for_mmap (first realize) and after tnn_reset_for_rebuild
|
|
1040
|
+
# (e.g. when switching from inference to training, which needs the
|
|
1041
|
+
# forward + loss + backward + opt_step all in one rebuilt ctx).
|
|
1042
|
+
# Stores the per-graph tensor handles back on `self`.
|
|
1043
|
+
# P2.5 — thin wrapper around Toy::LLM::Archs::LlamaArch#build_forward.
|
|
1044
|
+
# Allocates the per-graph INPUT handles (token_ids, positions) — which
|
|
1045
|
+
# stay CACHE-owned graph I/O, read by forward() and the uploaders —
|
|
1046
|
+
# then hands the realize-set rope_cfg / donor_d_in onto the arch and
|
|
1047
|
+
# calls the lifted orchestration. The three per-graph OUTPUT handles
|
|
1048
|
+
# come back in a LlamaArchForwardOut and are spread onto the cache's
|
|
1049
|
+
# own ivars so every downstream reader (@t_seq_logits accessor,
|
|
1050
|
+
# build_training_step CE-loss consumer, examples/06 fcache.t_seq_logits)
|
|
1051
|
+
# is untouched.
|
|
1052
|
+
def build_forward_in_current_ctx
|
|
1053
|
+
# GH#7 — at B=1, @seq_t * @seq_b == @seq_t (legacy behaviour).
|
|
1054
|
+
# At B>1, the layout is flat [T*B]: per-batch positions cycle
|
|
1055
|
+
# 0..T-1 (the caller-built positions array is responsible for
|
|
1056
|
+
# that ordering); RoPE applies per-batch positional encoding
|
|
1057
|
+
# because rope_ext reads positions[k] for each ne[2] slot.
|
|
1058
|
+
tb = @seq_t * @seq_b
|
|
1059
|
+
@t_seq_token_ids = TinyNN.tnn_input_1d_i32(@sess, tb)
|
|
1060
|
+
@t_seq_positions = TinyNN.tnn_input_1d_i32_ctx(@sess, tb)
|
|
1061
|
+
|
|
1062
|
+
# The arch reads seq_rope_cfg / seq_donor_d_in off itself; the cache
|
|
1063
|
+
# rebuilds rope_cfg and sets donor_d_in in each realize prologue, so
|
|
1064
|
+
# mirror the realize-set values onto the arch right before the call.
|
|
1065
|
+
@seq_arch.seq_rope_cfg = @seq_rope_cfg
|
|
1066
|
+
@seq_arch.seq_donor_d_in = @seq_donor_d_in
|
|
1067
|
+
|
|
1068
|
+
out = @seq_arch.build_forward(
|
|
1069
|
+
@sess, @t_seq_token_ids, @t_seq_positions, @t_seq_rope_freq_factors,
|
|
1070
|
+
@t_seq_attn_mask, @seq_rms_eps, @seq_d_head, @seq_n_kv, @seq_n_heads,
|
|
1071
|
+
@seq_group_size, @seq_has_qkv_bias, @seq_weight_dtype,
|
|
1072
|
+
@seq_lora_q_enabled, @seq_t, @seq_b, @seq_n_layers,
|
|
1073
|
+
@seq_has_untied_output)
|
|
1074
|
+
|
|
1075
|
+
@t_seq_x_embed = out.t_seq_x_embed
|
|
1076
|
+
@t_seq_x_final = out.t_seq_x_final
|
|
1077
|
+
@t_seq_logits = out.t_seq_logits
|
|
1078
|
+
end
|
|
1079
|
+
|
|
1080
|
+
# M3 step 3 — rebuild the session graph as forward + CE loss + backward
|
|
1081
|
+
# + AdamW opt_step over every LoRA pair. After this, callers upload
|
|
1082
|
+
# token IDs + positions + labels (one-hot vocab×T) + hp vector and
|
|
1083
|
+
# call tnn_compute_backward to get one training step over the whole
|
|
1084
|
+
# T-position sequence.
|
|
1085
|
+
#
|
|
1086
|
+
# Returns the (loss_tensor, labels_tensor, hp_tensor) triple.
|
|
1087
|
+
def build_training_step
|
|
1088
|
+
if !@seq_full_finetune_enabled && (!@seq_lora_q_enabled || !@seq_lora_q_adamw_enabled)
|
|
1089
|
+
puts "build_training_step: requires enable_lora_q! AND enable_lora_q_adamw! (or enable_full_finetune!)"
|
|
1090
|
+
return nil
|
|
1091
|
+
end
|
|
1092
|
+
TinyNN.tnn_reset_for_rebuild(@sess)
|
|
1093
|
+
build_forward_in_current_ctx
|
|
1094
|
+
|
|
1095
|
+
# Label tensor: same shape as logits, ggml ne=[vocab, T*B]. Our
|
|
1096
|
+
# wrapper takes (rows, cols) and emits ggml(cols, rows), so pass
|
|
1097
|
+
# (T*B, vocab) here to get ne=[vocab, T*B]. One-hot per ne1-column
|
|
1098
|
+
# (i.e. per (batch, position) slot). At B=1, identical to legacy.
|
|
1099
|
+
t_labels = TinyNN.tnn_input_2d_f32(@sess, @seq_t * @seq_b, @seq_vocab_size)
|
|
1100
|
+
# Hyper-params vector for AdamW: alpha, beta1, beta2, eps, wd, beta1h, beta2h.
|
|
1101
|
+
t_hp = TinyNN.tnn_input_1d_f32(@sess, 7)
|
|
1102
|
+
|
|
1103
|
+
# CE loss over all T columns. ggml_cross_entropy_loss returns the
|
|
1104
|
+
# mean over columns — masking is a follow-up (would zero specific
|
|
1105
|
+
# columns in labels before this op).
|
|
1106
|
+
t_loss = TinyNN.tnn_cross_entropy_loss(@sess, @t_seq_logits, t_labels)
|
|
1107
|
+
TinyNN.tnn_set_output(t_loss)
|
|
1108
|
+
TinyNN.tnn_set_loss(t_loss)
|
|
1109
|
+
|
|
1110
|
+
TinyNN.tnn_build_forward_only(@sess, t_loss)
|
|
1111
|
+
TinyNN.tnn_build_backward(@sess)
|
|
1112
|
+
|
|
1113
|
+
if @seq_full_finetune_enabled
|
|
1114
|
+
# F3 — emit opt_step_adamw for every recorded (weight, m, v)
|
|
1115
|
+
# triple. The arrays are populated in realize_for_full_finetune.
|
|
1116
|
+
li = 0
|
|
1117
|
+
while li < @seq_n_layers
|
|
1118
|
+
blk = self.seq_blocks_ffi[li]
|
|
1119
|
+
wi = 0
|
|
1120
|
+
while wi < blk.ft_weights.length
|
|
1121
|
+
tw = blk.ft_weights[wi]
|
|
1122
|
+
tg = TinyNN.tnn_tensor_grad(@sess, tw)
|
|
1123
|
+
to = TinyNN.tnn_opt_step_adamw(@sess, tw, tg,
|
|
1124
|
+
blk.ft_m[wi], blk.ft_v[wi], t_hp)
|
|
1125
|
+
TinyNN.tnn_extend_backward_graph(@sess, to)
|
|
1126
|
+
wi = wi + 1
|
|
1127
|
+
end
|
|
1128
|
+
li = li + 1
|
|
1129
|
+
end
|
|
1130
|
+
# Globals (token_embed, final-norm, optional untied output).
|
|
1131
|
+
gi = 0
|
|
1132
|
+
while gi < @ft_globals_weights.length
|
|
1133
|
+
tw = @ft_globals_weights[gi]
|
|
1134
|
+
tg = TinyNN.tnn_tensor_grad(@sess, tw)
|
|
1135
|
+
to = TinyNN.tnn_opt_step_adamw(@sess, tw, tg,
|
|
1136
|
+
@ft_globals_m[gi], @ft_globals_v[gi], t_hp)
|
|
1137
|
+
TinyNN.tnn_extend_backward_graph(@sess, to)
|
|
1138
|
+
gi = gi + 1
|
|
1139
|
+
end
|
|
1140
|
+
else
|
|
1141
|
+
# LoRA-only training (M3 step 3). One opt_step_adamw per LoRA-A
|
|
1142
|
+
# and per LoRA-B tensor; thread each through extend_backward_graph
|
|
1143
|
+
# so sched sees the writes.
|
|
1144
|
+
li = 0
|
|
1145
|
+
while li < @seq_n_layers
|
|
1146
|
+
blk = self.seq_blocks_ffi[li]
|
|
1147
|
+
hq = 0
|
|
1148
|
+
while hq < @seq_n_heads
|
|
1149
|
+
t_a = blk.t_seq_w_lora_a_q[hq]
|
|
1150
|
+
t_b = blk.t_seq_w_lora_b_q[hq]
|
|
1151
|
+
t_grad_a = TinyNN.tnn_tensor_grad(@sess, t_a)
|
|
1152
|
+
t_grad_b = TinyNN.tnn_tensor_grad(@sess, t_b)
|
|
1153
|
+
t_opt_a = TinyNN.tnn_opt_step_adamw(@sess, t_a, t_grad_a,
|
|
1154
|
+
blk.t_seq_w_lora_a_q_m[hq],
|
|
1155
|
+
blk.t_seq_w_lora_a_q_v[hq], t_hp)
|
|
1156
|
+
t_opt_b = TinyNN.tnn_opt_step_adamw(@sess, t_b, t_grad_b,
|
|
1157
|
+
blk.t_seq_w_lora_b_q_m[hq],
|
|
1158
|
+
blk.t_seq_w_lora_b_q_v[hq], t_hp)
|
|
1159
|
+
TinyNN.tnn_extend_backward_graph(@sess, t_opt_a)
|
|
1160
|
+
TinyNN.tnn_extend_backward_graph(@sess, t_opt_b)
|
|
1161
|
+
hq = hq + 1
|
|
1162
|
+
end
|
|
1163
|
+
li = li + 1
|
|
1164
|
+
end
|
|
1165
|
+
end
|
|
1166
|
+
|
|
1167
|
+
# Pin every node in graph_b before sched-alloc — workaround for the
|
|
1168
|
+
# ggml-cpu sched-aliasing bug on long backward chains (documented in
|
|
1169
|
+
# project_cpu_cuda_lora_train_divergence_2026_05_21). Memory cost
|
|
1170
|
+
# grows roughly with node count; fine for SmolLM2-135M at T<=64.
|
|
1171
|
+
TinyNN.tnn_pin_all_graph_b_nodes(@sess)
|
|
1172
|
+
TinyNN.tnn_realize_backward(@sess)
|
|
1173
|
+
[t_loss, t_labels, t_hp]
|
|
1174
|
+
end
|
|
1175
|
+
|
|
1176
|
+
# GGUF type → bytes-per-row stride for per-head slicing. Mirrors the
|
|
1177
|
+
# SmolLM2KVFFICache helper of the same name. F32=0, Q8_0=8.
|
|
1178
|
+
def head_nbytes(ggml_type, d_head, d_model)
|
|
1179
|
+
if ggml_type == 0
|
|
1180
|
+
d_head * d_model * 4
|
|
1181
|
+
elsif ggml_type == 8
|
|
1182
|
+
d_head * (d_model / 32) * 34
|
|
1183
|
+
else
|
|
1184
|
+
0
|
|
1185
|
+
end
|
|
1186
|
+
end
|
|
1187
|
+
|
|
1188
|
+
# Run one forward pass. `ids` and `positions` are length-T Int arrays.
|
|
1189
|
+
# Returns the t_seq_logits handle; caller downloads via download_row_major
|
|
1190
|
+
# against (vocab, T) shape.
|
|
1191
|
+
def forward(ids, positions)
|
|
1192
|
+
TinyNN.upload_int_array(@sess, @t_seq_token_ids, ids)
|
|
1193
|
+
TinyNN.upload_int_array(@sess, @t_seq_positions, positions)
|
|
1194
|
+
TinyNN.tnn_compute(@sess)
|
|
1195
|
+
@t_seq_logits
|
|
1196
|
+
end
|
|
1197
|
+
|
|
1198
|
+
# Seed LoRA-A with a small Gaussian and LoRA-B with zero — the
|
|
1199
|
+
# standard init makes the adapter a no-op at step 0 (forward output
|
|
1200
|
+
# equals the base model). Mirror of SmolLM2KVFFICache#upload_lora_q_init!.
|
|
1201
|
+
def upload_lora_q_init!(seed, init_scale)
|
|
1202
|
+
if !@seq_lora_q_enabled; return; end
|
|
1203
|
+
s = seed
|
|
1204
|
+
m_a = Mat.new(@seq_lora_q_rank, @seq_d_model)
|
|
1205
|
+
m_b = Mat.new(@seq_d_head, @seq_lora_q_rank)
|
|
1206
|
+
i_b = 0
|
|
1207
|
+
while i_b < @seq_d_head * @seq_lora_q_rank
|
|
1208
|
+
m_b.flat[i_b] = 0.0
|
|
1209
|
+
i_b = i_b + 1
|
|
1210
|
+
end
|
|
1211
|
+
li = 0
|
|
1212
|
+
while li < @seq_n_layers
|
|
1213
|
+
blk = self.seq_blocks_ffi[li]
|
|
1214
|
+
hq = 0
|
|
1215
|
+
while hq < @seq_n_heads
|
|
1216
|
+
ii = 0
|
|
1217
|
+
while ii < @seq_lora_q_rank * @seq_d_model
|
|
1218
|
+
s = (s * 1103515245 + 12345) & 0x7FFFFFFF
|
|
1219
|
+
u1 = (s.to_f + 1.0) / 2147483648.0
|
|
1220
|
+
s = (s * 1103515245 + 12345) & 0x7FFFFFFF
|
|
1221
|
+
u2 = (s.to_f + 1.0) / 2147483648.0
|
|
1222
|
+
m_a.flat[ii] = init_scale * Math.sqrt(-2.0 * Math.log(u1)) * Math.cos(2.0 * Math::PI * u2)
|
|
1223
|
+
ii = ii + 1
|
|
1224
|
+
end
|
|
1225
|
+
TinyNN.upload_row_major(@sess, blk.t_seq_w_lora_a_q[hq], m_a)
|
|
1226
|
+
TinyNN.upload_row_major(@sess, blk.t_seq_w_lora_b_q[hq], m_b)
|
|
1227
|
+
hq = hq + 1
|
|
1228
|
+
end
|
|
1229
|
+
li = li + 1
|
|
1230
|
+
end
|
|
1231
|
+
end
|
|
1232
|
+
end
|
|
1233
|
+
end; end; end
|