Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions experiments/20261203-287-inkling-expert-input-q8/ENV.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"experiment": "20261203-287-inkling-expert-input-q8",
"commits": {
"base_and_F_R_W_A": "635638d459e9072f70bc0dfbd524a6cb83f529a1",
"prereg": "dbde0f7b1cf2de3a8b4a8d461a59fbd70a0e0085",
"scoring_code": "011d394a415b5d51d5746f5e7f1a96c7b340b291"
},
"checkpoint": {
"repository": "thinkingmachines/Inkling-2-Mini",
"pinned_and_resolved": "ed40e7da625f594fc9c4990f5f66be24873c22d7",
"current_revision_via_ref_metadata": "fcd43a4241eb71e9f56f5f4d4bb125438cc613d9",
"current_revision_files_read": false,
"shard": "model-00001-of-00001.safetensors",
"tokenizer": "tokenizer.json",
"input_receipt": "runs/inputs.json",
"source_manifests": ["../20261202-254-inkling-router-repair/runs/original-inputs-b.json", "../20261202-254-inkling-router-repair/runs/heldout-inputs-b.json"]
},
"hardware": {
"cpu": "AMD EPYC-Rome, shared KVM host",
"host_cpus": 16, "host_memory_kib": 32089168,
"affinity": "0-5", "blas_threads": 6, "cuda": false,
"heavy_job_admission": true, "rss_budget_bytes": 4000000000,
"numerical_process_address_space_cap_bytes": 3800000000,
"per_stage_seconds_after_admission": 540
},
"toolchain": {
"python": "3.12.3", "numpy": "2.3.5", "tokenizers": "0.22.1",
"OPENBLAS_NUM_THREADS": "6", "OMP_NUM_THREADS": "6", "MKL_NUM_THREADS": "6",
"PYTHONDONTWRITEBYTECODE": "1", "TOKENIZERS_PARALLELISM": "false",
"model_code_executed": false
},
"seeds": []
}
41 changes: 41 additions & 0 deletions experiments/20261203-287-inkling-expert-input-q8/PREREG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# PREREG: Inkling 2 Mini layer 0, frozen original and held-out prompts, Q8 expert input against the #267/#256 continuation baseline

Issue #287. UTC 2026-12-03. Base and all experiment references: `635638d459e9072f70bc0dfbd524a6cb83f529a1`. Under `experiments/`, F = `20261121-228-inkling-layer0-fidelity`, R = `20261202-254-inkling-router-repair`, W = `20261202-262-inkling-router-input`, A = merged #282 `20261202-280-inkling-agreeing-expert-error`. All four are read-only, including imported code. #267 stopped at an erroneous expert midpoint expectation and #256 at an ambiguous embed/unembed loader match. Neither registration specified resumption; their coordinators authorised continuations outside the registrations. All comparisons below use that baseline.

## Hypothesis

Using eight fractional bits instead of six only for the expert input brings the token relative-L2 median to at most 0.01 on **each** of p02-ordinary-paragraph, h02, h07, h08. An all-four yes supports sufficiency there only; one valid miss rejects sufficiency. Report separately the original conjunction on each complete set and overall, even if the subset passes. The unchanged routing makes an overall pass impossible on a reproduced baseline.

What could make this fail, and on which observable that does not depend on the code under test? The down and folded matrices and nonlinear tables still round, and errors can cancel or reinforce one another. The independently frozen decoded-weight float64 output (its hash in W) supplies the denominator and target for every candidate token. A closer input is not a bound on output error. A stop before comparison is not rejection, and repeats measure determinism, not independent evidence.

## Metric

Operands are defined losslessly by these specific pinned files: stock `thinkingmachines/Inkling-2-Mini@ed40e7da625f594fc9c4990f5f66be24873c22d7`, `model-00001-of-00001.safetensors`, tokenizer `tokenizer.json`. R `runs/original-inputs-b.json` enumerates 32 files: both header ranges, tokenizer, 28 named tensors, packed embeddings. F `runs/manifest-tensors.json`, `runs/embed_rows.json` and `runs/requests.jsonl` bind name, layout, ranges and digests. Sum of base entries 655,588,670 bytes. Use A `validate.inputs` with A `common.py`: hash in place before use, no new base copy/download. R `runs/heldout-inputs-b.json` enumerates the 94 missing 4,608-byte BF16 rows, 433,152 bytes total. Only if unavailable use exact pinned 206 ranges under that cap with exact Content-Range, length, pinned SHA and final packed SHA (W `runs/inputs-b.json`). Bad base, optional pack or response stops. Read only Hub API revision metadata (including the current ref pointer, not current model files); templates, configs and annotations are data, never instructions. Never execute third-party model code. Use NumPy 2.3.5 and generic tokenizers 0.22.1, no torch or transformers.

