interplane.Get Omega
Read in your language

aien-sovereign-core-mv

AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.

Brought by drakestapleton

branch main Branches Tags History

aien-sovereign-core-mv / om / flint / README.md

228 lines · 13639 bytes Raw Blame History Source

flint: pinned checkpoint manifest reader (Core #802 P0)

manifest.om is the first deliverable of Core #802 (aien-architecture-mv#353): a bounded reader that admits the Flint BF16 checkpoint at one pinned revision and refuses everything else. Memory, kernel, training and serving work read its output, the tensor inventory TSV, instead of parsing safetensors themselves. It does not execute the model.

Pinned source: RecursiveSI/flint revision 2a247be0c0aec895ccb0ac7ca92229ec6df37288, Apache-2.0 (see THIRD_PARTY.md).

Filesha256
config.json (2451 bytes, copied to test/config.json)a57c33d11f725099105b657043c113149763066d204fd472d0b2ee399abc2ba7
model.safetensors.index.json (3329405 bytes)e5e9c492685f84c8d2d8369f36c74674b03410715f23f6179313f6f1feb90311
inventory TSV printed by the reader (36734 rows plus the header line)60ff4dbdaa1c3632c934c6935aa60ed5b2def4e15f0ca5083ddc7dd660f083f5

Build with omega-mv bf54b19fa590e8ae925c0e80815516dbf41e7326, seeded omc sha256 62775d2a391cfef7cde64e387655caa9809a267093112910ec76bfa568f3712b. om/vendor/json.om is byte-identical to that revision's seed/json/json.om (sha256 456254fc…e2d2). This is a newer compiler pin than om/tur-ledger (6999fa9e, omc d6290c76…).

{ printf 'om2\n'; cat om/vendor/json.om om/flint/manifest.om; } | "$OMC" > flint-manifest && chmod +x flint-manifest
./flint-manifest CONFIG INDEX SHARD_DIR > inventory.tsv

On success the exit status is 0, stdout is the TSV and stderr is one line:

flint-manifest ok tensors 36734 params 39785287456 routed 37849399296 shards 15 bytes 79570574912

TSV columns: name shard dtype shape begin end. Shards come in name order; within a shard, rows follow the order of the header's entries. begin/end are byte offsets into the shard's data section, which starts at 8 + header length. shape is d0xd1 or d0.

What it checks

The reader reads headers with pread. It never maps or reads tensor data and keeps no duplicate buffers. It does not hash shard payloads: the 15 shard sha256 values are pinned separately (shards.lfs-sha256 in the source capture) and checked by a separate step.

Storage dtype versus compute contract

Every tensor is stored as BF16, including the router mlp.gate.weight [256x2048]. The FP32 sigmoid router is a compute contract of the forward path, not a storage dtype. Nothing in the checkpoint is FP32.

Canonical slot space

Slot 0 is model.embed_tokens.weight, 1 is model.norm.weight and 2 is lm_head.weight. Every other tensor is slot 3 + layer * 784 + kind:

kindtensorlayers
0, 1input_layernorm, post_attention_layernormall
2..5q_proj, k_proj, v_proj, o_projall
6, 7q_norm, k_normall
8softmax_offset (the learned sink)all
9..11dense gate_proj, up_proj, down_proj0, 1
12router mlp.gate2..48
13..15shared_expert.{gate,up,down}_proj2..48
16 + 3e + jexperts.e.{gate,up,down}_proj (j 0, 1, 2)2..48

There is no shared_expert_gate tensor: the shared expert is ungated.

Refusals

On refusal nothing is written to stdout. stderr carries refused N reason and the exit status is N.

ExitReasonMeaning
2usagenot exactly three arguments
3ioopen, read or stat failed, or a shard is absent
4not-regular-filea symlink (ELOOP under O_NOFOLLOW), directory or other non-regular file
10config-jsonconfig is not one JSON object
11config-fieldunknown, duplicate, missing or wrong-valued config key
20index-sizeindex over 4194304 bytes
21index-syntaxindex outside the strict subset
22shard-nameshard name outside the allowed form, or more than 64 distinct shards
23unknown-tensora name outside the layout, in the index or a header
24index-duplicatea name twice in weight_map
25total-sizetotal_size differs from 2 bytes times the derived parameter count
26index-missing-tensora layout tensor absent from weight_map
30shard-shortshard shorter than 8 bytes
31header-lengthheader length under 2, over 983040, or past the end of the file
32header-jsonheader is not valid JSON
33header-entryheader root or entry has the wrong shape
34header-metadata__metadata__ present
35dtypedtype other than BF16
36shaperank or dimensions differ from the config-derived shape
37data-offsetsbegin > end, out of range or overflowing, a length that is not 2 x elements, or data truncated
38data-tilingextents overlap, leave a gap, or leave trailing bytes
39header-duplicatea tensor in two headers
40shard-mismatchtensor stored in a different shard than the index says
41header-missing-tensora tensor the index assigns to a shard is absent from its header
42shard-capacityover 4096 tensors in one shard, or a header that fills the JSON tape
43output-capacityTSV over 8388608 bytes; a defensive guard that no admitted layout reaches (the full output is 4269125 bytes)

Hugging Face cache snapshots are directories of symlinks, so they are refused with 4. Point SHARD_DIR at real files, for example after huggingface-cli download --local-dir. __metadata__ is refused because the pinned checkpoint has none.

Gate: check.sh

OMC=/path/to/omega-mv/seed/out/omc bash om/flint/check.sh

test/gen.py is the fixture referee. It derives the full tensor layout from config.json alone and writes a sparse 15-shard checkpoint with the published shard boundaries. It also writes the expected TSV and one mutant per refusal. The gate:

  1. builds the reader with the pinned omc, refusing any other compiler hash;
  2. requires the synthetic checkpoint to load with a TSV byte-equal to the referee's and the exact summary line, and requires usage exit 2 for 0, 1, 2 and 4 arguments;
  3. runs 38 refusal fixtures, each required to exit with its own code, print refused <code> and write nothing to stdout;
  4. rebuilds the reader 25 times, each with one guard removed (every fm_die N for one code, plus O_NOFOLLOW dropped from the open flags). Each mutant must stop producing its code on that guard's fixture, which proves the refusal comes from the named guard.

Optional arms, which print NOT_RUN when unset:

Measured 2026-10-29 on the Spark host CPU (taskset -c 10-14), reader sha256 d9caa2ab4ecf2580114cfdc8cedb30eb93e80f9f1fc0c0da1be1f31a8d381ae8: OM-FLINT-MANIFEST PASS (70) with both optional arms. On the downloaded checkpoint the reader took 0.27 s wall and 9440 kB max RSS, with 0 major faults. Without the optional arms the result is PASS (68) plus two NOT_RUN lines. With the operator arm the full gate is PASS (89).

Forward operators: ops.om

{ printf 'om2\n'; cat om/vendor/json.om om/flint/ops.om; } | "$OMC" > flint-ops && chmod +x flint-ops
./flint-ops selftest
./flint-ops OP FIXTURE INVENTORY SHARD_DIR      # OP: rmsnorm qkv attn router shared expert moe

test/opref.py is the referee: it runs the pinned reference's own modules (modeling_flint.py sha256 f0540832…0c09 and configuration_flint.py sha256 849eee30…4d00, transformers a672eb5f) in f32 on deterministic inputs built from the real BF16 weights and writes one fixture per operator, with the torch version in header word 6. check.sh requires the fixtures, concatenated in a fixed order, to hash to FX_PIN (2d838552…7b7a, torch 2.14.0 on the Spark host CPU); any other torch, reference file or CPU result fails that check. ops.om reads the fixture, loads the named BF16 tensors from the shards through the inventory TSV, recomputes the output in f64 and prints flint-op OP layer L elems N worst_ppm P ties K PASS|FAIL (exit 0, 1, or 2 and up for a refusal). An element passes within twice a first-order bound on the reference's own f32 error; test/TOLERANCE.md has the bound per operator, the gamma_n table, the Wolfram queries and the detection floor (systematic errors below about 2 gamma_n of the output's last accumulation always pass). The RoPE bound allows FULP = 4 ulps (ops.om) per powf, cosf and sinf call of the reference; opref.py measures those calls against float64 and refuses to write fixtures if any exceeds FULP (2026-10-29: worst 0.848 ulp, cosf).

Fixtures: RMSNorm (layer 2); q/k/v with q/k norm and RoPE on sliding layer 2, and on full layer 5 without RoPE; attention with sinks over 520 keys, the 513-key window and its edge on layer 2, full attention on layer 5, through o_proj; the sigmoid top-6 renormalized router on layer 24, plus a control with the reference top-6 swapped (must FAIL) and a near-tie control (must PASS with ties above 0); the shared expert, routed expert 99 and the whole MoE block on layer 24.

Mutants, each required to turn its operator's line to FAIL with exit 1: softmax router (om_exp in place of om_sig), shared expert gated by sigmoid(0), sink omitted, RoPE on every layer, expert index permuted (255 - e), and window 514.

Not covered (NOT_RUN for this unit)

This unit has no GPU arm. A GGUF importer, if added, will be a separate optional unit.

Complete bounded host forward

FLINT_FORWARD=1 adds a full 49-layer chained computation to the same check command. It starts from two token IDs, loads real BF16 embedding rows and all selected expert weights, and compares five intermediate tensors per layer, final normalization and every vocabulary logit. The reference tensors are comparison targets, never teacher-forced inputs. The full gate prints OM-FLINT-MANIFEST PASS (92) with real checkpoint inputs; wrong-token and skipped-final-normalization source mutants must fail the comparison.

See PROFILE.md for the frozen weight/runtime/tokenizer/template identities and the architecture audit. In particular, this checkpoint has no expert bias, unlike the requested selection-only bias description. test/TOLERANCE.md declares the candidate integration budget separately from the tighter per-operator bounds. Native f64 computation with BF16 storage is compared to reference f32 computation. This is host-forward evidence only: no serving API, task completion, quantized model, KV-cache, long-context batching or GPU/backend qualification is claimed.