]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
vulkan: sort graph to allow more parallel execution (#15850)
authorJeff Bolz <redacted>
Mon, 8 Sep 2025 18:10:07 +0000 (13:10 -0500)
committerGitHub <redacted>
Mon, 8 Sep 2025 18:10:07 +0000 (02:10 +0800)
commite68aa10d8f3d26fdad5b912540362d79de5460e3
treefd12e957a72c2d946741b4a0038a03e5c7397a6a
parent0a16bf52e6874369cb4fd2bdc4863ef984b688e7
vulkan: sort graph to allow more parallel execution (#15850)

* vulkan: sort graph to allow more parallel execution

Add a backend proc to allow the backend to modify the graph. The
vulkan implementation looks at which nodes depend on each other
and greedily reorders them to group together nodes that don't
depend on each other. It only reorders the nodes, doesn't change
the contents of any of them.

With #15489, this reduces the number of synchronizations needed.

* call optimize_graph per-split
13 files changed:
ggml/src/ggml-backend-impl.h
ggml/src/ggml-backend.cpp
ggml/src/ggml-blas/ggml-blas.cpp
ggml/src/ggml-cann/ggml-cann.cpp
ggml/src/ggml-cpu/ggml-cpu.cpp
ggml/src/ggml-cuda/ggml-cuda.cu
ggml/src/ggml-metal/ggml-metal.m
ggml/src/ggml-opencl/ggml-opencl.cpp
ggml/src/ggml-rpc/ggml-rpc.cpp
ggml/src/ggml-sycl/ggml-sycl.cpp
ggml/src/ggml-vulkan/ggml-vulkan.cpp
ggml/src/ggml-webgpu/ggml-webgpu.cpp
ggml/src/ggml-zdnn/ggml-zdnn.cpp