]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
vulkan: Multi-pass softmax for large number of cols (llama/17892)
authorJeff Bolz <redacted>
Sat, 13 Dec 2025 09:04:29 +0000 (03:04 -0600)
committerGeorgi Gerganov <redacted>
Thu, 18 Dec 2025 06:20:56 +0000 (08:20 +0200)
commit939d3085e99939317380cc60e277e992b5fbc97f
treea6c1613ce86c8da255ffdb9021eee070a1b41706
parent13bb296dbf393edf3dca86756566d1ed7c183081
vulkan: Multi-pass softmax for large number of cols (llama/17892)

When the number of cols is large, split each row across multiple workgroups.
There are three phases that communicate partial results through temp buffers:
(1) compute max partials
(2) take max of partials, compute sum(exp(x-max)) partials
(3) sum partials, compute scaled result
ggml/src/ggml-vulkan/ggml-vulkan.cpp
ggml/src/ggml-vulkan/vulkan-shaders/soft_max_large1.comp [new file with mode: 0644]
ggml/src/ggml-vulkan/vulkan-shaders/soft_max_large2.comp [new file with mode: 0644]
ggml/src/ggml-vulkan/vulkan-shaders/soft_max_large3.comp [new file with mode: 0644]
ggml/src/ggml-vulkan/vulkan-shaders/soft_max_large_common.glsl [new file with mode: 0644]
ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp