Skip to content

engine: pin the fork at 178224903, the exact walk is exact on a GPU hybrid (fork #57) - #4980

Merged
joelteply merged 1 commit into
canaryfrom
engine/pin-178224903
Oct 12, 2026
Merged

joelteply merged 1 commit into
canaryfrom
engine/pin-178224903

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Moves core/vendor/llama.cpp from da4915987 to 178224903, the squash merge of CambrianTech/llama.cpp#57 (tree identical to the reviewed head 33322b19d). No change to include/ or tools/server/, so the core needs no edits.

What it fixes. The exact walk read and restored the recurrent state right after a decode it had only queued. On Metal the snapshot carried a torn mid-graph state into the backward pass, so a hybrid base such as Kimi's trained on a gradient about 0.93 to 0.94 aligned with the true one. The fork now synchronizes before the checkpoint and stores it through llama_state_seq_get/set_data.

Measured (fork 33322b19d = 178224903's tree, M5 Metal)

  • qwen3.5-4b hybrid Q4_K_M, test-walk-exact: before the fix, exact walk vs one graph cosine 0.9255 (af1a3c933, 2026-10-11T20:55:54Z). Now exit 0, every exact row cosine 1.0000, training losses 3.252877 / 3.126584 / 2.910862 (2026-10-12T12:18:19Z).

  • qwen2.5-0.5b pure attention: exit 0 (12:19:15Z).

  • Device graph, 4B, chunk 512, recurrent gradients in host accumulators (4da182d9a, 01:01:13Z):

    Window Explicit attention MiB Flash attention MiB
    4096 3778.6 → 1683.3 3971.2 → 2031.8
    32768 5897.4 → 3502.5 5970.5 → 4257.8

Measured after deploy

  • Owner: BigMama. On the 5090, run test-walk-exact on the 4B hybrid with CUDA at 2394a4ca7 (before the fix) and 178224903. That CUDA tears the same way is an INFERENCE from ggml-cuda.cu:799-800, unmeasured; the check is blocked on the CUDA toolkit there.
  • Owner: Fable. The M5 core runs this pin after deploy, verified by continuum deploy-verify.

Merging into the fork was approved by Joel ("let's get it up"). Review of the fork PR: BigMama's requested rebase is done and verified as a line set (PR #57 comment).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…ybrid (fork #57)

The walk read and restored the recurrent state right after a decode it only queued, so on Metal
its snapshot carried a torn mid-graph state into the backward pass; a hybrid base (Kimi's)
trained on a gradient about 0.93 to 0.94 aligned with the true one. The fork now synchronizes
before the checkpoint and keeps it through llama_state_seq_get/set_data. It also moves the
recurrent state's gradient into host accumulators (4B device graph at 4096: 3971.2 to 2031.8 MiB),
and splits training out of llama-context.cpp into its own file and the walk into its own module.
No public API or server change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply force-pushed the engine/pin-178224903 branch from 6cee197 to 50e930a Compare October 12, 2026 12:38
@joelteply
joelteply merged commit 72728c1 into canary Oct 12, 2026
6 checks passed
@joelteply
joelteply deleted the engine/pin-178224903 branch October 12, 2026 13:02
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