]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
mtmd/ggml: add ggml_build_forward_order (llama/26649)
authorPascal <redacted>
Wed, 5 Aug 2026 22:47:59 +0000 (00:47 +0200)
committerGeorgi Gerganov <redacted>
Fri, 7 Aug 2026 18:59:49 +0000 (21:59 +0300)
commit60894f1e3766ef0224b57ad8840a83a66e05cb6f
tree3b387f9559ea8afc827b8c24c2c1c96fa73c8377
parent873102193ab7238fcccb4a9169a522eebbe4bc00
mtmd/ggml: add ggml_build_forward_order (llama/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