]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
mtmd/ggml: add ggml_build_forward_order (#26649)
authorPascal <redacted>
Wed, 5 Aug 2026 22:47:59 +0000 (00:47 +0200)
committerGitHub <redacted>
Wed, 5 Aug 2026 22:47:59 +0000 (00:47 +0200)
commitc8e03ce8122b7af76f836d53efde6df1ce5ec437
tree7d24ed113b5756b005081b9a842f89519088ad6c
parentf9e832c10e9444cb168ddcb579cc62c154f3068b
mtmd/ggml: add ggml_build_forward_order (#26649)

* ggml: add ggml_build_forward_order

ggml_build_forward_expand marks the tensor and all its ancestors for
compute, so using it as a pure ordering hint (keeping q, k and v
together) defeats ggml_build_forward_select: the unselected branch is
forced to run with inputs that were never uploaded. In the mtmd audio
graph this makes GEN_WAV calls execute the GEN_CODE branch with a
stale inp_code0, hitting the get_rows bound assert on CPU.

Add ggml_build_forward_order, which inserts nodes without the compute
flag; the flag is restored when the branch is actually selected.
Switch the q/k/v hints in clip_graph::build_attn to it.

* nit: reduce comments (AGENTS.md)
ggml/include/ggml.h
ggml/src/ggml.c
tools/mtmd/clip.cpp