Inkling-2-Mini-SM86-Fast / PROVENANCE.md
quant-mind's picture
Add Inkling-2-Mini-SM86-Fast (GPTQ int4, bf16 DSpark draft, 40960-id draft vocabulary)
f8033af verified
|
Raw History Blame Contribute Delete
11.4 kB
# Inkling-2-Mini-SM86-Fast
`thinkingmachines/Inkling-2-Mini` requantized for the `vllm-inkling2` SM86 runtime on
two RTX 3090s (TP2): routed experts and attention projections in symmetric `uint4b8`
GPTQ (group 128), the official bf16 DSpark draft, and a 40960-token pruned draft
vocabulary calibrated on the model's own outputs. Text only.
- Source: `thinkingmachines/Inkling-2-Mini` revision
`7a67ae2314b44ef05c87fd1d4d311c58aaeb18f6` (Apache 2.0; NVFP4/MXFP8 experts, bf16
dense), downloaded to the experiment directory (`source/`). Not modified there.
- Runtime: `quantforge-br/vllm-inkling2`, branch `inkling2-sm86`, at `682e8115a`
(fast-forward of the `inkling2-sm86-fast` work branch). The commits that matter
here: `e3a805ccb` Hessians from the serving engine, `2b2575523` symmetric uint4b8
GPTQ solver, `873ffc6ee` int4 attention straight into Marlin, `d599cd68e` INT8
embedding, `b304e4443` + `2890e08b0` INT8 QK^T prefill and KV splits, `682e8115a`
draft vocabulary loaded from the checkpoint (`mtp_config.pruned_vocab_size`).
- Recipe: `recipe.yaml`; scripts in `reproduce/` (prompt mix, self-distillation,
vocabulary, calibration corpus, Hessian collection, GPTQ, assembly, PPL).
- Self-distillation: 8469 prompts from 13 public datasets (code, code edits, tool
calls, math reasoning, EN and PT-BR chat), answered by the official checkpoint at
temperature 1.0 with a reasoning-effort mix: 5.68M generated tokens. The val split
(every 10th prompt per source) is disjoint from train by prompt.
- Draft vocabulary (report A1): the 40960 most frequent completion ids of the train
split (5,118,629 tokens), 20480 per TP shard of the target head, control tokens always
kept. Val coverage: general 99.03%, code 99.46%, tool 99.45%, prose EN 97.30%,
PT-BR 98.44% (`draft_vocab_ids.json` has the per-bucket counts).
- Calibration (report B1): 321 rows, 442,712 tokens: 45% code (generated, edits and raw
multi-file code of local public checkouts), 25% tool calls and reasoning, 30% EN /
PT-BR prose. Disjoint from the PPL gate corpus (model-loader `internal/**/*.go`).
- Hessians: collected by the serving engine running the official checkpoint (TP2,
prompt logprobs on, inputs accumulated over the three passes of the loop), attention
in one run, experts three layers per run.
- Quantization (reports B1 + B2): GPTQ, damp 0.01, a 64-row prior from the layer's
pooled Hessian for rarely routed experts, symmetric 4-bit, group 128, strictly
positive scales (9384 scale tensors, none ≤ 0, min 1.04e-3). Relative output error
per layer: experts w13 ~1.7–1.9e-3, w2 ~5e-3; attention ≤ 4.5e-3.
`embed_tokens`, `lm_head`, router, controllers, short convs, `rel_logits_proj`,
AttnRes and norms are copied unchanged in bf16; `model.visual.*` is dropped.
- Draft: `mtp.safetensors` is the official bf16 DSpark draft, unchanged. Its config adds
`mtp_config.pruned_vocab_size: 40960`; the runtime reads `draft_vocab_ids.pt` next to
the weights.
- Deviation from the report §5 layout: `embed_tokens` stays bf16 in the checkpoint and
becomes INT8 at load (`VLLM_INKLING2_EMBED_INT8=1`), so the checkpoint also loads
without the flag; the draft is bf16 (A2 rejected); the target head stays bf16 on disk
and is packed to W8 at load (A3 rejected).
- Consumer: profile `inkling-2-mini-26b-a3b-gptq-vllm-dspark-256k` (backend
`vllm-inkling2`). Required env: `VLLM_INKLING2_INT8_DENSE=1`,
`VLLM_INKLING2_DENSE_BITS=4`; promoted transforms: `VLLM_INKLING2_EMBED_INT8=1`,
`VLLM_INKLING2_PREFILL_ATTN_INT8=1`, `VLLM_INKLING2_PREFILL_ATTN_PV_F16ACC=1`,
`VLLM_INKLING2_PREFILL_ATTN_SPLITS=1`, `VLLM_INKLING2_DSPARK_MIN_CONFIDENCE=0.5`.
No `VLLM_INKLING2_GPTQ_DIR` (the weights are already GPTQ).
- Shared files: the `Inkling-2-Mini-SM86-Fast-Uncensored` unit hardlinks the files that
are byte-identical to this one (shards 1–5, `mtp.safetensors`, tokenizer files).
Either unit can be deleted alone.
## Decisions (one arm per change, ABA, release harness prompts)
Decode in tok/s on a direct-port server; code greedy (10 prompts × 500 tokens), code
T=1.0 (3 seeds), prose EN/PT-BR T=1.0 (2 seeds). Reference: the production AWQ profile
(`Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4` + attention GPTQ at load): 299.8 / 270.4 /
189.4.
| Front | Arm | Result | Decision |
|---|---|---|---|
| B1+B2 | uint4b8 GPTQ experts + attention (`v1`) | 302.5 / 279.1 / 194.2; PPL 1.4205 | Go |
| A4 | INT8 embedding at load | −0.21 GiB/GPU, PPL 1.4201 | Go |
| C2 | INT8 QK^T prefill + fp16 PV + KV splits | cold TTFT −15% at 107k, −23% at 249k; PPL 1.4204 (A/A bit-identical) | Go |
| C2 | `ATTN_SKIP_OLD_BIAS` (decode at 107k/249k) | exact outputs; decode +1.7% at 249k, ±0.4% at 107k, TTFT unchanged | No-Go, below the +2–3% floor of an exact change at 249k |
| C1 | W4A8-INT8 prefill (attention) | 1.02x qkvr / 1.07x wo_ud at M=2048 (<0.2% of a chunk), 5x output error; experts need a second weight copy | No-Go, reverted (`e1e3f3572`) |
| A1 | 40k pruned draft vocabulary | +5.3% greedy, +2.1% T=1, +4.1% prose vs the full vocabulary | Go |
| A1 | `MIN_CONFIDENCE` 0.52 / 0.55 / 0.58 vs 0.50 | sign flips between seed sets (±3%) | inconclusive, keep 0.5 |
| A2 | int4 GPTQ draft vs bf16 draft | net −2.4% greedy, −2.5%/+3.7% T=1, −0.2%/+1.1% prose; greedy acceptance −5% | No-Go |
| A3 | Marlin W8 target head | identical PPL, no step gain, prose −1.6%, +0.22 GiB | No-Go |
| A3 | W4 target head (RTN) | +0.7 / −1.7 / +2.2%, T=1 acceptance −5%, PPL 1.4207 | No-Go |
Released unit (`final-a`, auto-loaded vocabulary): 326.5 / 292.0 / 201.5 tok/s
(+8.9% / +8.0% / +6.4% over the production AWQ profile), PPL 1.4204 (43,758 tokens,
gate ≤ 1.4216), weights 7.12 GiB/GPU.
## Gates
All on the release rig (2x RTX 3090 at 270 W, TP2, PCIe P2P) through the Model Loader
proxy unless noted. Evidence: `~/.local/state/model-loader/release-validation/inkling-2-mini-vllm-20261121/optimization/sm86-fast` (`gates-base/`, `final-ab/`, `experiment/`).
| Gate | Result | Threshold |
|---|---|---|
| SM86 test suite (`tests/models/inkling2/`) | 130 pass, incl. 5 draft-vocabulary tests; the failures are Hopper/Blackwell, FP8 and 4-GPU cases | SM86 clean |
| Scales | 9384 scale tensors, none ≤ 0 (min 1.04e-3) | none ≤ 0 |
| Eager vs CUDA graph (direct server, greedy, 16 prompts × 300 tokens) | 5/16 identical, the rest diverge after 224–1134 chars; the production AWQ checkpoint on the same runtime: 6/16, 296–1155 chars | same class as the reference |
| Perplexity (`inkppl.py`, 43,758 tokens) | 1.4204 | ≤ 1.4216 |
| Reasoning leak (12 greedy prompts) | 0/12 | 0/12 |
| Tool calls | probe integrity PASS (stream + continuation); auto 30/30 calls + 30/30 controls (4096 tokens); `inktool.py --reps 6` 12/12 | all |
| Long context (`inkcanary.py`) | 9/9 at 12,286 / 130,151 / 234,776 tokens × seeds 1–3; 0 preemptions; peak 22.15 / 19.98 GiB | 9/9, ≤ 23 GiB/GPU |
| Long PT-BR generation | 4,429 tokens, `stop`, 0.23% repeated 8-grams, reasoning kept out of the content; read: coherent | qualitative |
Final A/B against the production AWQ profile (`inkling-2-mini-26b-a3b-awq-vllm-dspark-256k`,
same runtime), ABBA through the proxy on the frozen Exp 0.1 inputs, reloaded per arm.
A/A and B/B spreads stay under 0.7% except a few single requests at depth (≤ 2.6%).
| Workload | AWQ | SM86-Fast | Change |
|---|---|---|---|
| Code greedy, decode tok/s | 299.3 | 323.9 | +8.2% |
| Code T=1.0, decode tok/s | 270.3 | 289.0 | +6.9% |
| Prose EN/PT-BR T=1.0, decode tok/s | 189.0 | 201.1 | +6.4% |
| Code at 107k / 249k depth, decode tok/s | 306.6 / 212.2 | 308.5 / 220.0 | +0.6% / +3.7% |
| Cold TTFT 106,599 / 249,268 tokens | 26.5 s / 93.9 s | 22.5 s / 72.0 s | −15% / −23% |
| Continuation TTFT 107k / 249k | 0.51 s / 0.98 s | 0.36 s / 0.63 s | −29% / −35% |
| All decode, time-weighted | 252.3 | 267.0 | +5.9% |
| Wall time of the matrix | 257 s | 222 s | −13.8% |
| Peak VRAM GPU0 / GPU1 | 20.23 / 18.06 GiB | 20.22 / 18.06 GiB | same |
The decode step (ms per draft round) is 0.6–9.8% shorter on every workload. Single
requests at depth vary with the draft acceptance of their own text: the 249k
continuation decoded 12% slower (3.20 vs 3.77 tokens per round on a 3.7% shorter step).
## Hashes
sha256 of the released files (`sha256sum -c` from the unit directory):
```
24a6ed2e3414c1d39d9baebf0ae81bdf22bb159780d2255753c730849864eecb model-00001-of-00025.safetensors
31b9c6c0de87ca28bbe3d7ae8e4654da4ca683eefb80a211d2a2f70e48cf9a53 model-00002-of-00025.safetensors
a20c2499b3a5feddfe851cf825f4bba627e6f6c5b23d2a68bac3a4562695647d model-00003-of-00025.safetensors
850d5d9c0bc852d13b44232ff32c4ab890f3dfc0640398fafb73cedceab783ef model-00004-of-00025.safetensors
04f93541dbce75ee813fcb91be47bb12da6bb887c939447466391836edc004bc model-00005-of-00025.safetensors
b3aea2834614258567b87264d98f187197d6021fbd297eef6cb49569f0f730f7 model-00006-of-00025.safetensors
5802216ef5dfbed1c54fcc75b49d92cd2a53f0e84a6a42f192aedc56ea3ee2c0 model-00007-of-00025.safetensors
5c0eff8dc925170f1e7daa858064876fd472a5471d0c386d7c1b4a824ed00118 model-00008-of-00025.safetensors
7c4735c30fb9b3bd9a37a73cf7128f9801e6d570649957b8ffd350796bb89914 model-00009-of-00025.safetensors
e6bdd6f2d7538f47f4dfc044ede6448f284d2b23336c26fe884af3a300c35e28 model-00010-of-00025.safetensors
8ae06c65c1805b1bf6cecfc63f0c6d705f8f7b923bc61990632c1a5b0478c165 model-00011-of-00025.safetensors
5c74a774b0744290c63ca3e33bc7d1154da88baf148c2ecd600a7aecb2c1f8f9 model-00012-of-00025.safetensors
2467c48541d009b049309c62703632033304a830dbea834381b85e6ac712c871 model-00013-of-00025.safetensors
1461fb19df39d27ed76bd2e50f4d3302561e82444303f4f05d3b1008a094da70 model-00014-of-00025.safetensors
b092899d2529c4e87caa27021c5bb17a837d099ca8916122ddacd22173ae7d3a model-00015-of-00025.safetensors
4abfae0e872c99957555f6d4c331e914c01a4a8e8d81bcdf73bb60f2ad59d01e model-00016-of-00025.safetensors
bed45a27ebf182bf8731b892ff8d8c6eb414533a7c1c77de34222977b55b52ff model-00017-of-00025.safetensors
6038d5b216d6f0947faf1b003e008edca0e8b313476426c436ac1104d6c77fb7 model-00018-of-00025.safetensors
b16f858e5041d725f0c64c2797fbe29d6a8b778dedf0849679a65eb895c73ef4 model-00019-of-00025.safetensors
0b73f668fd8f99f0048837378833a67d1f150c8fc9c8bcde572864b08c0281eb model-00020-of-00025.safetensors
8ca3d997fc61407c22e3473a66c7d97d1420248eb7d14eb404c20d8b42ab88ae model-00021-of-00025.safetensors
285b88289af8f39edbccbd4f74f01ebab6e09a9044d6129f8123ec6e76a3e87b model-00022-of-00025.safetensors
6933c5c71fa2e013263a1c2c0018caa2c945ca669451907ba589961e1e40c52d model-00023-of-00025.safetensors
f1c844f1a6fde8051eec4dfbaaa12ba9c40db5292e6cbe42efd2e994c205cfa2 model-00024-of-00025.safetensors
ed6e08d3b79fd794c322e3121f402c401c8425a987f2e4515086b74ff42f9b31 model-00025-of-00025.safetensors
7c3b651317f01f73bcf4e1dceba66ef8b7e1a1eac6bc171e882e690a4b10a1d2 mtp.safetensors
422613cf98028fdecaad8ca4894ea83eaece1e9960ee4a44d168be0b5ee49b13 draft_vocab_ids.pt
1af022e0fb7258892ae4019c18e9e1ecdefc0f5f5912065475e577885c5277fe config.json
89813f3604b04502f9e0722ea2c999f2424d2dd09e8bafc1d101cb99fef33665 model.safetensors.index.json
7f332727f9a3f093dd452a39cc978e6757627e5dad1b0673aa4e75174f236dd6 tokenizer.json
53a9035f3255945704b5857657cfb00c1165090c0641c4f782a0cbf268cc16dc chat_template.jinja
```