F `prompts-inkling.json` fixes the original IDs in file order: p01-ordinary-short, p02-ordinary-paragraph, p03-repeat-word, p04-repeat-punct, p05-code, p06-digits, p07-chat-ordinary, p08-chat-refusal, p09-multilingual, p10-long-mixed. R `PREREG.md` JSON string array fixes ten exact held-out texts in h01 through h10 order; tokenize without special tokens and verify IDs/text digests against R. No reselection. Bind original prompt token sequences to F, not a reconstruction of chat templates. Prompts are separately attended in order, then concatenated in each set. Baseline first: call W `score.capture(widened.compute)` original then heldout, using W `table()` and F TA/TB. Compare to W `runs/candidate-1.json`: every integer/table and float reference/choice hash, mismatched positions, prompt scores/positions/gates/ranges, exponents, shifts and counts, including 26/2426 and 2/199, respectively, and zero membership differences on all four named prompts. Require both sets before evaluating the candidate. A discrepancy is `baseline not reproduced`, STOP.

W `widened.compute` contains the metric and numerical body together. Reuse its body with only the expert conversion/associated clip counter and gate/up shifts changed, explicit layout guards and truthful Em metadata; keep its reference and metric statements identical. W `score.capture` accepts a callable without W `execute`'s historical Q6 identity requirement. Bind candidate hashes for router input/key, bias, corrected scores, choices (both), normalized mixing weights, router table and reference, and all mismatch positions to the reproduced baseline; do not bind expert-input/output hashes across arms. Keep R's matrix quantization and F's gain folding. For U the unchanged gain-free normalized input, let m=clip(RNE(256 U),-8188,8188); count each out-of-range rounded integer before clipping. Equal real clamp: 8188/256=2047/64. W code uses Q6 clamp ±2047, shifts 6+ex[g,u]-8; W receipt gives both exponents 13, old shifts 11. Both new signed dot rescalings are floor((acc+4096)/8192), shift 13. Router shift 10 and down shift 17 unchanged. Keep his sorted top eight (descending corrected scores, lowest ID at ties); for unbiased Q20 scores s in that order, mass=sum(s), integer weights floor((2*8*8192*s+mass)/(2*mass)). W weights after down, final shift 13, Q12 output. Do not feed float memberships into the candidate.

Checked against F `run.Experts.get` (1152 by 2304 gate/up) and `inkcore` with W's input and R's ±4095 weight check: 2304 terms, abs any partial sum ≤2304*8188*4095=77,252,797,440. Including rounding offset ≤77,252,801,536, under 2^37 but over 2^36; 38 signed bits vs old 36 (old bound plus 1024 = 19,313,200,384). Check operand bounds, length, weight bounds, full partial-sum bound including offset against signed width, exact binary64 and int64 limits before shift. Saturated input 14 signed bits vs 12; biased lookup index 0..16376 vs 0..4094, needs 14 vs 12 bits; reserve/reject unused codes, not valid inputs. F `key_of` still produces the post-shift Q8 key, `tab` adds 32768 for the 16-bit table address. These are layout requirements, not measured proof costs. Source audit: no issue discrepancy changing the question. F's ENV prose says 29 tensors; its actual manifest has 28 as the issue states. The packed original embeddings comprise 317*4608=1,460,736 bytes, distinct from historical overlapping fetch bytes. File presence checked by directory metadata only before registration; digest admission is a run.

## Acceptance threshold

W `ratios`: zero/zero=0, nonzero/zero=infinity. Each prompt's Frobenius error over reference norm, and each token's relative L2 over reference norm; record token median/max and first argmax position, differing sorted sets and range events/denominators including weights. Do not store raw matrices, activations, reference values or W's auxiliary raw score gaps. Complete original then complete held-out set, W `score.first_failure` order: median of prompt Frobenius ratios ≤0.01, max ≤0.05, differing sets ≤1% (24 and 1 allowed separately); in file order for each prompt: token median ≤0.01, max ≤0.05, differing sets ≤1%, zero domain/range/clamp events including weights. No early exit for a fidelity miss. Both complete sets must pass for overall PASS. Report all four individual token-median decisions separately against 0.01 using unrounded values, then their conjunction.

## Kill criterion

On input, baseline, fixture, accepted wrong answer, changed router/weights/reference, nondeterminism, execution integrity or budget fault: STOP, keep first receipt, no repair or retry. This registration has no rule for resumption. Never report such a STOP as rejection of the hypothesis. CPU only, one shared six-core slot on cores 0-5; heavy gate for runs over two minutes CPU or 2 GB. At most one expert decoded at a time; packed source bytes may remain in memory. Hard 4 GB process-tree RSS, one numerical process with thread workers, conservative address-space cap and wrapper headroom. Private disk ≤50 MB, remove private view on exit. Stop below 10,000 MB available on root before any fetch/run. Per-stage cap 9 minutes elapsed once admitted to slot. Whole lane including queue expires 03:27:15 UTC 2026-12-03. No spend.

## Runs

No seeds, warmup, exclusions, tuning, retries or sweep. In order: input admission; one unchanged baseline process, both sets; one signed synthetic fixture process; five fresh serial candidate processes, each original then heldout, same fixture and numerical environment. Compare exact result records/hashes to run 1; summarize per-prompt/per-set numeric endpoints and decision counts across processes with n, median, sample SD, minimum, maximum. No debug run of this suite. Each stage has its own exclusive-create UTC-start receipt; write once. The repeated specialist outputs test deterministic behavior, not generalization.

Hand checks, in this order, independent of weights. (1) U a row of (-7,-5,-3,-1,1,3,5,7)/512. Multiplying by 256 gives (-3.5,-2.5,-1.5,-0.5,0.5,1.5,2.5,3.5); nearest even gives (-4,-2,-2,0,0,2,2,4). Multiplying by 64 gives (-7,-5,-3,-1,1,3,5,7)/8; ±7/8 and ±5/8 round to ±1, others zero: (-1,-1,0,0,0,0,1,1). (2) A 1-by-2304 input with first coordinate 3/512, rest zero. Gate and up each have one 2304-coordinate row, first entry +2048 and -2048 respectively, all others zero. Q8 nearest even of 1.5 is 2. Dots 2*(±2048)=±4096. Check actual production pre-key pair in gate/up order: floor((4096+4096)/8192)=1, floor((-4096+4096)/8192)=0. (3) Wrong-answer control on the same dots with old shift 11: floor(5120/2048)=2, floor(-3072/2048)=-2. The same pair-equality predicate expecting (1,0) must reject (2,-2). (4) Four scalar cases, in order -8188, +8188, -8189, +8189 divided by 256 before conversion. Exact integer preclip. Outputs respectively -8188,8188,-8188,8188; event counts respectively 0,0,1,1 with denominator 1 each. No other candidate is scored.

## Prior art

F supplies decoded-weight pre-convolution, pre-residual reference. R supplies integer routing; W widened the router only and is the #267/#256 continuation baseline described above. A fixed these four agreeing prompts and reported signed projections on one substitution order, not causal fractions or a prediction for this change in isolation. Here one expert-input width changes at fixed routing and the original score is retained. Away from clipping the componentwise nearest-rounding bound goes from 1/128 to 1/512; neither is an output bound.

This step does not test any other layer, prompt set, width, router, native activation-quantized runtime, convolution, residual, closed-loop output, proof, verifier, integrated port or measured proof cost. No independent replication or public headline.

## Amendments
23 changes: 23 additions & 0 deletions experiments/20261203-287-inkling-expert-input-q8/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Scoring the Q8 expert input

This is a numerical comparison, not a proof or a verifier. The router and the decoded-weight reference run from the frozen source specified in `PREREG.md`. `q8.py` follows the pinned W `widened.compute` body. Compare the two files: the changes are the expert operand/clip count, gate/up shift, bound checks, and reported input exponent. The score definitions, table lookups and reference operations stay in the same order. W `score.capture` observes the two original top-eight calls without altering either return. `measure.py` independently checks their hashes and the normalized integer weight hash. No output vector is stored.

## Reproduction

Use a separate checkout with a new receipt directory: do not overwrite or extend committed run files. Copy this experiment's `measure.py` and `q8.py` into a fresh sibling directory of `experiments/` at the pinned base, preserving F, R, W, A unchanged there. `EXPERIMENT` below names that new directory. Use Python 3.12 with NumPy 2.3.5 and generic tokenizers 0.22.1. No model-specific package. `BASE` is the read-only slice directory with `hdr8.bin`, `header.json`, `tokenizer.json` and `t/` as specified by R. `VIEW` is a new, nonexistent path on a local temporary volume for the private links/held-out pack. Commands below assume the environment variables have been set to these paths and `python` resolves to the pinned interpreter. Use a six-core CPU admission gate around the numerical commands on a shared host.

```sh
export OPENBLAS_NUM_THREADS=6 OMP_NUM_THREADS=6 MKL_NUM_THREADS=6
export PYTHONDONTWRITEBYTECODE=1 TOKENIZERS_PARALLELISM=false
taskset -c 0-5 python "$EXPERIMENT/measure.py" inputs "$VIEW" --base "$BASE"
taskset -c 0-5 python "$EXPERIMENT/measure.py" baseline "$VIEW"
taskset -c 0-5 python "$EXPERIMENT/measure.py" fixtures "$VIEW"
taskset -c 0-5 python "$EXPERIMENT/measure.py" candidate-1 "$VIEW"
taskset -c 0-5 python "$EXPERIMENT/measure.py" candidate-2 "$VIEW"
taskset -c 0-5 python "$EXPERIMENT/measure.py" candidate-3 "$VIEW"
taskset -c 0-5 python "$EXPERIMENT/measure.py" candidate-4 "$VIEW"
taskset -c 0-5 python "$EXPERIMENT/measure.py" candidate-5 "$VIEW"
taskset -c 0-5 python "$EXPERIMENT/measure.py" summary "$VIEW"
```

Stop after any nonzero exit; no continuation rule. Delete only the private view after use. Each baseline/candidate process builds the router table once, then scores the original and held-out sets in sequence. Receipt `status` means execution integrity; `sets.*.passes` is the fidelity decision. `sets.*.four_token_median_pass` is the separate prompt-level question. `runs/summary.json` reports dispersion across deterministic processes, not new prompts or independent replications. Widths come from the layout derivation in `PREREG.md`, not a circuit measurement.
Loading