Commit Graph
7 Commits
Author SHA1 Message Date
Robert KarlandClaude Fable 5.1 4a998adf2c The VRAM plan: no CUDA-context term in the engine, where the budget is already net of it
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
2026-10-11 11:20:16 -07:00
Robert KarlandClaude Fable 5.1 a44b0953f2 Qwen3.6 step 2: --vram-cap / --ram-cap, the Qwen3.6 plan and gate, PLE optional at the CLI, the STATS command and /health tiers
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
2026-10-11 09:56:49 -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 9a53e42de4 Load from slow or remote stores: retrying reads, n-gram table in its own memory, container thread default
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>
2026-10-05 21:17:37 -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