Commit Graph
127 Commits
Author SHA1 Message Date
Robert KarlandClaude Fable 5.1 6c644bb7d9 docs: the five-arch fat binary builds on VM 221; sm_120 needs a newer CUDA toolkit
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-12 18:54:16 -07:00
Robert KarlandClaude Fable 5.1 9542ec8ded docs: step 4 integration notes; the runner notes carry the 1080 Ti pass, round 8 and REGINA-104's resolution
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-12 18:46:43 -07:00
Robert KarlandClaude Fable 5.1 e73adc6624 build: the chat-parser patch applied at configure time; make build turns STRATA_MMQ_KQUANTS on
REGINA-104 (a Qwen3.6 tool call dropped when its required parameter is not
written first) was upstream's required-first rule running unpatched: the
any-argument-order patch was applied only by `make build`, and every VM tree
of the port was configured with cmake directly, on a copied submodule.
Qwen3.6's template routes to the Qwen3-Coder parser the patch covers, so
CMake now applies it when third_party/llama.cpp is configured (patch -p1 -N,
a reverse dry run first so an applied tree is a no-op; a tree the patch does
not fit fails the configure instead of building the wrong parser).  Verified:
a fresh submodule checkout reports the patch applied and a second configure
says nothing; on VM 221 the rebuilt libllama-common parses `limit offset
path`, `offset path limit`, `path limit offset` and `path` on
Qwen3.6-35B-A3B-UD-IQ3_XXS.gguf (make test-chat-parser PASS).

`make build` also passes -DSTRATA_MMQ_KQUANTS=ON: the Q4_K_XL file's Q6_K
down experts take the MMQ prompt path (docs/qwen36-port/step3-experts.md),
which that option builds.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-12 18:45:33 -07:00
Robert KarlandClaude Fable 5.1 85d5d1234f Front end: SSE keepalive comment after 15 s without a delta; cancel the generation when the client is gone
Content and tool calls are published only once the message is complete, so a long answer is silent for minutes. pi's HTTP idle timeout (5 min) then dropped the stream, retried the same prompt, and the engine finished the orphaned generation first: a 21,826-token turn on the 1080 Ti ran twice. The per-token callback now writes ': keepalive' when 15 s pass without an emit; a failed write cancels the run.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 18:31:26 -07:00
Robert KarlandClaude Fable 5.1 6042a32684 vram plan: the drafter's whole share - its K/V over the context, the draft head, the ids
The step-2 line (the draft block's weights + 16 MiB "ring KV and logits")
undercounted Qwen3.6's drafter (step4-drafter.md section 7): its K/V is the
whole context, not a ring (dense attention has no --kv-resident), in the --kv
format over its one attention layer (512 MiB fp16 / 144 MiB q4_0 at 262,144
cells); the draft head is the pack's vocabulary subset at the head's row bytes
(221 MiB on the Q8_0 head) plus 8 x n_vocab logits; the identity ids are T x
cells x 4.  The planner takes them as inputs (the per-token ones lower with the
context), prints the breakdown, and counts no drafter without --mtp, which the
plan says.  generate.cpp fills them from the file's census and the draft pack's
draft_vocab.bin; vram_plan_test checks the share, the derivation, the lowering
and the no-drafter line.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-12 18:30:29 -07:00
Robert KarlandClaude Fable 5.1 d6800c2a45 docs: step 4 runner notes - the gate lift, the verify and runner tests, both files' numbers
What the engine now does with a Qwen3.6 pack, the hunks (file:line) in the
shared generate.cpp and verify.cpp, the three tests and their tolerances, and
the results: the window and runner tests pass on the 4090; IQ3_XXS and Q4_K_XL
teacher-force to llama.cpp at 61-64/64 top-1 with no rising drift; the step-3
parity suite is 100% of 33 after the gate lift.  The 1080 Ti pass and the Q4
11 GB fit are the remaining items, blocked on the card's lock; the chat template
finding is REGINA-104.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-12 18:30:29 -07:00
Robert KarlandClaude Fable 5.1 bcc7cc8960 tools: the real-file reference and the per-position logits comparison
ref/qwen36.py --all-logits dumps result_output_all (the head at every position
of the last chunk), the reference a streaming runner is held to position by
position.  qwen36_prefill_fixture.py's write() gains q8_embd (token_embd.weight
as Q8_0, a type a native pack's embedding kernel serves), reused by the runner
fixture.

qwen36_teacher_llama.cpp is llama.cpp's own greedy continuation of a prompt with
the head's logits per position and the routed experts at probed layers;
qwen36_compare_logits.py scores top-1 agreement, KL(ref || engine) per position,
the drift gate (one-sided: only a KL that rises with position is a leaking
state) and the routed-selection overlap.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-12 18:30:29 -07:00
Robert KarlandClaude Fable 5.1 bc0b297069 tests: the verify window and the streaming runner on a Qwen3.6 native pack
qwen36_runner_fixture.py writes the synthetic model at the real per-layer
geometry (the prefill harness's full4) as a file a native pack is built from,
builds the pack with iq_pack.py and a 4 x 16 profile, and dumps the oracle for
the 8/11/40-token cases, faithfully and with --act-quant q8.

qwen36_verify_test.cpp drives Verifier on that pack as generate does (the load
order, check_all, the decode config layer_verify_compatible requires, the cache
holding every expert) - the step-3 review's HIGH finding that no test drove the
window on qwen35moe.  The 8-token window's residual after every layer and its
head logits per row against the oracle; the same rows from one-token windows bit
for bit; 8 + 3 with a commit; 40 one per window (base_ar).  The reference is the
Q8 oracle, the engine rounding activations as ggml does.

qwen36_runner_check.py drives the strata binary end to end: the 40-token
sequence teacher-forced in three chunkings (base_c7, one chunk, base_ar), the
logits dumped per position, and the 4 KB mutation-sensitivity gate.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-12 18:30:29 -07:00
Robert KarlandClaude Fable 5.1 b4ee41e14e [shared] verify: the commit captures skip the indexer tail without an indexer
Both commit graphs restored every attention layer's indexer key tail and
re-appended the accepted keys, which needs blk.N.indexer.k_norm.weight: the
first Qwen3.6 window on the real pack stopped there ("blk.3.indexer.k_norm.weight
is missing") after the window itself had run.  A dense model has no tail to
restore; its K/V cells past the accepted prefix are overwritten when those
positions run again, as the header says.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-12 18:30:29 -07:00
Robert KarlandClaude Fable 5.1 1f5ef7daf6 generate: the step-2 gate lifted - a Qwen3.6 native pack loads, prefills and decodes through the verify window
The qwen35moe start no longer stops after the VRAM plan: it proceeds through
the native pack's load order (pack_load_check's, with check_all after the
dense projections, which generate never called), the session at hc = 1 with
no PLE and no indexer, the expert tiers the plan sized, the prompt path and
the decode windows.  The drafter is not wired yet (qwen36-step4-drafter):
without --mtp the windows hold one token each (a window padded with token 0
verified a draft nobody made), and --spec below 2 becomes the verifier's
smallest window instead of the native pack's refusal.

--teacher-force (with --spec-oracle FILE) holds the engine to a reference
continuation position by position: every window row commits, the next window
starts from the oracle's token, --dump-logits writes one row of head logits
per position (the window path wrote none), and the run reports the top-1
agreement.  That is how the real files are compared with llama.cpp's greedy
text (docs/qwen36-port/step4-runner.md).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-12 18:30:29 -07:00
Robert KarlandClaude Fable 5.1 bd0071bbb6 Qwen3.6 step 4 drafter notes: the agreement numbers, the pack row by row, the block on the plain graph, both cards' runs, what the runner consumes
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 14:36:13 -07:00
Robert KarlandClaude Fable 5.1 bbc3532108 qwen36_mtp_test: the drafter held to the oracle's --mtp dumps, position by position
The fixture is the prompt-path trunk plus the nextn block (Q8_0 projections, experts, head and embedding) on 76
tokens, with the pack cut from it.  Every seam at every position against the Q8 oracle, the router's picks identical,
the argmax identical but near ties; the negatives (the hidden state first in the concat, hnorm skipped, the pairing
with position k) more than 5 % away; the captured round graph against the uncaptured forward; the prompt-side pass
for 64 cells and the forward after it.  --real: the real file against llama.cpp's own MTP arm.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 14:36:13 -07:00
Robert KarlandClaude Fable 5.1 6abffa7bfa [shared] generate: the drafter's geometry follows the target for qwen35moe
Flash-Next keeps the canonical MTP head's geometry (512 experts); Qwen3.6's drafter is the -MTP file's nextn block,
cut for the trunk it serves, and MtpDrafter::load refuses a mismatch by name.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 14:36:13 -07:00
Robert KarlandClaude Fable 5.1 16d0fb27c5 prefill: the drafter's prompt-side K/V pass for qwen35moe
Prefill::draft_kv takes the nextn block too: the prompt's cells through this path's GEMMs (MMQ q8_1 x the pack's
native type, else the FP16 GEMM) in the drafter's own order, rows of 64 and up as for Flash-Next.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 14:36:13 -07:00
Robert KarlandClaude Fable 5.1 44b419b6c4 mtp: the Qwen3.6 drafter on the plain graph
A second path chosen by the geometry's architecture: concat(rms_norm(emb) * enorm, rms_norm(h) * hnorm) through
eh_proj, one plain attention + MoE block over the drafter's own dense KV (the routed experts through the native GPU
expert kernels on the resident blobs, the gated shared expert), shared_head_norm, the main head.  h is the trunk's
output-normed hidden state, so the drafter applies output_norm to the residual rows it is handed, as llama.cpp's
h_nextn.  The pack is checked against the trunk's geometry by name.  debug_row runs one row outside any graph and
hands every seam to the harness by llama.cpp's cb() names, with the rival readings as its negative controls.  The
Flash-Next path is untouched.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 14:36:13 -07:00
Robert KarlandClaude Fable 5.1 7f92fa800a mtp_qwen36_pack: the Qwen3.6 draft pack from the -MTP file's nextn block
dense.txt/dense.bin with llama.cpp's names and the projections as stored (the ggml type as the kind), experts.bin as
256 native [gate | up | down] blobs with a one-line native_experts.txt, mtp.json with the geometry the block was cut
for, the draft vocabulary copied in.  Refuses by name what the engine cannot serve (the IQ4_XS-MTP file's Q3_K/Q4_K
experts, fused tensors, a router that is not BF16-exact).  Flash-Next's mtp_pack.py / mtp_rt.py stay.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 14:36:13 -07:00
Robert KarlandClaude Fable 5.1 02ff47e3d4 Qwen3.6 step 3 integration notes: the review fixes landed, both cards re-verified
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 14:05:04 -07:00
Robert KarlandClaude Fable 5.1 1db825277f Qwen3.6 step 4 pack notes: the layout row by row, the forms each site demands, both cards' loads, what the brief had differently
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:55:23 -07:00
Robert KarlandClaude Fable 5.1 8fc3b20763 pack_load_check: a native pack loaded as generate loads it, through check_all, the head and the embedding
The step-2 gate fires before the arena, the native projections, the head and the embedding load, so a run to the
gate proves nothing about the pack; this binary does those loads in generate.cpp's order with its skip set, then
check_all (which generate.cpp never calls), the expert profile, and prints every weight the step-3 sites read with
its engine form or native type.  CTest: skipped (77) without STRATA_QWEN36_GGUF / STRATA_QWEN36_PACK or a card.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:55:23 -07:00
Robert KarlandClaude Fable 5.1 e41dfc7e63 generate: the native dense projections bounded to the trunk's layers
A -MTP file's draft block (blk.40) carries the attention and shared-expert projection names; it is the drafter's,
not in the trunk's pack, and NativeDense::load would refuse it as absent from the canonical table.  The bound is a
no-op for Flash-Next (no block past the trunk).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:55:23 -07:00
Robert KarlandClaude Fable 5.1 a2e615b79f [shared] layout: check_one requires the indexer.* rows only with an indexer
Qwen3.6's attention is dense: the file and the pack have no indexer.q_proj / k_proj / q_norm / k_norm, and
qsa_layer and the verify window ask for them only under g.has_indexer() (step3-attn.md); the shape check demanded
them of every attention layer at hc = 1 (idx_q_heads 0: a 2048 x 0 tensor by name) and would have refused every
Qwen3.6 pack.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:55:23 -07:00
Robert KarlandClaude Fable 5.1 27cc370939 iq_pack: the qwen35moe entry: a second FORM table, native projection types refused by name, the nextn block left out, expert-profile.bin
FORM_QWEN35MOE (routers, ssm_alpha, ssm_beta and the 1-D shexp gate BF16 under the exact rule; the norms, ssm_a,
ssm_dt.bias, ssm_conv1d F32) beside Flash-Next's FORM, byte-identical for qwen4exp (checked old against new on a
toy with every Flash-Next tensor kind).  A projection, the head or the embedding of a type the engine's native
path has no kernel for is refused with the type and the list; an inexact F32 router is refused with the count of
values whose low 16 bits are set and what --compat-bf16 would do.  A -MTP file's draft block (blk.40 and up) is
left out of index.txt and dense.bin as it already was of native_experts.txt.  --expert-profile ships a ranking
whose header matches the trunk (default data/qwen36-expert-profile.bin for qwen35moe).  Fixtures: a toy qwen35moe
with the shipped files' forms, with and without a nextn block.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:55:23 -07:00
Robert KarlandClaude Fable 5.1 ef48ea9a41 make_profile: the layer count from --n-layer or the base's header; llama.cpp route traces; the Qwen3.6 E0 profile
--n-layer (default 48) and the base profile's header decide the layers, and a disagreement is an error; --text-trace
reads llama.cpp eval-callback route traces (<layer> <e0> ... lines, # headers, .gz).  data/qwen36-expert-profile.bin
is the 40 x 256 ranking from regina's E0 trace (routes.txt, 214,940 routed tokens over the 110-prompt corpus): all
10,240 pairs ranked from the trace, none filled.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:55:22 -07:00
Robert KarlandClaude Fable 5.1 3ad2847cf1 strata_tokenizer: the pack export runs without the regex module; encode refuses by name without it
The VMs' system python has numpy but no regex, and tools/iq_pack.py runs the export as a subprocess: the vocab,
merges, token types and the chat template need no pattern, so the import is optional and only encoding needs it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:55:22 -07:00
Robert KarlandClaude Fable 5.1 c24f97bc5d step3-attn notes: the Pascal A/B after the sparse grid was restored (the drafter's case)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:50:45 -07:00
Robert KarlandClaude Fable 5.1 5b50b23ffa qsa_attn_bench is a target, not a CTest entry: it asserts nothing
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:50:45 -07:00
Robert KarlandClaude Fable 5.1 c77631ebba Qwen3.6 step 3: the split-K bound applies to dense shapes only; a sparse shape keeps one block per 64 cells at any capacity
The MTP drafter's ring runs qsa_decode_attn_batch at its --mtp-window (32,768 by default: 512 blocks), so the 128-block cap had moved Flash-Next's drafter onto the online-rescale kernel with another summation order and a smaller scratch. qsa_decode_attn_chunks(cap, s) and the scratch take the shape: sparse keeps ceil(cap / 64) blocks and the old formula, dense is bounded at 128; below sm_75 every sparse shape runs the single-chunk kernel, so Flash-Next's path is the previous kernel, grid and scratch bit for bit at every capacity. The test holds sparse 32,768 -> 512 blocks and the old scratch; the notes state the drafter's case.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:50:45 -07:00
Robert KarlandClaude Fable 5.1 6c716d4eb4 [shared] prefill.cpp: the four QsaShapes sites take the one builder (qsa_shapes.hpp)
Same shape as layer, verify, mtp and session; a dense geometry gets its three indexer widths zero together, which qsa_dense and the kernels' guard both test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:50:45 -07:00
Robert KarlandClaude Fable 5.1 5a5ee03263 [shared] session.cpp: stage_token takes the QsaShapes from the one builder (qsa_shapes.hpp)
The hand-written copy would have given a dense geometry a half-set shape (idx_top_k 2048 kept) and qsa_step_fill the sparse width.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:50:26 -07:00
Robert KarlandClaude Fable 5.1 99c7614a01 Qwen3.6 step 3: one QsaShapes builder (strata/core/qsa_shapes.hpp); dense = the three indexer widths zero, in qsa_dense and the kernels' guard alike
verify.cpp's and mtp.cpp's hand-written builders copied the geometry's two zeros and kept qsa_real_shapes()'s idx_top_k 2048, a shape that was neither sparse nor dense: qsa_dense said dense, the kernels' guard said "not set up" and exited at the window's first kv_append. The builder is now one inline function used by layer, verify and mtp (session and prefill follow in [shared] commits), qsa_dense tests all three widths, and qsa_shapes_valid (non-exiting, what validate() prints and exits on) refuses a half-set shape by name. The parity test builds the shape through the builder for a qwen35moe and a qwen4exp geometry and holds the half-set one as the negative.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:50:26 -07:00
Robert KarlandClaude Fable 5.1 c6fa016f2f Qwen3.6 step 3 integration notes: the order, both cards' tallies, the review and its fixes, what feeds step 4
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:28:04 -07:00
Robert KarlandClaude Fable 5.1 c4f599f448 prefill_qwen36 fixtures: a SKIP marker instead of a failure when numpy or gguf-py is missing
The fixture script writes <out>/SKIP with the reason and exits 0 on the
ImportError (as the other fixture scripts do); prefill_qwen36_test exits 77 on
seeing it.  4090: the simulated missing numpy gives SKIP and 77; the real
fixtures still pass.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:23:05 -07:00
Robert KarlandClaude Fable 5.1 77983af4a4 native_expert_parity: the GPU bound is the tolerance policy's 2e-2; the CPU and CPU-vs-GPU rows get their own
GPU against the float reference: 2e-2 (oracle-crosscheck.md: the Q8 oracle's ffn_moe_out max 5.3e-3 with the 4x
margin; Qwen3.6's five pairs measure 9.7e-3 to 1.3e-2), 3e-2 only for a pair with a Q5_0 role (q4_K/q5_0 measures
2.7e-2 at 2560 x 640, the pair the CMake note already describes).  CPU against the reference stays at 3e-2: ggml-cpu
rounds the activations to Q8_K, one scale per 256 values against the GPU's q8_1 per 32 (measured up to 2.2e-2).
CPU against GPU, printed but never gated before, gets 4e-2 (both roundings, measured up to 2.4e-2).  Each line prints
its bound.  RTX 4090: 15 of 15 ctests, both real files at layers 0 / 34 / 39, q4_K/q5_0 and q5_0/q8_0 pass.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:22:50 -07:00
Robert KarlandClaude Fable 5.1 7d6e2745ab Qwen3.6 step 3 notes (prefill): the 1080 Ti pass - all green, MMQ is the prompt-MoE path on sm_61
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:12:49 -07:00
Robert KarlandClaude Fable 5.1 19886e52af Prefill GDN gate: the decode kernels' GdnGate from ModelGeometry::gdn_gate(), required, no default
GdnGeom::gate is kernels::GdnGate (the GDN branch's enum, cherry-picked with
its geometry accessor); Geom::of reads g.gdn_gate(), so the prompt path and
the decode path pick the gate from the same place.  4090: gdn_rec_parity,
gdn_parity and both harness cases pass.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:12:49 -07:00
Robert KarlandClaude Fable 5.1 92fa19835c Qwen3.6 step 3 experts notes: the 1080 Ti pass (20 of 20, both real files, the down kernel per expert per type)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:09:40 -07:00
Robert KarlandClaude Fable 5.1 f031593910 Qwen3.6 step 3 notes (prefill): the 1080 Ti pass staged, not run (the lock)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:03:25 -07:00
Robert KarlandClaude Fable 5.1 1a433d21e5 Qwen3.6 step 3 notes: the prompt path - the literal sites, the harness, the 4090's numbers
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:03:25 -07:00
Robert KarlandClaude Fable 5.1 5a505f1450 prefill_qwen36_test: the seam error over the whole sequence, near ties in the router, the post-norm gate
A chunked run's error is the relative L1 of the sums over its chunks (the worst
7-row chunk said more about one token than about the kernel); the forcing copy
waits for its DMA (the prompt stream is non-blocking); a router rank swap is
allowed only where the oracle's own softmax puts the two experts within 2e-3
(the prompt path's router multiplies BF16-rounded activations: every swap seen
is a near tie of 2e-5 to 1.3e-3); the post-attention norm's gate is the
mixer's error passing through (2e-3); the Q8 oracle's numbers are reported
beside the F32 oracle's.  The fixture's router runs at half the toy's gain so
the renormalisation rival is visible (5.7 %, was 1.3 %).  The attention
branch's kernels are in the tree, so the pending-attention skip is gone.

4090: gdn3 and full4 pass, one chunk of 40 and chunks of 7.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:03:25 -07:00
Robert KarlandClaude Fable 5.1 3144f22dc7 Prefill: dense attention through the attention branch's kernels; the Qwen3.6 harness and its fixtures
The attention layer of a model without an indexer takes the cherry-picked
kernels as the attention branch defines them: the shapes zero the three indexer
widths (qsa_dense), the capacity is qsa_selection_cap (every cell), no ids are
carved or passed (a null is the identity), the group G comes from the geometry
and any other ratio is refused by name before a launch.  The own dense_ids
kernel goes (qsa_identity_ids is the explicit form).  A model with no attention
layer at all (the harness's gdn3 fixture) has no primary attention state: the
reads of it are guarded.  STRATA_PREFILL_ALLOC_TRACE=1 names the allocation
that did not fit.

tests/python/qwen36_prefill_fixture.py writes the synthetic model at the real
per-layer widths (gdn3: three DeltaNet layers; full4: plus the attention layer;
Q8_0 projections and experts, BF16-exact routers) and the oracle's dumps for 40
tokens, faithful, --act-quant q8, and the rival readings.
tests/cuda/prefill_qwen36_test.cpp runs the prompt path on them as one chunk
and in chunks of 7 with every layer's input teacher-forced to the oracle's
l_out, holds each seam to the dumps, checks the router's top-k, the negative
controls and the geometry refusals; CTest: prefill_qwen36_fixtures,
prefill_qwen36_test, prefill_qwen36_attn_test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:03:25 -07:00
Robert KarlandClaude Fable 5.1 cecdba3745 prefill_fused_iq_test: the reference part at Qwen3.6's 2048 / 512 top-8 as well
The widths become variables set per pass (Flash-Next's 2560 / 640 top-10, then
Qwen3.6's); the timing part keeps the pack it was measured on.  4090: every
pair within 1.5e-2 rel RMS of the FP32 reference at both geometries.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:03:25 -07:00
Robert KarlandClaude Fable 5.1 14be6acbec [shared] WeightTable::set: a test seam to build a table row by row
The Qwen3.6 prefill harness (tests/cuda/prefill_qwen36_test) runs the prompt
path on a synthetic GGUF with no pack directory: it uploads the tensors itself
and needs to hand the WeightRefs to the table.  One public inserter; nothing
else changes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:03:25 -07:00
Robert KarlandClaude Fable 5.1 4f3edf9229 gdn_rec_parity: both geometries, the engine's launches against a host reference, the negative controls
The copied kernel variants become templates on <HV, HK, C>; the bit checks run
at 48/16/10240 and 32/16/8192.  New: a double-precision transcription of the
recurrence (decay before the rank-1 update, v-head h paired with k-head h % HK,
the gated RMS-normed output) that the engine's own gdn_recurrence and gdn_conv
are held to (FP16 output 2e-3, FP32 state 1e-4 relative L1), with the rival
readings the oracle names - the other model's gate, the interleaved pairing -
required to sit more than 5 % away; and the geometry refusals (a third value
head per key head on 32 heads, 4 per key head).  Links strata_prefill.

4090 (sm_89): 0 failures; the rivals 0.86 to 1.33 relative L1 away.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:03:25 -07:00
Robert KarlandClaude Fable 5.1 258ccb9280 Prefill: the geometry from ModelGeometry, the plain block at hc 1, dense attention ids, the seam hook
The file-wide constants N, HC, D, LR, K, NE, C, ZV, HV become a Geom built from
the ModelGeometry (Geom::of), used by every buffer count and launch; init
accepts Flash-Next's geometry as before and qwen35moe at hc 1 with the GDN
geometries the kernels are built for, and refuses top-k beyond n_expert.  At
hc 1 the layer loop is x = rms_norm(R, attn_norm) -> mixer -> R += out;
x = rms_norm(R, post_attention_norm) -> MoE -> R += out, with none of the
hyper-connection buffers carved.  The attention layer of a model without an
indexer skips the indexer and writes the dense selection (cap = max_cells,
behind a TODO for the attention branch's bounded scratch); the G = 12 kernels
refuse 16 heads, so that layer returns an error until the G = 8 kernels land.
The MTP draft_kv pass stays Flash-Next's (step 4).  on_seam: a test's view of
the layer loop by llama.cpp's seam names, and its teacher-forcing seam (l_in).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:03:25 -07:00
Robert KarlandClaude Fable 5.1 d994c78862 Prefill fused native experts: n_embd and n_ff from the layer's NativeGeom
GU_ROWS_K 2560 / D_ROWS_K 640 and the 1280 / 2560 weight-row counts become the
geometry's n_embd / n_ff (2048 / 512 for Qwen3.6), loop bounds rather than
constants; a width that does not tile the work item is refused by name.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:03:25 -07:00
Robert KarlandClaude Fable 5.1 23cbcace3f Prefill kernels: the GDN kernels forked per geometry, the gate a parameter, the MoE and attention helpers at runtime widths
The GDN kernels (gates, conv, l2, the three recurrences, the output norm) become
templates on <HV, HK, C> with the output gate (sigmoid for Flash-Next, SiLU for
Qwen3.6) a bool parameter, dispatched from a GdnGeom through gdn_dispatch at the
two geometries 48/16/10240 and 32/16/8192 (any other stops the process, and
gdn_geometry_supported lets Prefill::init refuse it first).  route() takes k,
moe_combine the width and k, the SwiGLU kernels n_ff, split_q and gate_attn
n_head.  New: rms_norm_images and residual_add (the plain block at hc = 1),
dense_ids (every cell up to the query's own, for the dense model).

Study section 3.6 and 6 (step 3, the prefill bullet).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 13:03:25 -07:00
Robert KarlandClaude Fable 5.1 7cfb7dccaf generate: --kv-resident refused before any weight moves when the model's attention is dense
qsa_kv_streaming_applies (the attention branch) is called right after the geometry is read, so a Qwen3.6 start
with --kv-resident fails with the reason instead of reaching qsa_state_init's backstop.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 12:54:36 -07:00
Robert KarlandClaude Fable 5.1 973303cfb5 Qwen3.6 step 3: the single-chunk pre75 kernel kept for capacities under 8,192 cells, and the step3-attn notes
On sm_61 the looped kernel costs 16-28 registers over PR #540's body (80-92 at G 12 against 63-64) and 13-17% on the Q4_0 pool at short widths; a register cap spilled and cost every format more. So a capacity under kMaxChunks x 64 runs attn_chunk_kernel_pre75_single, the old body with G and the null-ids identity: every Flash-Next state (cap 2,051) is the old kernel to the instruction (interleaved A/B on the 1080 Ti: 42.0 vs 41.0-41.7 us fp16, 38.9 vs 38.9 INT8, 40.8 vs 41.0 Q4_0), and the looped form runs only for the dense model's long-context states, where it is ahead (419 vs 493 us at 32,768). The notes carry the layout, the harness, the tolerances and both cards' numbers.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 12:54:17 -07:00
Robert KarlandClaude Fable 5.1 a711e8d6b3 Qwen3.6 step 3: the KV kernels accept the dense shape, the prompt kernels write only G rows, the parity test reads the oracle's #2 names
qsa.cu's geometry guard demanded indexer widths; a dense shape (idx_n_head, idx_dim, idx_top_k all 0) passes it for the KV, gather, attend and gate kernels, and the indexer's own entry points refuse it by name (validate_indexer). The MMA prompt kernels wrote accumulator rows 0..7 unconditionally, which at G = 2 overwrote the next KV head's output; the rows are guarded by G. The scratch bound is 528,448 floats (2.02 MiB) at 16 heads, not the 2,080,832 the first wording said.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 12:54:17 -07:00
Robert KarlandClaude Fable 5.1 77b8035fa3 kv_hybrid_parity: the prompt-kernel case skips below sm_70 instead of failing
qsa_prompt_attn_batch refuses cc < 70 by design (no mma.sync) and prefill takes the batched decode kernel there, which case [4/4] already holds to the same reference; the Pascal pass counted that refusal as a failure.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 12:54:17 -07:00