]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
vulkan: sort graph to allow more parallel execution (llama/15850)
authorJeff Bolz <redacted>
Mon, 8 Sep 2025 18:10:07 +0000 (13:10 -0500)
committerGeorgi Gerganov <redacted>
Sat, 20 Sep 2025 10:42:52 +0000 (13:42 +0300)
commitc29cd54818e1c1dce5f675a3d4810fff566082ba
treef62f98d260c9ecb4d7d9164a342337217b41d052
parent70ee808f3d4d95772e7be990f5c33c43ac3f6e7a
vulkan: sort graph to allow more parallel execution (llama/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