Commit Graph
15 Commits
Author SHA1 Message Date
Robert KarlandClaude Fable 5.1 22d72e69e7 pool: the native-pack rows at the layer's widths, not the canonical FF / H; the served model's name from its file
Every verify window with an expert miss computed on the CPU decoded to
token 0 ("!!!!") on both Qwen3.6 files: the first serve of the Q4_K_XL
pack at 262,144 context (9,980 of 10,240 experts resident) and IQ3_XXS
under any --vram-cap.  Found by elimination on the 4090: all-resident runs
were correct at every context and KV format, --pcie-frac 1.0 (misses by
DMA, computed on the GPU) was correct, --pcie-frac 0 (misses on the CPU)
was wrong with ggml's plain dot products, with one pool worker and on the
IQ3 file alike.

ExpertPool::run_split_multi_native split its gate/up and down phases over
FF (640) and H (2560) rows per expert, the canonical Q2_0 pack's widths
compiled into expert.hpp, while a native layer's NativeFmt carries its own
n_ff / n_embd (512 / 2048 here): the down phase wrote 512 rows past every
output row into the next token's, the gate/up phase read 128 rows past
each expert's block.  The phases now take the layer's widths; native_fmt
refuses a layer wider than the pool's SplitBufMulti buffers (H x FF).

tests/core/pool_native_widths_test: three Q8_0 experts at 2048 x 512, four
tokens, the pool's rows against the kernels called directly, bitwise
equal, and a guard after every output row.  It fails on the old row
counts (the guard) and passes now.  After the fix on VM 221: Q4 at 8K with
forced CPU misses 328 tok/s correct, Q4 at 262,144 by default 322 tok/s
correct, IQ3 at 262,144 under --vram-cap 11264 (5,762 slots, 56%) correct
at 169 tok/s; the Qwen3.6 and native-expert ctest subset 32 of 32.

The front end reported every model as "qwen3.8-flash-next-iq3_xxs"; the
id is now the GGUF's base name without a shard suffix.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-12 19:42:41 -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 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 0e40d4e386 ModelGeometry::n_vocab from the file: output.weight, token_embd.weight and the token list must agree
read_model_geometry left n_vocab at Flash-Next's 248,320 on every file while generate.cpp samples over
output.weight's rows and loads the native embedding with g.n_vocab (the synthetic fixture has 128).  The reader
now takes the vocabulary from whichever of output.weight's ne1, token_embd.weight's ne1 and
tokenizer.ggml.tokens' length the metadata shard carries (the array's `count`: the reader caps `items` at 64),
refuses when two disagree naming both ("output.weight says 100 tokens but token_embd.weight says 128"), and
keeps the default only when none is present (the metadata-only fixtures).  model_geometry_text prints it.

model_geometry_test: toy.gguf reads 128; the real IQ3_XXS file 248,320 (so the default was right for the shipped
files; the Mac's Flash-Next Q2 file also 248,320); the disagreeing fixture is refused and output.weight alone sets it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 11:54:14 -07:00
Robert KarlandClaude Fable 5.1 7d0ada1769 model_geometry_test --real: also prints the architecture guard's verdict
So a real file's run says whether check_architecture passes it, next to the geometry; the gate line is printed
for qwen35moe files only.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 11:24:37 -07:00
Robert KarlandClaude Fable 5.1 d01004055a expert_profile_save_test: a 48 x 512 profile is refused for a 40 x 256 model, naming both
The step 2 negative test the plan asked for (expert_cache.cpp's header check); CPU only, in ctest.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 11:24:00 -07:00
Robert KarlandClaude Fable 5.1 afec2f1aea model_geometry_test: a qwen4exp fixture with the real Flash-Next key set, equal to the defaults field by field
The qwen4exp reader's optional reads (ssm.*, key_length, the interval, the expert widths, rope dims / sections
/ base, the epsilon) and its four refusals ran only on the six-key fixture, so the one path that could refuse the
working model was untested (review finding 5).  The fixture writer gains f32 and u32-array values for it.
model_geometry_test --real on the Mac's Qwen3.8-Flash-Next-Q2.gguf reads it (48 trunk layers, 1 draft block,
every field the default).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 11:24:00 -07:00
Robert KarlandClaude Fable 5.1 128f7d4553 vram_plan_test: the Q4_K_XL census is 19,635,634,176 B
The same 524,288 B that expert_layout_test carried: tests/data/native_experts/qwen36-q4_k_xl.txt's header and
the sum of its 40 blobs x 256 experts are 19,635,634,176 (exactly 18,726 MiB, the study's figure); the
constant and the header comment were 19,636,158,464.  The mean blob and every ladder check are unchanged at
this rounding; all checks pass.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 11:20:46 -07:00
Robert KarlandClaude Fable 5.1 5798a463a5 expert_layout_test: the Q4_K_XL total is the pack's own figure; 2560 x 640 is refused as "not whole blocks"
The test's Qwen3.6 section had never been built (expert_layout_test is CUDA-gated; the Mac has no binary).  On
the 1080 Ti build it failed three checks:

    qwen36-iq3_xxs.txt: at Flash-Next's 2560 x 640 refused by its numbers: native experts: expert geometry is not whole blocks FAIL
    qwen36-q4_k_xl.txt: per-layer formats and blobs (down 14 on 34/38/39, 2301952 B at layer 39, total 19636158464 B) FAIL
    qwen36-q4_k_xl.txt: at Flash-Next's 2560 x 640 refused by its numbers: native experts: expert geometry is not whole blocks FAIL

The total: tests/data/native_experts/qwen36-q4_k_xl.txt's header (and the sum of its 40 blobs x 256) is
19,635,634,176 B; the constant 19,636,158,464 was 524,288 B high.  The refusal: n_ff 640 is not whole
256-value blocks for Q4_K / IQ2_S rows, so native_fmt refuses before the blob comparison the test looked for;
the check now accepts either message, both a refusal.  All checks pass on the VM.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 11:13:43 -07:00
Robert KarlandClaude Fable 5.1 b85bbb2e55 Qwen3.6 step 2: the VRAM planner as a pure function, checked against the study's ladder
strata/plan/vram_plan.hpp: the 4.2 rule with no GPU in it - the fixed set at the requested context
(weights, drafter, KV per token, session, CUDA context, reserve, prompt buffers unless prefill
borrows), the context lowered toward 131,072 in steps of 4,096 when it does not fit, a refusal with
every number and the smaller file's name below the floor, the remainder as expert slots at the mean
blob, the RAM tier from the available RAM minus a headroom, the rest mapped from the file.

tests/core/vram_plan_test.cpp reproduces table 4.3 of docs/QWEN36-35B-A3B.md for 6, 8, 11 (decimal
and the 1080 Ti's 11,264 MiB), 12, 16, 24 and 32 GB at Q4 and IQ3, with and without borrowing: every
row equals floor((budget - fixed) / blob) exactly and is within the table's rounding of the printed
figure; the 24 GB spare (~1,090 MiB), the RAM tier at 9.5 GB (~4,950 / ~8,760), the disk tier on the
1080 Ti (~1,740 / ~2,780), the lowering branch, the refusal at 6 GB Q4 without borrowing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 09:51:46 -07:00
Robert KarlandClaude Fable 5.1 1d2e400920 Qwen3.6 step 2: the native expert layout takes the model's widths; the engine reads the geometry before the layout
expert_layout_load(pack, n_layers, n_expert, n_embd, n_ff, err): each layer's NativeFmt is built with
the model file's widths instead of the compile-time 2560/640 (geometry-inventory.md row 108), and a
pack without native_experts.txt (the canonical Q2_0 form) is refused for any other geometry.
generate.cpp reads ModelGeometry from the --native file before the layout load, logs it for a
non-Flash-Next file, refuses the fused tensor forms by name, takes the router k and the embedding
dims from it, and reads the rope keys under the file's own architecture prefix.

tools/iq_pack.py: --layout-only writes native_experts.txt alone and prints the census; the draft
(nextn) block of an -MTP file is left out of the trunk layout; fused ffn_gate_up_exps refused;
FORM carries qwen35moe's attn_norm / post_attention_norm / output_norm (F32 as stored).

tests/data/native_experts/qwen36-{iq3_xxs,q4_k_xl}.txt from the real files (40 x 256; 10,594 and
18,726 MiB, mean blobs 1.035 and 1.829 MiB, as censused in docs/QWEN36-35B-A3B.md), and
expert_layout_test loads them at 2048 x 512 with every layer's types (IQ4_XS down on 34/38/39;
Q6_K down on 34/38/39, Q5_K gate/up on 39) and sees them refused at 2560 x 640.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 09:48:22 -07:00
Robert KarlandClaude Fable 5.1 1417ba9e18 Qwen3.6 step 2: ModelGeometry from the model file's own metadata, for qwen4exp and qwen35moe
ModelGeometry gains the architecture, the draft block count, n_rot / rope sections / base / eps, the
shared-expert width, the router k and has_ple; derive() computes the conv channels and the value dim
from the head counts instead of storing Flash-Next's.  strata/core/model_geometry.hpp reads every
field from the <arch>.* keys (hc = 1, no PLE, no indexer for qwen35moe), checks the derived quantities
against the file's own (ssm.inner_size), refuses the fused ffn_gate_up_exps and attention attn_qkv
forms by tensor name, and carries the step 2 gate message.  check_architecture accepts qwen35moe with
the key set llama.cpp's loader requires (presence only; the file is the authority on sizes).

tests/core/model_geometry_test.cpp: every field of the toy geometry from tools/qwen36_synth_gguf.py,
the nextn block subtracted, both fused forms refused by name, a qwen4exp file keeping hc 4 and PLE,
'llama' refused by name, a contradictory ssm.inner_size refused; --real FILE asserts the real
Qwen3.6-35B-A3B values (checked on the IQ3_XXS and Q4_K_XL files).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 09:45:37 -07:00
Robert KarlandClaude Fable 5.1 c00942d2c2 Restore the development tooling the port needs from the import commit
ref/load.py, the pack, profile, MTP, tokenizer and fixture tools with their tests, and the
tests/ sources the root CMakeLists already wires under STRATA_BUILD_TESTS. Development only:
the shipped binary still needs no Python. Taken unchanged from 12a7825 (Strata 6f32ec0); the
HIP tests, the installer tests and the conversation-cache tests stay out.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-11 08:43:10 -07:00
Robert KarlandClaude Fable 5.1 8894a81288 Remove installer, Python, non-target platforms, benchmarks and marketing
Removed: the Python installer and launchers (setup.py, *.bat, *.sh), the
Python server and web app (serve/), the Python tools (tools/), the Intel
SYCL port (sycl/), Docker files, benchmark results (bench/), the test suite
(tests/, which upstream's own published source also leaves out),
translations, and all docs except DETAILS.md and the paper, kept under
docs/upstream/ as reference.

The engine (src/, include/, CMakeLists.txt) is untouched.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-04 12:56:12 -07:00
Robert KarlandClaude Fable 5.1 12a7825605 Import Strata at 6f32ec0 (upstream snapshot, unmodified)
Source: https://github.com/Niko1221/Strata, commit 6f32ec070f23ced9f50e704d854d775da52591ab
(engine 0.1.39, MIT). Every file is as upstream published it; later commits
show exactly what this fork changes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-04 12:55:44 -07:00