]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
vulkan: support larger argsort (llama/17313)
authorJeff Bolz <redacted>
Wed, 19 Nov 2025 16:25:50 +0000 (10:25 -0600)
committerGeorgi Gerganov <redacted>
Fri, 12 Dec 2025 15:53:04 +0000 (17:53 +0200)
commit95d0b0b0cfadd797feb6b8f14c9ec69e2a44d1c0
tree430b2cc9fe109b2334835d3631518fbb28ae85ca
parentae8865c6e693a224b7721876cf8f85e53a43a469
vulkan: support larger argsort (llama/17313)

* vulkan: support larger argsort

This is an extension of the original bitonic sorting shader that puts the
temporary values in global memory and when more than 1024 threads are needed
it runs multiple workgroups and synchronizes through a pipelinebarrier.

To improve the memory access pattern, a copy of the float value is kept with
the index value. I've applied this same change to the original shared memory
version of the shader, which is still used when ncols <= 1024.

* Reduce the number of shader variants. Use smaller workgroups when doing a single pass, for a modest perf boost

* reduce loop overhead

* run multiple cols per invocation, to reduce barrier overhead
ggml/src/ggml-vulkan/ggml-vulkan.cpp
ggml/src/ggml-vulkan/vulkan-shaders/argsort.comp
ggml/src/ggml-vulkan/vulkan-shaders/argsort_large.comp [new file with mode: 0644]
ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp