File size: 12,279 Bytes
3df335d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3687c66
 
3df335d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2752bf8
3df335d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f0d0175
 
 
 
 
 
 
 
 
 
 
 
3df335d
f0d0175
 
2752bf8
f0d0175
2752bf8
 
f0d0175
2752bf8
f0d0175
 
 
2752bf8
 
f0d0175
3df335d
 
f0d0175
 
 
 
2752bf8
3df335d
f0d0175
2752bf8
3df335d
f0d0175
3df335d
 
f0d0175
 
 
3df335d
 
 
f0d0175
3df335d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f0d0175
3df335d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2752bf8
 
3df335d
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
---
base_model: thinkingmachines/Inkling-2-Mini
pipeline_tag: text-generation
tags:
  - vllm
  - inference-optimization
  - benchmarking
  - moe
  - nvidia
  - h100
  - cuda
  - speculative-decoding
  - dspark
  - docker
---

# Inkling 2 Mini — Optimized Inference on NVIDIA H100

![Faster inference for Inkling 2 Mini by Neural Nova — up to 3.98× throughput on H100](./inkling2-mini-cover.png)

Neural Nova's optimized serving package for [Thinking Machines Lab's Inkling 2 Mini](https://huggingface.co/thinkingmachines/Inkling-2-Mini), combining DSpark speculative decoding with H100-tuned MoE and dense projection kernels.

**Up to 3.98× recorded output throughput versus native kernels with DSpark disabled**, on the 4K-input/4K-output workload at C1. With DSpark already enabled, Neural Nova's kernel optimizations added **4.2–6.0% throughput** across the recorded 1K/1K and 4K/4K tests.

This repository documents the container-based deployment and benchmark workflow. Model weights are provided by the upstream model repository; this page is a serving recipe, not a separate fine-tuned checkpoint.

## Model Overview

- **Provider:** Thinking Machines Lab; inference optimization by Neural Nova.
- **Architecture:** A multimodal, looped Mixture-of-Experts transformer with 26.4B parameters. Its middle layers execute three times with shared weights, giving approximately 5.4B effective active parameters per token.
- **Precision:** Published mixed NVFP4/MXFP8 weights, with BF16 activations in the tested serving configuration.
- **Acceleration:** DSpark proposes multiple tokens for the target model to verify together; optimized kernels accelerate selected expert and projection operations.
- **Benchmark scope:** Text generation on one H100, at one and four concurrent requests.

See the [upstream model card](https://huggingface.co/thinkingmachines/Inkling-2-Mini) for model capabilities, training, intended uses, and limitations.

## Docker

| Item | Value |
| --- | --- |
| Image | `registry.neural-nova.io/public/inkling2-mini:v1.0.0` |
| Digest | `sha256:404e3c10d9e2c7ab90356715f403e1299ef8e51a1ffb44e634eaff76abc14c4e` |
| API port | `8000` |
| Benchmark entrypoint | `python3 /benchmark/benchmark-v1.2.py` (mounted scripts below) |

Run these commands in **Bash on a Linux NVIDIA GPU host**, with Docker and NVIDIA Container Toolkit configured. The reference hardware is a single NVIDIA H100 80GB.

### Serve

```bash
docker run --rm --gpus 'device=0' --ipc=host \
  -p 8000:8000 \
  registry.neural-nova.io/public/inkling2-mini:v1.0.0
```

Once startup completes, check the API in another terminal:

```bash
curl --fail --silent --show-error http://localhost:8000/health
curl --fail --silent --show-error http://localhost:8000/v1/models
```

### Run the benchmark

**Use the corrected external scripts below with the same v1.0.0 image.** They replace the image's built-in benchmark entrypoint, which uses different settings and synthetic DSpark acceptance.

The corrected benchmark compares:

| Arm | Kernels | DSpark |
| --- | --- | --- |
| `native` | Native | OFF |
| `native-dspark` | Native | ON, standard acceptance |
| `optimized-dspark` | Nova optimized | ON, standard acceptance |

All three use the same pinned model revision and serving limits. Each runs **1K/1K and 4K/4K at C1 and C4**, with **32 requests per loop and three timed loops per cell**. Each cell first receives two full workload warmups, with a third allowed if compilation has not settled. The benchmark stops on request failures, unequal token counts, cache hits, preemptions, or observed compilation during timing.

```bash
(
set -euo pipefail
mkdir -p tmp/inkling-benchmark-v1.2 tmp/results

BASE="https://huggingface.co/neural-nova/Inkling-2-Mini-Optimized/resolve/3ee4809740c4aea46e822b6fb15f9aa0dc5a6b2f"
for file in benchmark-v1.2.py serve-benchmark-v1.2.py; do
  curl --fail --location --show-error \
    "$BASE/$file" -o "tmp/inkling-benchmark-v1.2/$file"
done

printf '%s  %s\n' \
  'dc7d072609c0d2abf7c0def238119ad01ba9525441b4061358aaac988ff565f0' 'tmp/inkling-benchmark-v1.2/benchmark-v1.2.py' \
  'd013db1a885c9a00970b5cea7b7435009e7d220de3fdb96c9f50b69d93d6eea5' 'tmp/inkling-benchmark-v1.2/serve-benchmark-v1.2.py' \
  | sha256sum --check -

docker run --rm --gpus 'device=0' --ipc=host \
  --entrypoint python3 \
  -e PYTHONDONTWRITEBYTECODE=1 \
  -e HF_HOME=/root/.cache/huggingface \
  -v inkling2-mini-hf-cache:/root/.cache/huggingface \
  -v "$PWD/tmp/inkling-benchmark-v1.2:/benchmark:ro" \
  -v "$PWD/tmp/results:/results" \
  registry.neural-nova.io/public/inkling2-mini@sha256:404e3c10d9e2c7ab90356715f403e1299ef8e51a1ffb44e634eaff76abc14c4e \
  /benchmark/benchmark-v1.2.py --output /results \
  2>&1 | tee "tmp/results/benchmark-$(date -u +%Y%m%dT%H%M%SZ).log"
)
```

Results are saved under `tmp/results/<UTC timestamp>/`: `summary.csv` and `summary.json` contain pooled throughput, p50 TTFT/TPOT/E2E latency, and measured DSpark acceptance. Raw requests, token IDs, warmups, server logs, metrics, and compilation checks are retained. JSON also includes p95/p99 latencies. Latency values in these files use milliseconds.

Throughput is total output tokens divided by total timed duration; latency percentiles pool the individual requests. Every loop is retained. The three repeats share one server per arm and do not establish independent server-order repeatability. Fixed random-token generation is a performance test, not an accuracy test.

### Pin the image

The benchmark command already pins the image. To pin the serving command too, replace its image tag with:

```text
registry.neural-nova.io/public/inkling2-mini@sha256:404e3c10d9e2c7ab90356715f403e1299ef8e51a1ffb44e634eaff76abc14c4e
```

## Optimization Changes

| Component | Optimization |
| --- | --- |
| Speculative decoding | DSpark with seven speculative tokens in the benchmarked configuration. |
| Quantized MoE | H100-specific tile sizes, scheduling, and pipeline depth for NVFP4 expert gate/up and down projections; FP32 accumulation retained. |
| Attention full/query projections | Specialized BF16 GEMMs using H100 Tensor Memory Accelerator loads and tuned pipelines. |
| Target and DSpark key/value projections | Selected DeepGEMM BF16 paths for supported shapes. |
| Attention output projections | Two-way Split-K to distribute the reduction work. |
| Vocabulary and Markov projections | Tuned unsplit GEMMs, preserving each operation's output precision. |
| Runtime integration | Optimized paths installed before CUDA graph capture, with shape, dtype, layout, and device guards and native fallbacks. |

These changes optimize execution of the existing model weights. They do not introduce another quantization step or change the model's architecture.

## Reference Benchmark Environment

The results below are saved H100 optimization measurements. The deployment image is identified above by its release digest. The corrected command measures that image with a new controlled synthetic prompt set; it is not an exact replay of these historical measurements.

| Item | Recorded configuration |
| --- | --- |
| Hardware | 1 × NVIDIA H100 80GB HBM3, SM90; tensor parallelism 1 |
| Runtime | vLLM `0.34.0rc1.dev1235+gf2f9edcac`; PyTorch `2.14.0+cu130` |
| CUDA / driver | CUDA 13.0 / NVIDIA driver 580.196.07 |
| Model revision | `c9d028302cd0f035fdf8e7e91f089a4ce94d2195` |
| Serving limits | 131,072-token context; 64 sequences; 8,192 batched tokens; GPU memory utilization 0.75 |
| Execution | CUDA graphs enabled; prefix caching disabled |
| DSpark when enabled | 7 speculative tokens; probabilistic draft sampling |
| Workloads | 1,024 input / 1,024 output tokens and 4,096 input / 4,096 output tokens |
| Load | C1 and C4; 32 measured requests per timed loop |
| Sampling | Temperature 0, seed 42; EOS ignored for fixed-length synthetic output |
| Warmup | At least 2 full workload passes, up to 3; final warmup and timed loops had zero observed JIT compilation |

## Results

**C1** = one concurrent request. **C4** = four concurrent requests. **Nova optimized** = Neural Nova's combined MoE and dense-kernel optimizations with DSpark enabled.

Throughput is total output tokens divided by total measured duration. Latencies are **p50 (median)**: TTFT = time to first token; TPOT = time per output token; E2E = complete response time.

### 1K input / 1K output

Each request contains 1,024 input tokens and 1,024 output tokens.

#### C1

| Configuration | Output tokens/s ↑ | TTFT p50 (ms) ↓ | TPOT p50 (ms/token) ↓ | E2E p50 (s) ↓ |
| --- | ---: | ---: | ---: | ---: |
| Native kernels · DSpark OFF | 158.96 | 75.29 | 6.206 | 6.424 |
| Native kernels · DSpark ON | 510.59 | 79.15 | 1.554 | 1.668 |
| **Nova optimized · DSpark ON** | 538.36 | 78.37 | 1.463 | 1.575 |

#### C4

| Configuration | Output tokens/s ↑ | TTFT p50 (ms) ↓ | TPOT p50 (ms/token) ↓ | E2E p50 (s) ↓ |
| --- | ---: | ---: | ---: | ---: |
| Native kernels · DSpark OFF | 475.51 | 188.04 | 8.158 | 8.533 |
| Native kernels · DSpark ON | 1,332.14 | 94.24 | 2.373 | 2.523 |
| **Nova optimized · DSpark ON** | 1,411.62 | 92.71 | 2.262 | 2.406 |

### 4K input / 4K output

Each request contains 4,096 input tokens and 4,096 output tokens.

#### C1

| Configuration | Output tokens/s ↑ | TTFT p50 (ms) ↓ | TPOT p50 (ms/token) ↓ | E2E p50 (s) ↓ |
| --- | ---: | ---: | ---: | ---: |
| Native kernels · DSpark OFF | 157.88 | 154.58 | 6.279 | 25.868 |
| Native kernels · DSpark ON | 594.84 | 153.11 | 1.526 | 6.401 |
| **Nova optimized · DSpark ON** | 628.86 | 153.20 | 1.436 | 6.036 |

#### C4

| Configuration | Output tokens/s ↑ | TTFT p50 (ms) ↓ | TPOT p50 (ms/token) ↓ | E2E p50 (s) ↓ |
| --- | ---: | ---: | ---: | ---: |
| Native kernels · DSpark OFF | 467.94 | 511.03 | 8.357 | 34.699 |
| Native kernels · DSpark ON | 1,494.03 | 173.70 | 2.334 | 9.738 |
| **Nova optimized · DSpark ON** | 1,556.82 | 172.99 | 2.235 | 9.325 |

### Throughput improvement

| Workload | Concurrency | Nova vs native DSpark OFF | Additional gain vs native DSpark ON |
| --- | --- | ---: | ---: |
| 1K/1K | C1 | **3.39×** | **+5.44%** |
| 1K/1K | C4 | **2.97×** | **+5.97%** |
| 4K/4K | C1 | **3.98×** | **+5.72%** |
| 4K/4K | C4 | **3.33×** | **+4.20%** |

### Measurement scope

The 1K native DSpark-OFF/ON cells contain one timed loop each; optimized cells pool three loops on a different physical H100. Each 4K cell pools three loops; its native DSpark-ON and optimized configurations used the same physical GPU, while the DSpark-OFF reference used a different H100. The full-stack ratios compare these recorded runs; same-server repeats do not establish independent server-order repeatability.

Machine-readable values and source-verification hashes are in [benchmark-results.json](./benchmark-results.json).

## Validation

- **1,794 exact numerical checks per configuration** passed in the 4K DSpark-ON comparison: 960 expert checks and 834 dense checks across the tested loaded weights and activation families.
- In the **32-question GSM8K smoke test at C4**, native DSpark-ON and Nova optimized both scored **31/32**, with identical text and output token IDs on all 32 requests. This is a smoke test, not a full GSM8K evaluation.
- All **576 measured requests** across the three 4K configurations completed successfully, with zero observed JIT compilation during timing.

## Files

| File | Purpose |
| --- | --- |
| `README.md` | Deployment instructions, optimization summary, and reference benchmarks. |
| `benchmark-v1.2.py` | Controlled three-arm benchmark, validation gates, and result aggregation. |
| `serve-benchmark-v1.2.py` | Matched server launch settings for the unchanged v1.0.0 image. |
| `benchmark-results.json` | Numeric throughput and latency results, comparison calculations, and source-verification hashes. |

## Upstream Model and License

The base model is [thinkingmachines/Inkling-2-Mini](https://huggingface.co/thinkingmachines/Inkling-2-Mini), released under Apache 2.0. Consult its model card for intended uses and limitations, and its [legal section](https://huggingface.co/thinkingmachines/Inkling-2-Mini#8-legal) for the upstream terms. The upstream model license does not determine the license of Neural Nova's container components.