HiramKHackenbacker commited on
Commit
81c2abf
Β·
verified Β·
1 Parent(s): 60bc67d

docs: refresh measured performance (local retest 2026-08-18)

Browse files
Files changed (1) hide show
  1. README.md +107 -124
README.md CHANGED
@@ -18,19 +18,24 @@ tags:
18
  # Gemma 4 E2B β€” Core AI (.aimodel)
19
 
20
  `google/gemma-4-E2B-it-qat-q4_0-unquantized` converted to Core AI `.aimodel` bundles for
21
- Apple silicon by the [Visible](https://visible.cx) project. **Derivative artifacts**:
22
- Google's QAT-trained weights rounded onto the int4 grid they were trained for and
23
- re-expressed as a Core AI graph.
 
24
 
25
  Gemma 4 E2B uses **Per-Layer Embeddings**, so these bundles take a large embedding gather
26
- table as a *static graph input* rather than carrying it in the graph. That table ships here
27
- in `ios-frontend/` and **the bundles do not load without it** β€” a missing table produces a
28
- bare input-arity error that says nothing about tables.
29
-
30
- Of the Gemma 4 bundles in this catalog, this is **the only one worth considering for
31
- structured-output work**: 10/10 schema-clean at 29 tok/s on a 16 GB Mac. It is still 4Γ— the
32
- cost per row of the LFM2.5 1.2B at 3Γ— the peak memory, so it earns a slot only where
33
- Gemma's output specifically is wanted.
 
 
 
 
34
 
35
  ## Provenance
36
 
@@ -44,7 +49,7 @@ Gemma's output specifically is wanted.
44
  | Producer fingerprint | `coreai-core 1.0.0b2` on every inner asset `metadata.json` |
45
  | Weight format | **int4, per-block-32** (`int4lin`, symmetric-with-clipping) β€” the ggml q4_0 grid the QAT checkpoint was trained on |
46
  | Vocab | 262,144 |
47
- | Conversion | 180 s (decode) / 105 s, 26.8 GB peak RSS (pf64); Linux x86_64 |
48
 
49
  "QAT-unquantized" means QAT-*trained*, stored at full width; the int4 rounding happens at
50
  export, onto the grid training already targeted.
@@ -57,30 +62,30 @@ entrypoint, `prefill`, with a static query width of 64
57
 
58
  ### Bundles
59
 
60
- | Path | Bytes | Context | Functions | Status |
61
- |---|---:|---|---|---|
62
- | `gpu-pipelined/gemma4_e2b_qat_decode_int4lin_tbl_pf64` | 2,122,089,973 | 4096 | main + prefill | the working bundle |
63
- | `ctx8192/gpu-pipelined/gemma4_e2b_qat_decode_int4lin_tbl_pf64` | 2,122,089,964 | 8192 | main + prefill | same weights, wider manifest |
64
- | `ctx16384/gpu-pipelined/gemma4_e2b_qat_decode_int4lin_tbl_pf64` | 2,122,089,964 | 16384 | main + prefill | same weights, wider manifest |
65
- | `gpu-pipelined/gemma4_e2b_qat_decode_int4lin_tbl` | 2,121,479,596 | 4096 | main | superseded β€” no `prefill`, see below |
66
- | `w4a8/gemma4_e2b_qat_decode_int4lin_a8_tbl_pf64` | 2,122,679,604 | 16384 | main + prefill | **EXPERIMENTAL** |
67
 
68
  Each bundle folder holds `<name>.aimodel/` (`main.mlirb` β‰ˆ 2.09 GB, `main.hash`, asset
69
  `metadata.json`), a bundle-level `metadata.json`, and `tokenizer/` (`tokenizer.json`
70
  32,169,626 B, `tokenizer_config.json`, `generation_config.json`, `chat_template.jinja`
71
- 18,569 B). The `w4a8` folder additionally ships its `calibration_corpus.jsonl`
72
- (35,045 B).
73
-
74
- **The three `_tbl_pf64` context folders are the same weights.** `--max-ctx` does not change
75
- the exported graph β€” identical function signatures, identical state descriptors, identical
76
- export peak RSS at every value. It changes exactly one thing:
77
- `language.max_context_length` in the bundle manifest. This was proved with a same-config
78
- control re-export whose `main.mlirb` differed from its twin by *more* bytes (22,053) than a
79
- 4096β†’8192 pair does (22,344); the context delta is inside the conversion noise floor.
80
- Corroborated by the upload itself: pushing a "new" ~2 GB ctx8192 bundle into a repo that
81
- already held the 4096 bundle transferred a few hundred kB of new data. Pick the folder whose
82
- manifest integer matches the window you intend to run; a context bump is a manifest edit,
83
- not a conversion.
84
 
85
  ### The PLE gather-table sidecar β€” required, not optional
86
 
@@ -103,26 +108,22 @@ not a conversion.
103
  exporter assumes).
104
 
105
  Every `_tbl` bundle binds `ple_table` (from `embed_per_layer.i8`, 2.35 GB) and `ple_scale`
106
- (from `embed_per_layer.scale.f32`) as **static** graph inputs. Without them the bundle fails
107
- to load with a bare arity error naming `ple_table`/`ple_scale` β€” a diagnosis this project
108
- got wrong once already. The sidecar is published here so the repo is self-contained for
109
- both loading and a pf64 rebuild.
110
 
111
  ## Requirements
112
 
113
  - **Apple silicon Mac**, Core AI runtime.
114
  - **Engine contract: 4 inputs** β€” `input_ids`, `position_ids`, plus static `ple_table` and
115
- `ple_scale`. Two engines can take that:
116
- - **Pipelined engine** β€” binds the statics zero-copy over the caller's buffer, but
117
- **does not support logits**, so no grammar-constrained decoding.
118
- - **Sequential engine** β€” the only logits-capable engine, and therefore the only one
119
- guided decoding can run on. It accepts `>= 2` inputs and binds everything beyond
120
  `input_ids`/`position_ids` from `EngineOptions.staticInputBuffers`; an extra input with
121
  no buffer is rejected by name. It pays a **one-time copy of every constant input at
122
- load β€” 2.19 GB for E2B** β€” because its submission path otherwise materialises a foreign
123
- buffer-backed view on *every* forward pass. That was measured: binding the table as a
124
- raw view cost ~0.30 s per pass (3.4 tok/s, 64 s/row); copying once at load took the same
125
- bundle to 8.6 s/row, a 7.5Γ— improvement.
126
  - **States:** `keyCache` / `valueCache` `Float16, 15 Γ— 1 Γ— 1 Γ— ? Γ— 512`. Dynamic sequence
127
  dim β†’ `GrowingKVCache` (initial 256, doubling), not a static allocation at the manifest
128
  maximum.
@@ -137,106 +138,93 @@ both loading and a pf64 rebuild.
137
  | Base | **4.44 GB** |
138
  | Affordable context, fp16 KV | ~204k tokens β†’ **131,072, the model cap, binds first** |
139
 
140
- KV is not the ceiling at this tier; **the PLE table is**, at 2.35 GB against a 503 MB KV
141
- cost even at 16384. Measured peak footprint on a guided run: **8.9 GB**.
 
 
142
  - Sliding-window note: E2B interleaves 12 sliding and 3 full attention layers across 35
143
  layers collapsed to 15 KV slots. The export models the window in the *mask*, not in
144
  memory β€” sliding layers occupy full-length slots and zero-pad head_dim 256β†’512, so 80% of
145
- KV bytes sit in windowed slots and 40% is dead padding. A ring-buffered sliding cache
146
- would be ~5Γ— cheaper per token; that is model authoring, not a flag, and it is not needed
147
- at this tier.
148
- - `runtime_env COREAI_CHUNK_THRESHOLD=1` travels with the recipe. (Both engines now read the
149
- static query width off the graph, so the older host-side rules about warmup query length
150
- and chunk threshold are retired.)
151
 
152
- ## Measured performance
153
 
154
- Measured on a **16 GB M2 Pro Mac (macOS 27 beta)** with the out-of-process `coreai-repro`
155
- harness: 10 real enrichment rows (5 POST, 5 COMMENT), the app's live `app_litert` JSON
156
- schema, greedy decoding through `respondJSON(to:schema:)`, `reset()` per row, **sequential
157
- engine with the PLE tables bound as static inputs**, 128-token cap.
158
 
159
  | | `_tbl_pf64` | `_tbl` (no `prefill` function) |
160
  |---|---|---|
161
- | Load | 14.6 s | 29.0 s |
162
  | Guided JSON parse | **10/10** | 3/3 |
163
  | Enum-clean | **10/10** | 3/3 |
164
- | s/row (POST) | **7.06** | 44.69 |
165
- | s/row (COMMENT) | **4.27** | β€” |
166
- | Decode | 21.8–33.5 tok/s, mean **28.6** | 7.7–16.8 tok/s |
167
- | TTFT | 0.6–4.7 s | 29–37 s |
168
- | Peak footprint | 8.9 GB | β€” |
169
- | Outcome | completed all ten rows | **died at row 4** |
 
170
 
171
  **`pf64` is worth 7.7Γ— on time-to-first-token.** Head to head on the same 942-token prompt
172
  and the same weights, differing only in whether the S=64 `prefill` function was exported:
173
  TTFT 35.74 s β†’ 4.65 s, s/row 45.04 β†’ 8.83. Decode is untouched β€” the prefill function only
174
- serves full-width chunks. The non-`pf64` bundle is also not durable: its footprint ballooned
175
- past 37 GB across ~2,800 single-token passes and the campaign died partway through.
 
 
 
 
 
 
 
 
 
 
176
 
177
- **Enum conformance is the grammar's doing, and it is decisive.** Unguided, Gemma 4 invents
178
- an off-schema `motivation` value on essentially every row (`advocacy` for `advocate`,
179
- `informative` β€” a valid *tone* β€” used as a *motivation*). Guided, all ten are correct, not
180
- because the model improved but because an off-enum token is unsamplable. Decode throughput
181
- is essentially unchanged by the constraint; the ~25% extra cost of a guided row is the
182
- sequential engine's step-synchronous prefill, not the grammar.
183
 
184
- **Context for the cost.** On the same harness and machine, LFM2.5-1.2B runs 1.77/1.30 s/row
185
- at 3.06 GB peak, and Gemma 4 E4B runs 21.89/12.36 s/row at 10.7 GB peak. This bundle is
186
- about **4Γ— the 1.2B's s/row for 3Γ— its peak memory**. For reference, upstream measured E2B
187
- at 77.0/87.1 tok/s on an M4 Max, and an unguided pipelined run on this 16 GB Mac reached
188
- 44.3 tok/s β€” the 28.6 tok/s above is the guided, sequential-engine figure.
189
 
190
- Nothing was measured above 4096 tokens. Quality at depth is a genuine open question: beyond
191
- ~4k the long-range signal rides on 3 full-attention layers, and widening the manifest does
192
- not widen the sliding layers' 512-token window.
193
 
194
- ## Qualification status
 
 
 
 
195
 
196
  | Artifact | Status |
197
  |---|---|
198
- | `gpu-pipelined/gemma4_e2b_qat_decode_int4lin_tbl_pf64` (ctx 4096) | **QUALIFIED β€” measured.** 10/10 parse, 10/10 enum-clean, 7.06/4.27 s/row, 28.6 tok/s, 8.9 GB peak. The best Gemma in this catalog for structured output, and still not a default over the LFM tier. |
199
- | `ctx8192/…_tbl_pf64` | **QUALIFIED BY EQUIVALENCE, UNMEASURED AT DEPTH** β€” same weights, same graph, wider manifest integer; no run above 4096 tokens. |
200
- | `ctx16384/…_tbl_pf64` | **QUALIFIED BY EQUIVALENCE, UNMEASURED AT DEPTH** οΏ½οΏ½οΏ½ as above. |
201
- | `gpu-pipelined/gemma4_e2b_qat_decode_int4lin_tbl` | **DEPRECATED β€” superseded by its `_pf64` sibling.** Same weights, no `prefill` function: 8Γ— the TTFT and it did not survive a ten-row campaign. Kept published because it is an immutable artifact that earlier revisions pin; there is no reason to ship it. |
202
- | `w4a8/gemma4_e2b_qat_decode_int4lin_a8_tbl_pf64` | **EXPERIMENTAL β€” built, unmeasured.** Gate: a Mac-side oracle/parity check plus a device benchmark, neither of which has been run. Do not route production traffic to it. |
203
 
204
  ### About the `w4a8` bundle
205
 
206
  Same QAT int4 per-block-32 weights and the same graph as
207
  `gpu-pipelined/gemma4_e2b_qat_decode_int4lin_tbl_pf64`; the difference is an int8
208
  quantize/dequantize pair on the inputs of every `F.linear`, calibrated on 128 synthetic
209
- social-media-style samples (the corpus ships in the folder). It was built as a prefill/TTFT
210
- lever.
211
-
212
- The caveat is load-bearing and comes from the compression toolchain's own documentation:
213
- the runtime fast path is `W_INT8 Γ— A_INT8`, and a float weight path executes in floating
214
- point *regardless* of activation quantization. These weights use int4 scale-multiply
215
- dequant, not an int8 LUT, so the expected TTFT gain may be **zero or negative**. This bundle
216
- exists to be measured, not because a win is predicted.
217
-
218
- ## Verification
219
-
220
- - **Producer fingerprint:** every inner `<name>.aimodel/metadata.json` reads
221
- `producer: "coreai-core 1.0.0b2"`. `coreai-torch 0.4.0` / `coreai-core 1.0.0b1` produce
222
- ODIE-poisoned bundles that abort **in-process** at load, taking the host application down
223
- uncatchably. The field lives in the **inner asset** metadata; the bundle manifest never
224
- carries a `producer` field, for good and bad bundles alike, so a check against the
225
- manifest condemns every good bundle.
226
- - **Stop token, verified per folder:** every bundle here declares `eos_token = "<turn|>"`.
227
- Gemma 4 ends a *turn* with `<turn|>` (id 106); the raw upstream `<eos>` ends the whole
228
- sequence, and a host stopping on it overruns every reply. The exporter copies the upstream
229
- tokenizer config verbatim and does **not** apply this correction β€” it is a post-export
230
- patch, and it was checked on these bundles rather than assumed.
231
- `generation_config.json` independently lists `eos_token_id: [1, 106, 50]`.
232
- - **Determinism:** `.aimodel` conversion is not byte-reproducible. `main.mlirb` differs by
233
- ~22 kB between two runs of an identical command on the same box β€” which is why the
234
- context-folder comparison above needed a same-config control to be meaningful at all.
235
- Integrity rests on per-file SHA-256 of the exact published artifact, never on rebuilding.
236
- - **No oracle gate has been run on this model.** The 10/10 results are behavioural (parse
237
- rate, enum conformance, clean stop) on Visible's own task. A decode oracle against an fp32
238
- reference β€” the gate that would catch an int4 or kernel-level numerics error β€” has not been
239
- run on any Gemma 4 bundle in this catalog.
240
 
241
  ## License
242
 
@@ -247,9 +235,4 @@ model and **the Gemma terms apply downstream**, which is why this repo declares
247
  [Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy) and the
