Skip to content

llama-graph: the hybrid input skips unallocated store indices in a training graph - #13

Merged
joelteply merged 1 commit into
feat/props-weight-residencyfrom
fix/hybrid-training-store-indices
Sep 27, 2026
Merged

joelteply merged 1 commit into
feat/props-weight-residencyfrom
fix/hybrid-training-store-indices

Conversation

@joelteply

Copy link
Copy Markdown

llm_graph_input_mem_hybrid::set_input wrote k_idxs/v_idxs unconditionally; in a training graph attention reads the ubatch K/V directly and those indices are unallocated, so it hit GGML_ASSERT(buffer), the same crash #6 fixed for the plain KV input. Qwen3.5/3.8 hybrids take this path. Found by reading, before the first 27B step; the step itself is the test.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…he plain KV input

llm_graph_input_mem_hybrid::set_input wrote k_idxs/v_idxs unconditionally. In a training
graph (cparams.training) attention reads this ubatch's K/V directly and never writes the
cache, so those indices are left unallocated and the write hit GGML_ASSERT(buffer): the
same crash the plain KV path had before #6 guarded llm_graph_input_attn_kv::set_input.
Qwen3.5/3.8-class hybrids take this path. Same guard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Author

APPROVED at 4faed7a. Read: llm_graph_input_mem_hybrid::set_input now skips k/v store indices whose buffer is null, the same guard #6 put on llm_graph_input_attn_kv::set_input; in a training graph build_attn reads this ubatch's K/V directly and never allocates them. Evidence: my first 27B in-engine attempt on the 5090 (trunk without this) aborted at exactly ggml-backend.cpp:204 GGML_ASSERT(buffer) right after adapter attach; the build with this commit cherry-picked got past graph build into the run (it then stopped on the unrelated serving/unload during a deploy). It is also carried in #14, whose in-server training ran clean.

@joelteply
joelteply merged commit e89a2cb into feat/props-weight-residency Sep 27, 2026
8 of 25 checks passed
@joelteply

Copy link
Copy Markdown
Author

CORRECTION to my comment above: the second 27B attempt never ran the finetune (the script stopped before training because serving/unload had not freed VRAM during a deploy), so 'got past graph build' was not measured. What IS measured: the first attempt aborted at ggml-backend.cpp:204 GGML_ASSERT(buffer), the line this guards. The word stands on the read (it is the same guard as the plain KV path); the 27B running past graph build is still to be shown, on the next 27B run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant