]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
vulkan: support larger argsort (#17313)
authorJeff Bolz <redacted>
Wed, 19 Nov 2025 16:25:50 +0000 (10:25 -0600)
committerGitHub <redacted>
Wed, 19 Nov 2025 16:25:50 +0000 (17:25 +0100)
commit1fa4551af069358e29fe4c497c801b0dee85cb49
treec8a4082fb3f3ac0d26015a445d2aefe24fae9c76
parent2eba631b8127a5a4853ea625a0eac4a7449bc7b8
vulkan: support larger argsort (#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
tests/test-backend-ops.cpp