Skip to content

A learning measure's graphs carry their rows' sequence (the M5's crash loop under per-sequence genes) - #175

Open
joelteply wants to merge 1 commit into
fable/seq-adaptersfrom
fable/seq-genes-reserve
Open

joelteply wants to merge 1 commit into
fable/seq-adaptersfrom
fable/seq-genes-reserve

Conversation

@joelteply

Copy link
Copy Markdown

A learning measure's graphs carry their rows' sequence: the serving graph beside a retained learning graph left them null

The M5, 2026-11-29 21:26Z, core d7d5b23716 on this fork at 897c5bc: the core segfaulted about a second after every
boot (243 restarts) in llama_adapter_seq_sets::group, reading seq_id[i][0] through null. The stack: opt_measure_memory
-> graph_params -> seq_adapters_graph_params -> group, from the trainer's first measure_shadow_graph.

opt_measure_memory builds two graphs from ubatch_reserve, whose rows carry no sequence (seq_id null, n_seq_id 0). The
learning graph set each row to sequence 0; the serving graph it prices beside it set only the outputs. With no stream
naming genes, group() returned before reading a row; once a stream names hers (#172), every graph row's set is read.

  • one_sequence_with_outputs: the one place a measured ubatch gets its rows' sequence and outputs, used by both graphs.
  • group() asserts the contract (every graph row carries its sequence), so a caller that breaks it aborts naming it,
    never reads through null.
  • test-seq-adapters: the batch arm measures a shadow graph while mind 0 names her set, as the trainer's seat does.
    Without the fix it aborts on that assert (exit 134); with it the measure reports rows, and the test passes
    (qwen2.5-0.5b q4_k_m, Metal, M5).

Why not at the reserve itself: ubatch_reserve is upstream code (llama-batch.cpp), and fork additions stay in our own files. The callers that build graphs from a reserve are ours (llama-context-opt-measure.cpp) or already give rows their sequence (graph_reserve through ubatch_prepare_reserve), and group() asserts the contract for every graph built.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…raph beside a retained learning graph left them null

The M5, 2026-11-29 21:26Z, core d7d5b23716 on this fork at 897c5bc: the core segfaulted about a second after every
boot (243 restarts) in llama_adapter_seq_sets::group, reading seq_id[i][0] through null. The stack: opt_measure_memory
-> graph_params -> seq_adapters_graph_params -> group, from the trainer's first measure_shadow_graph.

opt_measure_memory builds two graphs from ubatch_reserve, whose rows carry no sequence (seq_id null, n_seq_id 0). The
learning graph set each row to sequence 0; the serving graph it prices beside it set only the outputs. With no stream
naming genes, group() returned before reading a row; once a stream names hers (#172), every graph row's set is read.

- one_sequence_with_outputs: the one place a measured ubatch gets its rows' sequence and outputs, used by both graphs.
- group() asserts the contract (every graph row carries its sequence), so a caller that breaks it aborts naming it,
  never reads through null.
- test-seq-adapters: the batch arm measures a shadow graph while mind 0 names her set, as the trainer's seat does.
  Without the fix it aborts on that assert (exit 134); with it the measure reports rows, and the test passes
  (qwen2.5-0.5b q4_k_m, Metal, M5).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant