mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
* vulkan: optimize rms_norm, and allow the work to spread across multiple SMs There are really two parts to this change: (1) Some optimizations similar to what we have in soft_max, to unroll with different numbers of iterations. (2) A fusion optimization where we detect add followed by rms_norm, and make the add shader atomically accumulate the values^2 into memory. Then the rms_norm shader can just load that sum. This allows the rms_norm to be parallelized across multiple workgroups, it just becomes a simple per-element multiply. The fusion optimization is currently only applied when the rms_norm is on a single vector. This previously always ran on a single SM. It could apply more broadly, but when there are other dimensions the work can already spread across SMs, and there would be some complexity to tracking multiple atomic sums. * Change add+rms_norm optimization to write out an array of partial sums rather than using atomic add, to make it deterministic. The rms_norm shader fetches a subgroup's worth in parallel and uses subgroupAdd to add them up. * complete rebase against fused adds - multi_add shader can also compute partial sums * fix validation errors * disable add_rms_fusion for Intel due to possible driver bug * resolve against #15489, sync after clearing partial sums |
||
---|---|---|
.. | ||
.gitignore | ||
CMakeLists.txt | ||
get-model.cpp | ||
get-model.h | ||
run-json-schema-to-grammar.mjs | ||
test-arg-parser.cpp | ||
test-autorelease.cpp | ||
test-backend-ops.cpp | ||
test-barrier.cpp | ||
test-c.c | ||
test-chat-parser.cpp | ||
test-chat-template.cpp | ||
test-chat.cpp | ||
test-double-float.cpp | ||
test-gbnf-validator.cpp | ||
test-gguf.cpp | ||
test-grammar-integration.cpp | ||
test-grammar-llguidance.cpp | ||
test-grammar-parser.cpp | ||
test-json-partial.cpp | ||
test-json-schema-to-grammar.cpp | ||
test-llama-grammar.cpp | ||
test-log.cpp | ||
test-lora-conversion-inference.sh | ||
test-model-load-cancel.cpp | ||
test-mtmd-c-api.c | ||
test-opt.cpp | ||
test-quantize-fns.cpp | ||
test-quantize-perf.cpp | ||
test-quantize-stats.cpp | ||
test-regex-partial.cpp | ||
test-rope.cpp | ||
test-sampling.cpp | ||
test-thread-safety.cpp | ||
test-tokenizer-0.cpp | ||
test-tokenizer-0.py | ||
test-tokenizer-0.sh | ||
test-tokenizer-1-bpe.cpp | ||
test-tokenizer-1-spm.cpp | ||
test-tokenizer-random.py | ||
test-tokenizers-repo.sh |