248
  [Gemma 4 license](https://ai.google.dev/gemma/docs/gemma_4_license). Those obligations
249
  travel with any redistribution of these bundles, including the gather-table sidecar, which
250
- is derived from the same weights. Visible's contribution is the conversion, not the weights.
251
-
252
- ---
253
-
254
- *Additional variants may land in this repo after this card was written; the tables above
255
- describe its contents as listed at the time of writing.*
 
18
  # Gemma 4 E2B β€” Core AI (.aimodel)
19
 
20
  `google/gemma-4-E2B-it-qat-q4_0-unquantized` converted to Core AI `.aimodel` bundles for
21
+ Apple silicon by [visible-cx](https://huggingface.co/visible-cx). These are derivative
22
+ artifacts: Google's QAT-trained weights rounded onto the int4 grid they were trained for
23
+ and re-expressed as a Core AI graph. They load through Core AI on macOS and are not usable
24
+ by PyTorch, GGUF or MLX.
25
 
26
  Gemma 4 E2B uses **Per-Layer Embeddings**, so these bundles take a large embedding gather
27
+ table as a *static graph input* rather than carrying it in the graph. That table ships in
28
+ `ios-frontend/` and **the bundles do not load without it**; a missing table produces a bare
29
+ input-arity error naming `ple_table`/`ple_scale`.
30
+
31
+ > ⚠️ **Known issue β€” unguided generation.** On the current reference engine
32
+ > implementation, free-form (unguided) decoding exhibits unbounded Metal memory growth:
33
+ > approximately **80 MB of process `phys_footprint` per generated token**, on both the
34
+ > sequential and pipelined engines, scaling with prompt length. Long generations exhaust
35
+ > memory and the process is terminated. **Constrained/guided decoding is unaffected** and
36
+ > plateaus at 8–10 GB. A fix is in progress. Until it lands, use these bundles for
37
+ > guided/constrained generation only. A fixed token cap is not a reliable mitigation,
38
+ > because the safe cap shrinks as the prompt grows.
39
 
40
  ## Provenance
41
 
 
49
  | Producer fingerprint | `coreai-core 1.0.0b2` on every inner asset `metadata.json` |
50
  | Weight format | **int4, per-block-32** (`int4lin`, symmetric-with-clipping) β€” the ggml q4_0 grid the QAT checkpoint was trained on |
51
  | Vocab | 262,144 |
52
+ | Export functions | `main` (S=1 decode) and, in `_pf64` bundles, `prefill` (S=64 chunked prefill) |
53
 
54
  "QAT-unquantized" means QAT-*trained*, stored at full width; the int4 rounding happens at
55
  export, onto the grid training already targeted.
 
62
 
63
  ### Bundles
64
 
65
+ | Path | Bytes | Context | Functions |
66
+ |---|---:|---|---|
67
+ | `gpu-pipelined/gemma4_e2b_qat_decode_int4lin_tbl_pf64` | 2,122,089,973 | 4096 | main + prefill |
68
+ | `ctx8192/gpu-pipelined/gemma4_e2b_qat_decode_int4lin_tbl_pf64` | 2,122,089,964 | 8192 | main + prefill |
69
+ | `ctx16384/gpu-pipelined/gemma4_e2b_qat_decode_int4lin_tbl_pf64` | 2,122,089,964 | 16384 | main + prefill |
70
+ | `gpu-pipelined/gemma4_e2b_qat_decode_int4lin_tbl` | 2,121,479,596 | 4096 | main |
71
+ | `w4a8/gemma4_e2b_qat_decode_int4lin_a8_tbl_pf64` | 2,122,679,604 | 16384 | main + prefill |
72
 
73
  Each bundle folder holds `<name>.aimodel/` (`main.mlirb` β‰ˆ 2.09 GB, `main.hash`, asset
74
  `metadata.json`), a bundle-level `metadata.json`, and `tokenizer/` (`tokenizer.json`
75
  32,169,626 B, `tokenizer_config.json`, `generation_config.json`, `chat_template.jinja`
76
+ 18,569 B). The `w4a8` folder additionally ships its `calibration_corpus.jsonl` (35,045 B).
77
+
78
+ **The three `_tbl_pf64` context folders hold the same weights and the same graph.**
79
+ `--max-ctx` changes exactly one thing: `language.max_context_length` in the bundle
80
+ manifest. Function signatures, state descriptors and export peak RSS are identical at every
81
+ value, and the byte differences between the folders are conversion nondeterminism rather
82
+ than content. Pick the folder whose manifest integer matches the window you intend to run;
83
+ a context bump is a manifest edit, not a conversion.
84
+
85
+ **Stop token:** every bundle declares `eos_token = "<turn|>"` (id 106), which is the
86
+ turn terminator Gemma 4 emits. `generation_config.json` independently lists
87
+ `eos_token_id: [1, 106, 50]`. A host that stops on the raw upstream `<eos>` instead will
88
+ overrun every reply.
89
 
90
  ### The PLE gather-table sidecar β€” required, not optional
91
 
 
108
  exporter assumes).
109
 
110
  Every `_tbl` bundle binds `ple_table` (from `embed_per_layer.i8`, 2.35 GB) and `ple_scale`
111
+ (from `embed_per_layer.scale.f32`) as **static** graph inputs.
 
 
 
112
 
113
  ## Requirements
114
 
115
  - **Apple silicon Mac**, Core AI runtime.
116
  - **Engine contract: 4 inputs** β€” `input_ids`, `position_ids`, plus static `ple_table` and
117
+ `ple_scale`. Two engines accept that:
118
+ - **Pipelined engine** β€” binds the statics zero-copy over the caller's buffer, but does
119
+ not support logits, so no grammar-constrained decoding.
120
+ - **Sequential engine** β€” the only logits-capable engine, and therefore the only path for
121
+ guided decoding. It accepts `>= 2` inputs and binds everything beyond
122
  `input_ids`/`position_ids` from `EngineOptions.staticInputBuffers`; an extra input with
123
  no buffer is rejected by name. It pays a **one-time copy of every constant input at
124
+ load β€” 2.19 GB for E2B**, because its submission path otherwise materialises a foreign
125
+ buffer-backed view on every forward pass. Binding the table as a raw view instead costs
126
+ ~0.30 s per pass (3.4 tok/s); the load-time copy takes the same bundle to 8.6 s/row.
 
127
  - **States:** `keyCache` / `valueCache` `Float16, 15 Γ— 1 Γ— 1 Γ— ? Γ— 512`. Dynamic sequence
128
  dim β†’ `GrowingKVCache` (initial 256, doubling), not a static allocation at the manifest
129
  maximum.
 
138
  | Base | **4.44 GB** |
139
  | Affordable context, fp16 KV | ~204k tokens β†’ **131,072, the model cap, binds first** |
140
 
141
+ KV is not the ceiling at this tier; the PLE table is. Measured peak footprint on a guided
142
+ run: **8.26 GB**, max RSS 5.40 GB. **Minimum practical machine memory: 16 GB**, for
143
+ guided decoding only. Free-form generation does not fit this envelope on any machine β€”
144
+ see the known issue above.
145
  - Sliding-window note: E2B interleaves 12 sliding and 3 full attention layers across 35
146
  layers collapsed to 15 KV slots. The export models the window in the *mask*, not in
147
  memory β€” sliding layers occupy full-length slots and zero-pad head_dim 256β†’512, so 80% of
148
+ KV bytes sit in windowed slots and 40% is dead padding.
149
+ - The bundle manifest declares `runtime_env COREAI_CHUNK_THRESHOLD=1`. Both engines read
150
+ the static query width off the graph.
 
 
 
151
 
152
+ ## Performance
153
 
154
+ Measured on a **16 GB Apple silicon Mac (M2 Pro, macOS 27 beta)**: 10-sample harness,
155
+ guided JSON-constrained decoding against a fixed schema, greedy, sequential engine with the
156
+ PLE tables bound as static inputs, `reset()` between samples, 128-token cap. Load excluded
157
+ from `s/row`; sample 1 excluded as a cache-warm outlier.
158
 
159
  | | `_tbl_pf64` | `_tbl` (no `prefill` function) |
160
  |---|---|---|
161
+ | Load | 12.1 s | 29.0 s |
162
  | Guided JSON parse | **10/10** | 3/3 |
163
  | Enum-clean | **10/10** | 3/3 |
164
+ | s/row (long samples) | **6.12** | 44.69 |
165
+ | s/row (short samples) | **4.23** | β€” |
166
+ | Decode | **22.7–32.7 tok/s** | 7.7–16.8 tok/s |
167
+ | TTFT | **0.59–4.20 s** | 29–37 s |
168
+ | Peak footprint | 8.26 GB | β€” |
169
+ | Max RSS | 5.40 GB | β€” |
170
+ | Outcome | completed all ten samples | did not complete |
171
 
172
  **`pf64` is worth 7.7Γ— on time-to-first-token.** Head to head on the same 942-token prompt
173
  and the same weights, differing only in whether the S=64 `prefill` function was exported:
174
  TTFT 35.74 s β†’ 4.65 s, s/row 45.04 β†’ 8.83. Decode is untouched β€” the prefill function only
175
+ serves full-width chunks.
176
+
177
+ **Enum conformance is the grammar's doing.** Unguided, the model emits an off-schema enum
178
+ value on essentially every sample. Guided, all ten are correct, because an off-enum token
179
+ is unsamplable. Decode throughput is essentially unchanged by the constraint; the ~25%
180
+ extra cost of a guided sample is the sequential engine's step-synchronous prefill.
181
+
182
+ For reference, upstream measured E2B at 77.0/87.1 tok/s on an M4 Max, and an unguided
183
+ pipelined run on the 16 GB machine reached 44.3 tok/s. The 22.7–32.7 tok/s above is the
184
+ guided, sequential-engine figure.
185
+
186
+ ### Unguided workload β€” memory-capped
187
 
188
+ Free-form generation from a fixed prompt. **Every generation length below is a memory cap,
189
+ not a model stop** β€” see the known issue.
 
 
 
 
190
 
191
+ | depth | prompt tokens | TTFT | decode | generated | wall | peak footprint |
192
+ |---|---|---|---|---|---|---|
193
+ | 3.4k | 3314 | 12.21 s | 7.2 tok/s | 128 (capped) | 30.4 s | **19.97 GB** |
194
+ | 8k | 7972 | 54.01 s | 2.1 tok/s | 64 (capped) | 84.3 s | **36.71 GB** |
 
195
 
196
+ Output quality up to the cap is sound; the limit is memory, not capability.
 
 
197
 
198
+ **Needle-in-haystack recall: 3/3 verbatim at 8k**, within a 64-token cap (three distinctive
199
+ facts planted at 10/50/90% of the filler, strict scoring). 15k was not attempted: 8k
200
+ already cost 36.71 GB of footprint.
201
+
202
+ ## Status
203
 
204
  | Artifact | Status |
205
  |---|---|
206
+ | `gpu-pipelined/gemma4_e2b_qat_decode_int4lin_tbl_pf64` (ctx 4096) | **QUALIFIED FOR GUIDED GENERATION** β€” measured: 10/10 parse, 10/10 enum-clean, 6.12/4.23 s/row, 22.7–32.7 tok/s, 8.26 GB peak footprint. Not qualified for free-form generation on the current reference engine implementation. |
207
+ | `ctx8192/…_tbl_pf64` | **QUALIFIED BY EQUIVALENCE** β€” same weights and graph, wider manifest integer. Free-form at this depth is measured-unsafe (36.71 GB under a 64-token cap). |
208
+ | `ctx16384/…_tbl_pf64` | **QUALIFIED BY EQUIVALENCE** β€” as above; free-form at this depth was not attempted. |
209
+ | `gpu-pipelined/gemma4_e2b_qat_decode_int4lin_tbl` | **DEPRECATED** β€” same weights, no `prefill` function: 8Γ— the TTFT and it did not complete a ten-sample run. Superseded by its `_pf64` sibling. |
210
+ | `w4a8/gemma4_e2b_qat_decode_int4lin_a8_tbl_pf64` | **EXPERIMENTAL** β€” built, unmeasured. Gate: a Mac-side oracle/parity check plus a device benchmark. |
211
 
212
  ### About the `w4a8` bundle
213
 
214
  Same QAT int4 per-block-32 weights and the same graph as
215
  `gpu-pipelined/gemma4_e2b_qat_decode_int4lin_tbl_pf64`; the difference is an int8
216
  quantize/dequantize pair on the inputs of every `F.linear`, calibrated on 128 synthetic
217
+ samples (the corpus ships in the folder). It was built as a prefill/TTFT lever.
218
+
219
+ The caveat comes from the compression toolchain's own documentation: the runtime fast path
220
+ is `W_INT8 Γ— A_INT8`, and a float weight path executes in floating point *regardless* of
221
+ activation quantization. These weights use int4 scale-multiply dequant, not an int8 LUT, so
222
+ the expected TTFT gain may be zero or negative. This bundle exists to be measured, not
223
+ because a win is predicted.
224
+
225
+ **No numerics gate has been run on any bundle in this repo.** The 10/10 results are
226
+ behavioural (parse rate, enum conformance, clean stop); a decode oracle against an fp32
227
+ reference has not been run.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
 
229
  ## License
230
 
 
235
  [Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy) and the
236
  [Gemma 4 license](https://ai.google.dev/gemma/docs/gemma_4_license). Those obligations
237
  travel with any redistribution of these bundles, including the gather-table sidecar, which
238
+ is derived from the same weights. The contribution here is the conversion, not the weights.