]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
vulkan: Optimize GGML_OP_CUMSUM (llama/18417)
authorJeff Bolz <redacted>
Fri, 2 Jan 2026 21:32:30 +0000 (15:32 -0600)
committerGeorgi Gerganov <redacted>
Sun, 11 Jan 2026 09:02:08 +0000 (11:02 +0200)
commitcca55fe330c357f9da2e65388deb7b712fa0d643
treebbcf33bd02104fc6ea577610633a31d4ae27fe76
parent89904ac87a879751cd652af4d5ecb70ce1001365
vulkan: Optimize GGML_OP_CUMSUM (llama/18417)

* vulkan: Optimize GGML_OP_CUMSUM

There are two paths: The preexisting one that does a whole row per workgroup
in a single shader, and one that splits each row into multiple blocks and does
two passes. The first pass computes partials within a block, the second adds
the block partials to compute the final result. The multipass shader is used
when there are a small number of large rows.

In the whole-row shader, handle multiple elements per invocation.

* use 2 ELEM_PER_THREAD for AMD/Intel

* address feedback
src/ggml-vulkan/ggml-vulkan.cpp
src/ggml-vulkan/vulkan-shaders/cumsum.comp
src/ggml-vulkan/vulkan-shaders/cumsum_multipass1.comp [new file with mode: 0644]
src/ggml-vulkan/vulkan-shaders/cumsum_multipass2.comp [new file with mode: 0644]
src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp