in.budget_bytes is cudaMemGetInfo's free figure, read after this process's context exists, and the engine
subtracted a 300 MiB context on top of it: ~290 (IQ3) / ~160 (Q4) expert slots under table 4.3 (review
finding 2). The engine passes 0; vram_plan_test keeps the study's 300 MiB because its budgets are the cards'
sizes. Said in vram_plan.hpp's field comment.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
vram_info computed used = total - free after the blocker of total - cap had been allocated, so the blocker
was in `used` AND already out of `free`: room = cap - used = 2*cap - total - used_other, negative at
--vram-cap 5722 on the 1080 Ti and ~4,800 instead of ~7,900 MiB at 8192 (review finding 1). The blocker's
bytes are remembered and taken out of `used`. The cap line now also prints what a card of the cap would show
free (cap - used_before), and the start refuses if the clamped figure is above it or more than 64 MiB below
(the driver rounds the blocker up by a few MiB).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The sm_61 build needed no guard: configure 4 s, the engine 173 s, every other target 43 s more, 0 errors,
cuobjdump shows sm_61 only; `make build CUDA_ARCHS=61` works end to end in 181 s. ctest on the 1080 Ti: 69
pass, 4 fail (one Pascal-specific: kv_hybrid_parity's [5/5], the cc < 70 refusal of qsa_prompt_attn_batch
counted as a failure), 2 skip. The gate is not reached: both real files are refused by the native expert
kernels' down-type whitelist (IQ3_XXS, Q5_K, Q6_K down projections have no grouped kernel) before the VRAM plan
and the qwen35moe_not_yet message. The Q4_K_XL expert total corrected to 19,635,634,176 B.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
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
On VM 211 (cmake 3.31.6) the fixture test failed before the generator ran, so model_geometry_test was
"Not Run":
CMake Error at cmake/qwen36_synth_fixtures.cmake:11 (list):
list index: 1 out of range (-1, 0)
With CMP0007 unset, list(GET) drops the empty element of "toy.gguf;" and index 1 does not exist. cmake 4.x
(the Mac) treats the policy as NEW. With the policy set, qwen36_synth_fixtures writes its 4 files on the VM
(the vendored gguf-py, numpy 2.2.4) and model_geometry_test passes there.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
generate.cpp: every cudaMemGetInfo the planners read goes through vram_info, which clamps the free
figure to cap - used under --vram-cap MIB; a blocker of total - cap is allocated before the weight
arena. --ram-cap GIB bounds the RAM tier (host_available_memory is clamped, the resident budget
too) and the pinned arena. A model whose architecture has no per-layer token embedding starts
without --ple-gguf (no PLE kernels selected, and session.cpp carves no PLE history for it). For a
qwen35moe file the start reads the geometry, checks the pack's layout against it, makes the 4.2
plan from this card's free VRAM and the file's own census (non-expert weights, the draft block,
KV per token in the chosen format, the session, the reserve, the prompt buffers unless prefill
borrows), prints the three tiers, and stops at the step 2 gate naming the steps not done. The
serve loop answers STATS with one JSON line: experts, VRAM slots and how many hold an expert, RAM
copies, mapped experts, tokens served, VRAM hits of lookups, RAM-copy and file reads, warm hints,
and the major page faults since start (the disk-read proxy); the same line is logged at start.
frontend: /health carries that line as "tiers" (the last reading, marked stale, during a request);
--vram-cap and --ram-cap pass through; a one-file model needs no second shard. Makefile: any
CUDA_ARCHS entry below 75 switches STRATA_EXPERIMENTAL_SM60 on (make build CUDA_ARCHS=61).
Not compiled yet: the CUDA translation units need the VM (its sweep is running); this commit is
checked on the VM in the Pascal build commit that follows.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
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
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
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
Measured on the real UD-IQ3_XXS file, 12 tokens, expert choices and layer inputs forced from llama.cpp: the F32 oracle is
1.4e-2..4e-2 off per layer on quantized-weight seams, the Q8-activation oracle 7e-7..5e-3; dequantization is bit-identical to ggml.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
- synth --heads N,KV; cross-check case gqa4_2 (4 heads / 2 KV, seed 11): 211 seams and 50 nextn seams match; the
h % n_head_kv rival (opts gqa_map=interleaved) fails at kq-3 and is a negative test; with one KV head it is invisible.
- tools/qwen36_dequant_ggml.cpp + qwen36_check_dequant.py: ref/load.py (gguf-py) against ggml's own to_float on the real
file, bit-identical for Q6_K, IQ2_S, IQ3_XXS, IQ4_XS.
- ref/qwen36.py: --act-quant q8 (Q8_K / Q8_0 activation rounding as ggml's quantized matmul does), --force-topk,
--force-inputs (start each layer from a llama.cpp dump), tools/qwen36_spread.py to tabulate the spread per seam class.
- qwen36_crosscheck.sh: LLAMA_CPP_DIR override so it runs from a separate worktree.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
21 tests: full-attention layers are 3 mod 4 (and 30 GDN + 10 attention at the real geometry, the nextn block outside the
trunk), top-k weights renormalise and a stray expert_weights_scale is ignored, GDN state/conv shapes and
chunked == token-by-token, the output gate is SiLU(z) (negative test against sigmoid), the attention output gate is
applied to the second half of each head's q slice, seven rival readings each move their seam by more than 5 percent,
IMRoPE rotates 25 percent with text positions and an e-sector stays fixed, dump format, causality, the nextn block.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
docs/qwen36-port/oracle-crosscheck.md: 9 trunk cases and 5 nextn cases (one batch, 40 tokens one at a time, chunks of 7,
fused gate_up, fused qkv, a stray expert_weights_scale key, a --like-real fixture) match every cb()-named tensor of the
pinned llama.cpp graph, worst absolute error 1.1e-4; llama-eval-callback's printed stats agree on 209 named nodes;
seven rival readings (SiLU vs sigmoid gate, head pairing, decay order, conv direction, attention gate, top-k
renormalisation, rope pairing) each fail at the layer that makes them. The formulas are pinned to file:line.
qwen36_crosscheck.sh reruns all of it; the eval-callback checker tolerates the tool's truncated log tail.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
ref/qwen36.py is a teacher-forced forward pass written from the submodule's qwen35moe.cpp graph: embedding,
GDN layers (causal conv, L2-normed q/k, decay + delta-rule recurrence, SiLU-gated RMS norm), full-attention
layers (joint q+gate projection, IMRoPE on 25%, causal GQA, sigmoid output gate), softmax top-k MoE with
renormalised weights and the sigmoid-gated shared expert, output norm, lm head, and the nextn block of
graph_mtp. Every cb()-named tensor is dumped as <name>-<layer>.f32 plus manifest.txt. Each reading with a
plausible rival is a switch (Model.opts) so the fixture can be shown to tell them apart.
tools/qwen36_dump_llama.cpp dumps the same names, in full, from the real llama.cpp graph;
qwen36_compare_dumps.py, qwen36_check_eval_callback.py and qwen36_crosscheck.sh compare them.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
tools/qwen36_synth_gguf.py writes a tiny F32 qwen35moe GGUF with the real tensor names and shape rules
(4 layers, one full-attention layer at index 3, 8 experts top-2, a nextn block), --like-real to take
rope/eps/interval/ratios and verify the tensor-name set against a real file, and options for the fused
gate_up / attn_qkv forms llama.cpp also accepts. docs/qwen36-port/gguf-metadata.md records every key and
tensor of the UD-IQ3_XXS file and the MTP build. ref/load.py gains the IQ2_S/IQ3_XXS/IQ3_S/... geometry the
real file uses.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
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
The A6000 and the 4090 are in use by other agents, so VM 211 (a clone of 210 with the
1080 Ti, 8 vCPU, 12 GiB) is both the measurement and the development machine, and the
sm_61 experimental build is the working build from the first step. Host state checked:
18 GiB available before VM 211, link Gen3 x8.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The study and execution plan for running Qwen3.6-35B-A3B natively on this tree's Strata
snapshot (6f32ec0), on any single card of compute capability 6.1 or newer with 6 to 32 GB,
self-sized across VRAM, RAM and disk. llama.cpp is the baseline and the oracle only; Project
Maya is the method reference. Primary rung: the .57 host's GTX 1080 Ti with a 12 GiB VM.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
Images: --mmproj PATH loads the Qwen3.8 Flash-Next projector through llama.cpp's mtmd
library and encodes image_url parts on the CPU (frontend/vision.hpp). The embeddings go to
the engine as a GENI request, its existing vision path, with the prompt's <|image_pad|>
runs standing in for each image. --vision-tokens caps the tokens per image. GET /v1/models
lists "image" under input_modalities when the encoder is loaded. Checked on an RTX 4090:
screenshots, photos, several images in one message, and pi's file attachments and
clipboard paste.
Engine process: the engine is started and watched from frontend/engine.hpp; when it exits
or its stall watchdog fires, the front end exits too, for a supervisor to restart. Stall
reports add the current stage and thread wait channels. Reasoning streams; content and
tool calls are sent once the whole message is parsed, so partial JSON never changes
arguments already sent.
Tests: make test-frontend (child exit, protocol, backpressure; no model needed) and
make test-chat-parser MODEL=<gguf> (template and tool-call parsing against the real GGUF).
The image path and the supervision were written by a Codex session; this commit finishes,
documents and checks them.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
llama.cpp's Qwen3-Coder grammar takes a tool call's required arguments first and
the optional ones after. Qwen3.8 Flash-Next often writes the optional ones first
(limit, offset, path), and because the grammar's tool-call group is optional and
has no end anchor, such a call parsed as no call at all: no error, finish_reason
"stop", an empty answer. A coding agent sees its turn end after it announced the
call.
The grammar now accepts the arguments in any order; whether a required one is
missing is for the tool to report. The change is kept as a patch under patches/
that `make build` applies to the submodule. The front end logs the raw output
when it contains <tool_call> but no call was parsed, so the next case of this is
visible in the journal.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A RunPod network volume (S3-backed FUSE) refuses reads now and then with
ENOMEM or EIO, which made the expert load fail at start. The new
strata/platform/robust_read.hpp retries such reads, halves the number of
parallel readers while the store refuses and raises it again afterwards.
The expert loader reads through it, prints progress, and names the file,
offset and error on failure. --ple-io ram now reads the n-gram table into
anonymous memory with 16 readers instead of locking the file mapping, which
needs ulimit -l and faulted pages back from the store.
The front end's default thread count comes from the container's CPU quota
when there is one: a pod showed 256 host CPUs with a 32-CPU quota.
Verified on a 3090 pod: the model loads in normal mode straight from the
volume in 12 minutes, through two refused reads; from local disk in 19 s.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The model's output is parsed by llama.cpp's own chat parser after every
token, and the differences are sent as OpenAI deltas (reasoning_content,
content, tool_calls). This replaces the hand-written thinking splitter.
Checked on the RTX 3090 pod: a tool call is returned with
finish_reason tool_calls, and the pi coding agent completed a multi-step
task (write a file, run it, fix, report) against the server.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The first end-to-end run answered streaming and non-streaming chat
requests correctly on an RTX 3090 pod. It ran in a slow fallback mode
because of that pod's network volume, so no speed is claimed.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
unbiased-strata is the engine plus a front end. Started normally it runs
the front end, which starts a copy of itself as the engine (--engine) and
talks to it over a pipe in the engine's own line protocol, as upstream's
Python server does. The engine source is included unchanged; only its
entry point is renamed at compile time.
Tokenizer, Jinja chat template and HTTP library come from the pinned
llama.cpp submodule. Endpoints: POST /v1/chat/completions (with
streaming and reasoning_content), GET /v1/models, GET /health.
Builds on the RTX 3090 pod. Not yet verified end to end.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ggml now comes from third_party/llama.cpp (commit 3cf03257, the one upstream
pins) instead of a clone made during the build. 'make build' configures and
builds the engine for RTX 30/40/50 cards with an AVX2 CPU baseline.
Not yet verified on a CUDA machine.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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>
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>