Skip to content

CPU training no longer kills the engine: pin 741b0175b, where the CPU copies a quantized cache into F16 (card c11da2f6) - #5510

Merged
joelteply merged 1 commit into
canaryfrom
c11da2f6/engine-local-training-aborts-the-engine
Oct 27, 2026
Merged

joelteply merged 1 commit into
canaryfrom
c11da2f6/engine-local-training-aborts-the-engine

Conversation

@joelteply

@joelteply joelteply commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Why

On enrico (CPU backend), every engine-local training job since 10-24 ended failed with "the engine's training run is no longer this job's (out None)": 3 of 3, for Eitan and Paige, and no adapter was ever written. The jobs didn't lose their run. The engine aborted in the first training step, and the relaunched engine had no run. Each abort also took serving down for every resident on the node. This is plan path step 3 (learning): without a trained artifact there is no gene to compare, adopt or retain. Card c11da2f6.

From the engine log (~/.continuum/logs/llama-server-58057.log, job a1e49539): "training on the served model: 66957 tokens, window 8960, 3 epochs", then "epoch 0 lr=0.0001", then ggml-cpu/ops.cpp:571: fatal error (ggml_abort <- ggml_compute_forward_dup <- ggml_graph_compute_thread).

Cause

  • The server's training context uses a q8_0 cache (server-train.cpp, since a8a235df5).
  • A training graph that walks more than one chunk reads that cache as F16: llm_graph_context::build_attn_mha, if (cparams.training && cparams.walk_active && ggml_is_quantized(k->type)) k = ggml_cast(ctx0, k, GGML_TYPE_F16).
  • On the CPU backend, a cast is a dup. The CPU dup took only an F32 destination from a quantized source, and its default branch aborts.
  • Metal and CUDA have that copy, which is why the M5 and 5090 runs don't hit this.

What

The engine pin moves from f291f6e7f to 741b0175b: one commit on canary's current pin, on CambrianTech/llama.cpp branch c11da2f6/cpu-dup-quantized-to-f16. core/vendor/LLAMA_CPP_PIN records it.

Engine diff: CambrianTech/llama.cpp@f291f6e...741b017

  • ggml_compute_forward_dup_from_q dequantizes each block straight into F32, or into a scratch row that it converts to F16 (ggml_cpu_fp32_to_fp16) or BF16. The default branch routes those destinations to it.
  • The graph, and its memory choice (an F16 copy, not F32), is unchanged.

Verified (enrico, 2026-10-27, CPU Release build of the fork at 741b0175b)

  • Unit, new test-dup-quantized: q8_0 copied to F16 and BF16 equals the F32 dequantization converted, element for element. It covers a contiguous source and a permuted view (the cache's shape): 0 of 2,048 mismatched. Mutation: with ops.cpp reverted, the test aborts at ops.cpp:571: fatal error, the live line.
  • End to end: CPU, -ngl 0 --no-repack (as enrico's lane serves), Qwen2.5-Coder-1.5B-Instruct Q4_K_M, and POST /train with four ~400-token chat examples, window 512, chunk 256, so the run walks two chunks.
    • This build: state: done, one epoch (train_loss 1.138, 84 s), and the adapter is written (4.4 MB).
    • The deployed engine on the previous pin, same request: SERVER-DIED, with ggml-cpu/ops.cpp:571: fatal error twice in its log.
  • source-hygiene vendor_pin tests: 3 of 3 pass (the pointer equals LLAMA_CPP_PIN, and the pinned source still parses tail_tools).

Measured after deploy

Owner Cormac, by 10-28 18:00Z, on enrico: the next engine-local training job reaches done with an adapter under ~/.continuum/genome/<persona>/, and the engine log has no ops.cpp ... fatal error. Then the learning chain continues (card 172f352f's path): the held-out gene-off comparison and adoption.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

… copies a quantized cache into F16 (card c11da2f6)

Serves every resident on a CPU node and the learning path itself: on enrico every engine-local
training job since 10-24 (3 of 3) aborted the engine in its first step, so no adapter was ever
written, and each abort took serving down for every resident. Plan path step 3 (learning).

The training graph reads its q8_0 cache as F16 when it walks more than one chunk
(build_attn_mha); the CPU dup took only F32 from a quantized source and aborted at
ggml-cpu/ops.cpp:571. The engine pin moves from f291f6e7f to 741b0175b (one commit on it,
CambrianTech/llama.cpp branch c11da2f6/cpu-dup-quantized-to-f16): the CPU dup writes F16 and BF16
from a quantized source. core/vendor/LLAMA_CPP_PIN records it.

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

Copy link
Copy Markdown
Contributor Author

Fable: source PASS on the fork commit 741b0175b (#5510). Verified in ggml-cpu/ops.cpp: the quantized-source dup now accepts F16/BF16 destinations. Each block dequantizes to a per-call F32 scratch row and converts with ggml_cpu_fp32_to_fp16 / _bf16. Offsets stay byte strides (dst_offset = i10*nb10 + …), so F16's element size is handled, and the dispatch condition widened to match. The F32 path is byte-for-byte unchanged. The pin 741b0175b descends from f291f6e7f, so the view-end checkpoint and warm-KV restore are kept. Your unit test covers contiguous and permuted with 0/2048 mismatches, and aborts at the live line when reverted. This unblocks CPU training (enrico) on the learning path. Merge on green, after the fork PR merges into the pinned branch.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

@joelteply
joelteply merged commit e1b9716 into canary Oct 27, 2026
34 checks passed
@joelteply
joelteply deleted the c11da2f6/engine-local-training-aborts-the-engine branch October 27, 2026 03:16
joelteply added a commit that referenced this pull request Oct 27, 2026
…e (card 28463ba7) (#5521)

Serves every node's residents: a node runs the fixes only once its deploy tracker authorizes a
published build. On enrico 2026-10-27 no canary commit after e653e46 could be authorized while
#5506/#5508/#5510/#5515 merged.

The cause: "Warm the shared Rust build cache" was a job of Continuum Rust Tests, with a job-level
concurrency group per branch. A newer canary push cancels the older queued warm-up, and that job's
check run concludes `cancelled`, which parse_tip_checks counts as Red (hard_fail), so a commit
whose real tests were green read red (791328a, 8d6656f). The warm-up gates nothing ("a failed
warm-up only leaves the previous cache").

The job moves unchanged into its own workflow, .github/workflows/rust-warm-cache.yml (same
trigger: push to canary; same CARGO_INCREMENTAL), and that path joins NON_DEPLOY_WORKFLOW_PATHS
beside core-binaries and promote-main: excluded by its own suite, the existing rule.

Fixtures: cancelled warm-up + green tests = Green; queued warm-up + green tests = Green; green
warm-up + CANCELLED real test = Red; warm-up as the only suite = Unknown. Mutation: with the path
removed from NON_DEPLOY_WORKFLOW_PATHS the test fails at its first assertion.


Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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