]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
vulkan: Optimize GGML_OP_CUMSUM (#18417)
authorJeff Bolz <redacted>
Fri, 2 Jan 2026 21:32:30 +0000 (15:32 -0600)
committerGitHub <redacted>
Fri, 2 Jan 2026 21:32:30 +0000 (15:32 -0600)
commit18ddaea2aecf7fbfe7acab77465808f3cf6200d3
treed7754e46c4fb0cbf3b87323e46f76b9eedf9754e
parent706e3f93a60109a40f1224eaf4af0d59caa7c3ae
vulkan: Optimize GGML_OP_CUMSUM (#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
ggml/src/ggml-vulkan/ggml-vulkan.cpp
ggml/src/ggml-vulkan/vulkan-shaders/cumsum.comp
ggml/src/ggml-vulkan/vulkan-shaders/cumsum_multipass1.comp [new file with mode: 0644]
ggml/src/ggml-vulkan/vulkan-shaders/cumsum_multipass2.comp [new file with mode: 0644]
ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp