Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/benchmarks-mv/blob/main/evidence/q36-step-model-20261031/README.md # benchmarks-mv Measurement harnesses and evidence bundles for AIEN on the NVIDIA DGX Spark GB10. Speed is reported against the machine's physical limit and my own previous run. Attachment of AienOS. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `benchmarks-mv / evidence / q36-step-model-20261031 / README.md` 209 lines ยท 15376 bytes Raw Blame History Rendered 1 # q36 step-time model, version 1 (DRA-64) 2 3 Refs aien-dev/benchmarks-mv#65, Linear [DRA-64](https://linear.app/drake-stapleton/issue/DRA-64/pin-the-fitted-step-time-model-and-its-receipts-as-a-reproducible). 4 5 The fitted step-time model of one Qwen3.6-35B-A3B decode stroke (n heads, one token each) on one GB10: 6 7 t(n) = 9.13 + 3.29 n + 0.696 U(n) + 4.81 Ceiling[n/4] ms per stroke 8 U(n) = experts read per layer per stroke = routed-expert union of the n heads + 1 shared expert 9 10 `q36-step-model.wl` is the versioned model (`q36-step-model/1`). It is frozen: a change is a new versioned file opened 11 by a model-revision issue, never an edit of this one. Every number below is copied from 12 `q36-step-model-wolfram-raw.json` (hosted Wolfram Language evaluator, MCP tool `WolframLanguageEvaluator`); none is hand 13 computed. Host evidence only: no chip was used for this directory, and the ladder it fits is labelled 14 "shared chip, not a speed receipt" in its source README. 15 16 ## Files 17 18 | file | what | 19 |---|---| 20 | `inputs/` | copies of the source receipts, pinned by `SHA256SUMS` (source: aien-sovereign-core-mv ``d3dec0eb``, `evidence/motor-chip-`20261021`/`) | 21 | `derived/union-cells-*.json` | per-cell routed-expert union counts (31 decode steps x 40 layers) from the host goldens, by `scripts/union-cells.sh` | 22 | `derived/header-bytes.json` | weight bytes per launch class from the checkpoint safetensors headers, by `scripts/header-bytes.sh` | 23 | `inputs.wl` | the Wolfram association `q36in`, generated from the pinned files by `scripts/extract-inputs.sh` | 24 | `q36-step-model.wl` | the model: frozen parameters, `predict[n, U]`, `predictTokS`, `recordLever`, the fit procedure, the checks, the report | 25 | `q36-step-model-query.wl` | exactly what was sent: `inputs.wl` + `q36-step-model.wl` | 26 | `q36-step-model-wolfram-raw.json`, `q36-step-model-rerun-wolfram-raw.json` | two evaluations of the same query; `q36-step-model-rerun.diff` (0 bytes) is their text diff | 27 | `negctl-768.wl`, `negctl-perturbed.wl` | the two negative-control overrides; `negctl-*-query.wl` = inputs + override + model; `negctl-*-wolfram-raw.json` their outputs | 28 29 Goldens used by `scripts/union-cells.sh` (not copied, 3 MB; aien-sovereign-core-mv ``d3dec0eb`` `evidence/q36-host-`20261020`/`): 30 31 `cf0e0119aec93c4325cfed86fe7b2a2b669f768edbfe816082a3f11a0a066207` gen-p1.json 32 `7d4bd2b795f9d65f943c4c804e1ab06b8a77723b27a355c6daba81a38e08241a` gen-p2.json 33 `78168f26a505ee086a83b3efde3ba69041c4e381c63a17b2c95263aa68ca8142` gen-p3.json 34 `beb224ed1062a20b12dd5d0d47e3a3bd480d296688dc2c03db6feb333479932c` gen-p4.json 35 `3dad6e46beb121036173cc12c304c4739a54ed96fbc5f99fb81bacd2c3ebee69` gen-chat-code.json 36 `d1266bdda1c6281423fc1b9338dce3087234fb56b2a0917173e0c9ac5a738f5c` gen-chat-prose.json 37 `394634b60fd0032e88651444694387a4a02fe1051cfcffd33c95c136468d1191` gen-chat-prose2.json 38 `570daa064d83fdaae1db69485b2d72dab807e0df7e84aab9a0b3c3916ce428b3` gen-chat-chat.json 39 `03e1df06010ac7f2e96431354a6c62678dc64af7747c4b93525dddffdb98fe9f` gen-chat-review.json 40 41 The pinned union script `inputs/expert-union.sh` run on these goldens reproduces all four pinned union files 42 (`expert-union-{4p,4chat,8prompts,8prompts-b}.json`) byte for byte (`cmp`, exit 0, 2026-10-31). 43 Checkpoint: `~/models/qwen3.6-35b-a3b-fp8-`95a723d0`` on the Spark; `derived/header-bytes.json` records the sha256 of 44 `config.json` and of each of the 41 safetensors header blobs it read (layers 0-39 and `outside.safetensors`; 45 `mtp.safetensors` excluded). Only headers are read; no tensor data and no model load. 46 47 ## Reproduce 48 49 cd evidence/q36-step-model-`20261031` 50 sha256sum -c SHA256SUMS 51 scripts/header-bytes.sh ~/models/qwen3.6-35b-a3b-fp8-`95a723d0` | cmp - derived/header-bytes.json 52 (cd /evidence/q36-host-`20261020` && /scripts/union-cells.sh gen-p1.json gen-p2.json) | cmp - derived/union-cells-ladder2-p1p2.json # likewise for each union-cells file, sets below 53 scripts/extract-inputs.sh | cmp - inputs.wl 54 { cat inputs.wl; echo; cat q36-step-model.wl; } | cmp - q36-step-model-query.wl 55 { cat inputs.wl; echo; cat negctl-768.wl; echo; cat q36-step-model.wl; } | cmp - negctl-768-query.wl 56 { cat inputs.wl; echo; cat negctl-perturbed.wl; echo; cat q36-step-model.wl; } | cmp - negctl-perturbed-query.wl 57 # send each *-query.wl as one WolframLanguageEvaluator call; the text must equal the matching *-wolfram-raw.json .text 58 59 Union sets: `ladder1-p1` {p1}, `ladder2-p1p2` {p1, p2}, `ladder4-p1234` {p1..p4}, `ladder8-setb` {p1..p4, chat-code, 60 chat-prose2, chat-chat, chat-review}, `4chat` {chat-code, chat-prose, chat-chat, chat-review}, `8a` {p1..p4, chat-code, 61 chat-prose, chat-chat, chat-review}, `pair-code-p2`, `pair-code-review`. The ladder sets are the goldens of the 62 lever-2 ladder runs (`inputs/stroke{1,2,4,8}l2-real.json`, `conversations`). 63 64 ## Checks (all True in the main run) 65 66 | check | meaning | 67 |---|---| 68 | ladderMediansMatchReadme | the gate median of each `stroke_chip_ns` list equals the README ladder (L247-250) to 0.0005 ms | 69 | ladderMediansMatchFileField | and equals the file's own `stroke_chip_ns_median` exactly | 70 | stampsMedianMatchesLog | the stamped run's median equals the 84.076 ms in its log | 71 | stampsKindsSumToTotal | the per-kind stamp times sum to the timeline's `total_ns` | 72 | ladderHeadsAre1248 | the four ladder files are 1, 2, 4, 8 heads | 73 | pinnedUnionMeansRederived | Wolfram's mean of the union cells equals each pinned file's `mean_union` (1e-9) | 74 | expertBytesContract | header bytes per expert = 3*2048*512 FP8 + 3*(16*4) BF16 scales x 2 B = 3,146,112; shared expert the same; 256 routed experts; 40 layers | 75 | lmHeadBytes | lm_head = 248320 x 2048 x 2 B | 76 | mixBytesMatchReadme0944GB | mix bytes round to the README's 0.944 GB | 77 | fitPublishedReproducedLinearU | the fit procedure below reproduces a, b, c, h, RMS within half a unit of their published last digit | 78 | linearU4U8MatchPinnedUnions | Linear U(4) 30.7 and U(8) 55.6 are the pinned 4chat and mean(set a, set b) unions + 1 (U(1) = 9 holds by construction; U(2) = 16.3 has no pinned source and is not checked) | 79 | indepFormulaMatchesPinnedFiles | 1 + 256(1-(31/32)^n) minus the shared expert equals the `independent_draws` of the pinned 8prompts and 4p files (1e-9) | 80 | publishedPinT8 | pin of the published text, reads no input: t(8, 55.6) = 83.7676 ms and 95.50 tok/s | 81 | publishedPinIndep8 | pin of the published text, reads no input: independent-draw U(8) rounds to 58.4 and gives 93.3 tok/s | 82 | weightClassesBelowCeiling | no weight class runs above 273 GB/s with the corrected bytes | 83 84 The gate median is the upper median (element Floor[len/2]+1 of the sorted list), the convention of the stroke gate and 85 of the README. Wolfram's `Median` (mean of the middle pair) gives 25.30227, 32.457668, 44.288881, 85.427837 ms; the fit 86 uses the gate's 25.320206, 32.464756, 44.350601, 85.427837 ms. 87 88 ## Fit procedure (reproduces the published numbers) 89 90 c = (gate_up + down chip time of the stamped lever-2 eight-head stroke) / U(8) = 38.69792 ms / 55.6 91 h = (lm_head chip time of that stroke) / (2 lm_head launches) = 9.619136 ms / 2 92 a, b = least squares of median(n) - c U(n) - h Ceiling[n/4] over n = 1, 2, 4, 8 93 94 [INFERENCE] c and h come from ONE stamped shared-chip stroke (`timeline_last_stroke`, total_ns `77738400`), not from a 95 median, so they carry that stroke's noise and the stamping overhead. c assumes the gate_up + down time is fully 96 proportional to U with no fixed per-launch term; a fixed term, if any, is absorbed into a and b. 97 98 | U set | a | b | c | h | RMS ms | residuals n = 1, 2, 4, 8 (ms) | 99 |---|---|---|---|---|---|---| 100 | Linear (9, 16.3, 30.7, 55.6) | 9.12862 | 3.288456 | 0.696006 | 4.809568 | 2.418624 | 1.82951, 0.604763, -4.108787, 1.674514 | 101 | ladder-matched (9, 16.749194, 30.374194, 55.541129) | 9.01357 | 3.31065 | 0.696743 | 4.809568 | 2.314708 | 1.915726, 0.350426, -3.87816, 1.612008 | 102 | independent draws (9, 16.75, 31.531006, 58.420831) | 9.53677 | 3.248511 | 0.662399 | 4.809568 | 2.28722 | 1.763763, 0.526208, -3.875897, 1.585926 | 103 104 The published (rounded) parameters against the four ladder medians: RMS 2.418561 ms, residuals 1.826206, 0.599956, 105 -4.116599, 1.660237 ms. A free four-parameter solve (a -66.42103, b -80.574258, c 12.016275, h 64.169018) passes 106 through all four points by construction and is not a model; it is reported only to show that four points cannot 107 discriminate four free parameters, which is why c and h come from the stamped timeline. 108 109 U difference report: the Linear U values do not come from the ladder's own conversations. Ladder-matched minus Linear: 110 0, +0.449194, -0.325806, -0.058871. U(2) = 16.3 has no pinned source: the ladder pair {p1, p2} gives 16.749194; the 111 closest pinned pairs are chat-code + p2 (16.342742) and chat-code + chat-review (16.289516). Only the Linear U set 112 reproduces the published parameters; the ladder-matched set gives the second row of the table above (h unchanged). 113 114 ## Variants at n = 8 115 116 | variant | U(8) | t ms | tok/s | 117 |---|---|---|---| 118 | measured union (Linear) | 55.6 | 83.7676 | 95.502318 | 119 | independent-draw union, exact 1 + 256(1-(31/32)^8) | 58.420831 | 85.730898 | 93.315248 | 120 | independent-draw union, Linear rounding | 58.4 | 85.7164 | 93.331031 | 121 | ladder-matched (set b) | 55.541129 | 83.726626 | 95.549055 | 122 123 ## Per-class achieved bandwidth, corrected bytes 124 125 Stamped lever-2 eight-head stroke (`inputs/stroke8l2-stamps.json` `timeline_last_stroke`, 1469 launches, total_ns `77738400`). 126 Stamps cost chip time and the chip was shared: these are stamped-timeline rates, not speed receipts. Expert bytes use 127 the header-read 3,146,112 B per expert and U(8) = 55.541129 (set b, the stamped run's conversations). 128 [INFERENCE] The timeline is the last stroke; its exact union is not recorded, so the mean set-b union stands in for it. 129 [INFERENCE] The gate_up and down launches include the shared expert (one launch per layer per kind, 40 each). 130 131 | class | bytes per stroke | launches | ms | GB/s | % of 273 GB/s | 132 |---|---|---|---|---|---| 133 | experts gate_up + down | 6.`989544501677419e9` | 80 | 38.69792 | 180.618093 | 66.160474 | 134 | experts gate_up | 4.`659696334451613e9` | 40 | 22.839968 | 204.015012 | 74.730773 | 135 | experts down | 2.`329848167225806e9` | 40 | 15.857952 | 146.919865 | 53.8168 | 136 | lm_head bf16 (2 four-head reads) | 2.`03423744e9` | 2 | 9.619136 | 211.478187 | 77.464537 | 137 | mix (FP8 + scales) | 9.`438336e8` | 40 | 6.501856 | 145.163719 | 53.173524 | 138 | o_proj (FP8 + scales) | 3.`3558528e8` | 40 | 2.433344 | 137.911154 | 50.516906 | 139 | router (bf16 256 x 2048) | 4.`194304e7` | 40 | 2.131328 | 19.679299 | 7.208534 | 140 | ab (bf16 in_proj_a, in_proj_b) | 7.`86432e6` | 30 | 0.419776 | 18.734563 | 6.862477 | 141 | superseded: experts at 768-wide 3 x 2048 x 768 B | 1.`0483037084903227e10` | 80 | 38.69792 | 270.894071 | 99.228597 | 142 143 The source README computed its expert rows with the 768-wide expert (4,718,592 B), which put the experts near the 144 ceiling (last row). With the header bytes the expert GEMVs run at 66 % of 273 GB/s: the experts are not at the 145 bandwidth wall, and the remaining headroom is a lever input, not a fixed cost. gdn, attn and the small kinds read 146 state rather than weights and have no row. 147 148 ## Projection rows 149 150 | n | U independent draws | t ms | tok/s | status | 151 |---|---|---|---|---| 152 | 1 | 9 | 23.494 | 42.564059 | independent-draw variant (fitted range n <= 8) | 153 | 2 | 16.75 | 32.178 | 62.154267 | independent-draw variant (fitted range n <= 8) | 154 | 4 | 31.531006 | 49.04558 | 81.556788 | independent-draw variant (fitted range n <= 8) | 155 | 8 | 58.420831 | 85.730898 | 93.315248 | independent-draw variant (fitted range n <= 8) | 156 | 16 | 102.962162 | 152.671665 | 104.800062 | architecture projection until OMEGA_GPU_Q36_MAX_HEADS > 8 is qualified | 157 | 32 | 164.313846 | 267.252437 | 119.736981 | architecture projection until OMEGA_GPU_Q36_MAX_HEADS > 8 is qualified | 158 | 64 | 223.442488 | 452.165971 | 141.540947 | architecture projection until OMEGA_GPU_Q36_MAX_HEADS > 8 is qualified | 159 160 `OMEGA_GPU_Q36_MAX_HEADS` is 8 (omega-mv ``474197e4`` `src/omega_gpu_q36_graph.h` L66). Rows with n >= 16 are outside 161 every measurement and stay projections until a qualified build raises that limit. 162 163 ## Procedure for later lever issues (10 % rule) 164 165 Every lever issue that changes the stroke records predicted against measured stroke time with this model, before 166 claiming a speedup: 167 168 1. Measure the lever's stroke median with the stroke gate (gate median, `stroke_chip_ns_median`) at n heads, in a 169 spark-window, and its union U(n) with `scripts/union-cells.sh` on the run's goldens (Wolfram `1 + Mean[cells]`). 170 2. Evaluate `inputs.wl` + `q36-step-model.wl` + `recordLever["DRA-NN lever", n, U, measuredMs]` in the 171 WolframLanguageEvaluator; save the raw json beside the lever's receipt. 172 3. `verdict` is `WITHIN_MODEL` when |measured - predicted| / predicted <= 10 %, else `OPEN_MODEL_REVISION_ISSUE`: 173 open a model-revision issue in aien-dev/benchmarks-mv citing the raw json; the revision adds a new versioned 174 `.wl` (q36-step-model/2) with its own pinned inputs, and lever predictions keep citing the version they used. 175 A lever that is designed to change a term (for example h after an XBATCH change) predicts with the revised term 176 and states which term it changed. 177 4. `scope` marks n > 8 as an architecture projection. 178 179 In-sample residuals of the published model on its own ladder, (measured - predicted)/predicted, report key 180 `publishedModelResidualFraction`: n = 1 +0.077731, n = 2 +0.018828, n = 4 -0.084936, n = 8 +0.01982 (main run). 181 The rule stays as specified (> 10 % opens a model-revision issue), but at n = 4 the model already sits 182 1.5064 points inside it (WolframLanguageEvaluator: `100 (1/10 - 0.084936)` -> 1.5064), so a no-op lever can trip 183 the rule there from shared-chip drift alone. Measure in a quiet spark-window and compare against the lever's own 184 no-op control before opening the issue. 185 186 The main run carries two worked examples: measured = 1.05 x predicted gives residual 0.05, `WITHIN_MODEL`; 187 1.15 x predicted gives 0.15, `OPEN_MODEL_REVISION_ISSUE`. Applying the rule to a later lever is NOT_RUN here. 188 189 ## Negative controls 190 191 | control | override | checks that went False | allChecksPass | 192 |---|---|---|---| 193 | `negctl-768` | expert bytes = 3 x 2048 x 768 | expertBytesContract | False | 194 | `negctl-perturbed` | n = 4 ladder strokes x 1.05 | ladderMediansMatchReadme, ladderMediansMatchFileField, fitPublishedReproducedLinearU (a 9.610692, b 3.307739, RMS 1.487754) | False | 195 196 The 768-wide expert keeps `weightClassesBelowCeiling` True (270.894071 GB/s, under 273): the ceiling check alone would 197 not catch it, the header-bytes contract does. 198 199 ## Status 200 201 | item | status | 202 |---|---| 203 | inputs pinned by sha256, model reproduces the published fit | PASS (host, Wolfram) | 204 | measured-union and independent-draw variants | PASS (host, Wolfram) | 205 | per-class bandwidth from corrected bytes | PASS (host, Wolfram; stamped shared-chip timeline, not a speed receipt) | 206 | predicted vs measured procedure and `predict[n, U]` | IMPLEMENTED, exercised on two synthetic examples; application to later levers NOT_RUN | 207 | n >= 16 rows labelled projections | PASS | 208 | rerun determinism | PASS (two evaluations, text diff empty) | 209 | chip qualification of the model | NOT_RUN (no chip run in this directory) |