AIsaAIsaStudio English 打开 AIsa Studio

Hugging Face 用智能体爬山调优 Inkling 2 Mini 在单张 RTX PRO 6000 上的推理速度

原标题:Hill-climbing Inkling 2 Mini inference on one RTX PRO 6000

Hugging Face 用编码智能体配合推理优化技能和 HF Jobs,在单张 NVIDIA RTX PRO 6000 96 GB 上对 Inkling 2 Mini 推理做爬山式调优,46 次有效运行把单用户解码从 136 提升到 190.6 tok/s(+40%),8 用户聚合吞吐从约 570 提升到 716 tok/s(+26%),主要来自切换 vLLM nightly、启用 DSpark 7 drafts 概率采样推理解码和两个显存参数。该 looped MoE 模型每 token 经过 48 层,解码需重读约 5.6 GB 权重,推测解码下带宽天花板约 201 tok/s,当前配置已达约 95% 硬件极限;全部日志、脚本和原始数据开源在 NielsRogge/inkling-2-mini-hillclimb。

为什么值得看

给出了从 136 到 190.6 tok/s 的完整调优路径、控制变量协议和失效清单,方法可迁移到其他模型的单卡推理优化。

阅读原文 ↗11月26日 AI 日报

本页的摘要、推荐理由与解读出自 AIsa Studio 的 AI 风向智能体,原文版权归原作者所有。

深度解读

发生了什么

Inkling 2 Mini 是一款总参数约 26B、每 token 激活 3B 的循环 MoE 模型,支持多模态输入和 1M token 上下文窗口。Hugging Face 没有手工调参,而是给一个编码智能体配备推理优化技能、hf CLI 和 Hugging Face Jobs 的访问权限,让它在一张 NVIDIA RTX PRO 6000 96 GB 上跑了一个下午的实验。

在 46 次有效基准运行中,单用户解码速度从 136 提升到 190.6 tok/s(+40%),8 用户聚合吞吐从约 570 提升到 716 tok/s(+26%)。获胜配置——vLLM nightly 加 DSpark 投机解码——已部署为 Inference Endpoint,全部日志、脚本和原始测量数据发布在 NielsRogge/inkling-2-mini-hillclimb 仓库中。

关键细节

  • 需要单独调优的原因:官方发布的推理配方针对的是 sm100 GPU(B200/GB300),未覆盖 sm120 卡(如 RTX PRO 6000),后者的内核兼容性可能不同。
  • 提升可清晰拆解:从 SGLang 换到 vLLM nightly 带来 +15%(136 → 157 tok/s);启用 DSpark 7 drafts 和概率化草稿采样再带来 +21%(157 → 190.6 tok/s,四次运行为 189.3、190.4、191.1、190.7);另加两个内存参数使配置能在 96 GB 上启动。
  • 实验方法纪律严格:先测硬件上限,一次只改一个变量,每个候选配置夹在两次对照运行之间,只有同时击败两个对照才保留,所有运行(包括回归和死胡同)都记录在 PLAN.md 中。
  • 部署前所有验证门通过:最长约 250K token 的大海捞针 3/3 通过、开/关投机解码的贪婪输出逐字节一致、4 请求并发压力测试 4/4 成功。
  • 为什么停在约 190 tok/s:循环架构使每个 token 经过 48 层。投机解码下同时验证 8 个位置会激活其专家的并集(每层约 40% 的专家而非 6%),带宽上限降到约 201 tok/s。190.6 tok/s 已达硬件带宽的约 95%。

为什么重要

第一,在约 2.3 tokens/step 的接受率下,继续调参数几乎没有提升空间——要突破 190 tok/s 需要接受率更高的草 draft 器或每层触达更少专家的验证路径。知道上限在哪里和知道速度本身同样有价值。

第二,这次实验展示了一套可复用的优化流程:固定协议、引擎无关的基准脚本、用 HF Jobs 提供算力($2.75/h,与部署端点同一款 GPU,数据可直接迁移)、用廉价的 CPU Job 在容器里 grep 引擎源码找未文档化的参数——智能体正是由此找到 SGLang 的 SGLANG_OPT_* 环境变量和 vLLM 的 speculative-config 字段。仓库提供了 configs/plan-*.json 机制,可把流程复用到其他模型。

第三,负面结果同样有参考价值:vLLM 上贪婪草稿采样在 temperature 1.0 下损失 11%;SGLang 的多个 SGLANG_OPT_* 参数效果在运行间噪声之内(SGLang 波动 ±4.5%,vLLM 仅 0.4%);团队有意跳过 rejection_sample_method 的 "fly" 和 "synthetic" 选项,因为它们会改变输出分布——他们要的是严格无损的提速。

对谁有影响

本地模型爱好者和在 sm120 消费级/准专业硬件(RTX 6000)上部署开源模型的团队,可以直接复用这套经过验证的 vLLM + DSpark 配置,绕开仅支持 sm100 的官方配方。运维 Inference Endpoint 的团队可以借鉴这套工作流——固定镜像 digest 和模型版本、在 Job 中跑验收门、一条 hf endpoints deploy 完成部署——以及一组值得警惕的基准测试陷阱:Triton JIT 编译混入计时请求、僵尸服务器占用显存、vLLM 日志中 200 行之上的 OOM 真因、以及可能把噪声误判为收益的引擎波动。

全文翻译

以下翻译只覆盖原文的前一部分,其余内容请看下方原文。

Inkling 2 Mini 于上周发布,为本地 AI 和较小的开源模型设立了新的最先进水平(SOTA)。该模型拥有约 260 亿总参数(每个 token 激活 30 亿),支持多模态输入,并具备 100 万 token 的上下文窗口。在 Artificial Analysis Intelligence Index v5 中,它在同量级模型中名列前茅,并在与 Gemma 4 31B 和 Qwen3.8-27B 等模型的 48 项基准测试中的 32 项上胜出,使其成为在适度硬件上进行编码、工具使用和推理的强大开源选择。我们在此撰写了一篇详细的博文,介绍如何在 Hugging Face 生态系统中使用它 这里。

Inkling 2 Mini 的一个有趣方面可能是其卓越性能的原因在于其不寻常的架构。Inkling 2 Mini 是一个循环的 混合专家 (MoE) 模型,具有 24 个物理层,其中中间的 12 层运行三次,因此每个 token 经过 48 层。检查点以混合 NVFP4 和 MXFP8 格式提供,并捆绑了一个用于推测解码的 DSpark drafter。vLLM 和 SGLang 这两个 LLM 推理的首选框架在其夜间构建版本中均支持它,尽管发布的部署配方针对 NVIDIA B200 和 GB300 GPU (sm100),排除了像 NVIDIA RTX PRO 6000 这样的 sm120 显卡,因为后者的内核兼容性可能不同。

我们想看看在单张 NVIDIA RTX PRO 6000 96 GB 上服务它的速度有多快,这是 nvidia-rtx-pro-6000 推理端点 背后的 GPU。我们没有手动调整标志,而是给一个编码代理提供了 inference-optimisation 技能、hf CLI 以及对 Hugging Face Jobs 的访问权限,让它跑了一下午的实验。

在 46 次有效的基准运行中,单用户解码速度从 136 到 190.6 tok/s (+40%)(领先于同一 GPU 上 LocalMaxxing 上的社区 SGLang + DSpark 基准测试的 167.7 tok/s),而使用带有 DSpark 推测解码的 vLLM 夜间版时,8 用户聚合吞吐量从 ~570 到 716 tok/s (+26%)。无论是否启用推测,贪婪输出的字节完全相同,长上下文针检索在高达 250K token 的情况下通过了 3/3 测试,获胜的配置现在已作为推理端点运行,使用的是固定的镜像摘要。所有日志、脚本和原始测量数据都在 NielsRogge/inkling-2-mini-hillclimb 中。

设置

inference-optimisation 技能赋予代理一个固定的实验协议和一个小型、引擎无关的基准测试脚本 (bench.py):

  1. 在调整之前测量硬件并估算理论上限。
  2. 一次只更改一个变量,并在两次控制运行之间 bracket 每个候选者(control → candidate → control)。只有当它优于两个控制值且不导致其他指标退化时,才保留该更改。
  3. 在 PLAN.md 中记录每次运行,包括退化和死胡同。
  4. 在宣布获胜者之前,通过长上下文、并发性和贪婪等价性检查。

bench.py 使用来自服务器使用响应中的直接 token 计数来测量单用户解码、N 并发下的聚合解码、几种长度下的冷预填充以及 TTFT。所有运行都使用固定的六个提示面板(代码、解释、故事、比较表、bash 脚本和历史摘要),温度为 1.0(模型的默认值),开启思考模式,输出 512 个 token,并在启用推测解码时重复 12 次。

该技能是为本地 GPU 编写的,因此我们将其适应于 Hugging Face 基础设施:

  • HF Jobs 用于计算。rtx-pro-6000 Job 变体使用与 nvidia-rtx-pro-6000 推理端点相同的 GPU(两者均为 $2.75/小时),因此 Job 数字可以直接转移。一个约 150 行的驱动程序 (jobs/driver.py) 接受服务器配置列表,启动每个配置,运行未测量的预热,未修改地调用 bench.py,关闭服务器,并为每次运行打印一行账目。由于 Jobs 在单独的机器上运行,代理并行扫描了 SGLang (lmsysorg/sglang:inkling-2-mini) 和 vLLM 夜间版 (vllm/vllm-openai:nightly)。
  • CPU Jobs 用于读取引擎源代码。当某个标志未记录文档时,代理运行了一个廉价的 cpu-upgrade Job 来 grep 容器内安装的 Python 包。这就是它发现 SGLang 的 SGLANG_OPT_* 环境变量和 vLLM 的 speculative-config 字段的方式。
  • 推理端点 用于部署,通过 hf endpoints deploy 创建,使用确切的镜像摘要和通过验证的标志。

基线是我们现有的组织端点配置:SGLang 带有 --attention-backend fa4 且无推测解码。

结果

Inkling 2 Mini 在单个 RTX PRO 6000 上的单用户解码速度,四种配置

单用户解码速度(12 次请求的中位数)。vLLM + DSpark 在其测量的接受率下达到内存带宽上限的 ~95%。

配置 (1× RTX PRO 6000) 1 用户解码 (tok/s) 8 用户聚合 (tok/s) 预填充 4K / 32K (tok/s) TTFT
SGLang, 无推测 (基线) 134–139 543–598 18.7–19.1K / 16.9–19.1K 41–114 ms
vLLM, 无推测 157.0 638 20.7K / 20.7K 33 ms
SGLang + DSpark (8 草稿) 166.6 — ¹ 18.0–19.5K / 18.9–19.1K 38–51 ms
vLLM + DSpark (7 草稿) 190.6 716 20.7K / 20.6K 40 ms
已部署端点 (通过互联网) 194.9 673 11.7K / 19.2K ² 198 ms ²

¹ SGLang 的 RTX PRO 6000 DSpark 配方将 --max-running-requests 限制为 4。将其提高到 8 达到了 660 tok/s,仍落后于 vLLM。 ² 包括约 160 ms 的客户端到端点网络往返时间。

所有的加速都来自于切换到 vLLM 夜间版(比无推测的 SGLang 快 +15%,136 → 157 tok/s),启用带有 7 个草稿和概率草稿采样的 DSpark(在此基础上再快 +21%,四次运行中从 157 到 190.6 tok/s:189.3, 190.4, 191.1 和 190.7),并添加两个内存标志,以便 vLLM 的 DSpark 设置实际上能在 96 GB 上启动:

vllm serve thinkingmachines/Inkling-2-Mini \
  --tool-call-parser inkling \
  --enable-auto-tool-choice \
  --reasoning-parser inkling \
  --max-model-len 262144 \
  --gpu-memory-utilization 0.85 \
  --speculative-config '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"probabilistic"}'

num_speculative_tokens: 7 和 draft_sample_method: "probabilistic" 都经过了直接验证:较短的草稿数量(如 5)会在启动时被拒绝,因为两个引擎都强制执行检查点的固定块大小,而在温度 1.0 下切换到 greedy 草稿采样使 vLLM 解码速度下降了 11%(见 什么没起作用)。

为什么它停在 190 tok/s 左右

在调整之前,代理在 Job 中探测了 RTX PRO 6000(1,469 GB/s 复制带宽,416 TFLOPS BF16,792 TFLOPS FP8)并从 safetensors 头中读取了张量大小。因为每个 token 经过 48 层访问,纯解码重新读取约 2.7 GB 的注意力和密集权重,约 2 GB 的路由专家(每层 128 个中的 8 个),以及约 0.9 GB 的 LM head。在 1,469 GB/s 的速度下,这给出了单用户带宽上限 ~256 tok/s。没有推测时,vLLM 在 157 tok/s 达到了该上限的 61%,主要受限于 48 次访问的内核启动延迟。

推测解码改变了 MoE 上的内存数学。一起验证 8 个位置会激活它们路由专家的并集,读取每层大约 40% 的专家,而不是 6%。在我们测量的温度 1.0 下每步约 2.3 个 token 的接受率(每个位置的接受率从第一个草稿的 0.6 下降到 0.33 和 0.19),带宽上限降至 ~201 tok/s。在 190.6 tok/s 时,vLLM + DSpark 已经达到 ~95% 的硬件带宽,因此进一步的标志调整几乎无处可去。要超过 190 tok/s,需要具有更高温度 1.0 接受率的 drafter 或每层接触更少专家的路径。

什么没起作用

大多数候选标志不受支持、有噪声或更慢:

vLLM

杠杆 结果
较短的草稿长度 (3–6) 启动时被拒绝;需要 num_speculative_tokens = 7(检查点块大小 − 1)。
draft_sample_method: "greedy" 温度 1.0 下 -11%(168.6 vs ~190.4 tok/s)。
rejection_sample_method: "block" 190.1 vs 190.3–190.5 的控制值;无影响。
enable_adaptive_verification 对于 Inkling 2 drafter 启动时的断言错误。
draft_lm_head_quantization: "fp8" 仅支持 DeepSeek DSpark drafters。

我们也故意跳过了 rejection_sample_method: "fly" 和 "synthetic",因为它们会改变输出分布,而我们想要一个严格无损的加速。

SGLang

杠杆 结果
较短的草稿长度 (3–6) 启动时被拒绝;需要 --speculative-num-draft-tokens 8(捆绑 drafter 的 gamma + 1)。
SGLANG_ENABLE_NV_MEGA_RUNTIME_OPTIMIZATION=1 一次 +4%,无法在新鲜控制组中重现。
SGLANG_OPT_USE_FUSED_DRAFT_SAMPLE=1 +2%,在运行间噪音范围内。
SGLANG_OPT_MOE_QUANT_ONCE=1 +1%,在运行间噪音范围内。
SGLANG_DSPARK_USE_GREEDY_DRAFT=1 温度 1.0 下 -9%(156.8 vs ~172 tok/s)。

基准测试陷阱

一些测量问题在路上困扰了我们:

  • 定时预填充期间的 Triton JIT。 vLLM 的第一个 4K 预填充返回 202 tok/s 而不是 20K,因为 Triton 正在编译内核。在提示长度和并发性上运行未测量的预热修复了 4K 预填充,尽管每个 Job 中的第一次运行仍然低估了 32K 预填充,这是由于最后块形状差异造成的(已在账目中标记)。
  • 持有 GPU 内存的孤立服务器。 初始驱动程序通过从 setsid … & 保存的 PID 停止服务器,这不保证与进程组 ID 匹配。前一个服务器仍在端口 8000 上存活,破坏了下一次启动,并变成了一个仍然通过 kill -0 的僵尸。使用 subprocess.Popen(start_new_session=True) 管理进程并等待直到 GPU 内存和端口 8000 都空闲修复了这个问题。
  • vLLM 日志中的隐藏 OOM 错误。 vLLM + DSpark 两次在日志末尾因 "Engine core initialization failed" 死亡,而真正的原因位于 200 行之上。首先,默认的 1M token KV 缓存需要 52.6 GiB,而旁边只有 48.1 GiB 可用(加上 drafter)(--max-model-len 262144 修复了此问题)。其次,因为 vLLM v0.34.0 将默认的 --gpu-memory-utilization 从 0.92 提高到 1.0,KV 缓存占用了剩余的 VRAM 并使 drafter 的 5 GiB 分配 OOM(--gpu-memory-utilization 0.85 修复了此问题)。驱动程序现在打印服务器日志中的每一行错误,而不仅仅是尾部。
  • 引擎方差。 在带有推测的相同运行中,vLLM 保持在 0.4% 以内,而 SGLang 摆动 ±4.5%。这足够宽,使得 SGLANG_ENABLE_NV_MEGA_RUNTIME_OPTIMIZATION=1 在第一次运行时看起来像是 +4% 的胜利,直到重复控制排除了它。

验证和部署

在部署之前,我们固定了确切的 vLLM 夜间版摘要 (vllm/vllm-openai@sha256:eaa63fd6…, 构建 0.34.0rc1.dev1235+gf2f9edcac) 并在 Job 中运行了验收门控:

门控 结果
~50% 上下文处的针检索 (126,537 tokens) 3/3, TTFT 12.5 s
~95% 上下文处的针检索 (249,970 tokens) 3/3, TTFT 28.7 s
并发浸泡 (4 × ~58K-token 请求) 4/4 成功,3/3 检索各
贪婪等价
查看原文

Inkling 2 Mini came out last week and sets a new state of the art for local AI and smaller open-source models. With ~26B total parameters (3B active per token), multimodal inputs, and a 1M-token context window, it leads its weight class on the Artificial Analysis Intelligence Index v5 and across 32 of 48 benchmarks against models like Gemma 4 31B and Qwen3.8-27B, making it a strong open option for coding, tool use, and reasoning on modest hardware. We wrote an extensive blog post on how you can use it within the Hugging Face ecosystem here.

One of the interesting aspects of Inkling 2 Mini that might explain its great performance is its unusual architecture. Inkling 2 Mini is a looped Mixture-of-Experts (MoE) model with 24 physical layers where the middle 12 layers run three times, so every token passes through 48 layers. The checkpoint ships in mixed NVFP4 and MXFP8 and bundles a DSpark drafter for speculative decoding. Both vLLM and SGLang, the go-to frameworks for LLM inference, support it on nightly builds, though the published serving recipes target NVIDIA B200 and GB300 GPUs (sm100), leaving out sm120 cards like the NVIDIA RTX PRO 6000 where kernel compatibility can differ.

We wanted to see how fast we could serve it on a single NVIDIA RTX PRO 6000 96 GB, the GPU behind an nvidia-rtx-pro-6000 Inference Endpoint. Rather than tuning flags by hand, we gave a coding agent the inference-optimisation skill, the hf CLI, and access to Hugging Face Jobs, and let it run experiments for an afternoon.

Across 46 valid benchmark runs, single-user decode went from 136 to 190.6 tok/s (+40%) (ahead of the 167.7 tok/s community SGLang + DSpark benchmark on LocalMaxxing for the same GPU) and 8-user aggregate throughput went from ~570 to 716 tok/s (+26%) using vLLM nightly with DSpark speculative decoding. Greedy outputs are byte-identical with and without speculation, long-context needle retrieval passes 3/3 up to 250K tokens, and the winning config is now running as an Inference Endpoint from a pinned image digest. All logs, scripts, and raw measurements are in NielsRogge/inkling-2-mini-hillclimb.

The setup

The inference-optimisation skill gives an agent a fixed experimental protocol and a small, engine-agnostic benchmark script (bench.py):

  1. Measure the hardware and estimate theoretical ceilings before tuning.
  2. Change one variable at a time and bracket every candidate between two control runs (control → candidate → control). Keep a change only if it beats both controls without regressing other metrics.
  3. Log every run in PLAN.md, including regressions and dead ends.
  4. Pass long-context, concurrency, and greedy-equivalence checks before declaring a winner.

bench.py measures single-user decode, aggregate decode at concurrency N, cold prefill at several lengths, and TTFT, using token counts directly from the server's usage response. All runs used a fixed panel of six prompts (code, an explanation, a story, a comparison table, a bash script, and a history summary) at temperature 1.0 (the model's default), thinking on, 512 output tokens, and 12 repetitions whenever speculative decoding was enabled.

The skill was written for a local GPU, so we adapted it to Hugging Face infrastructure:

  • HF Jobs for compute. The rtx-pro-6000 Job flavor uses the same GPU as the nvidia-rtx-pro-6000 Inference Endpoint ($2.75/h for both), so Job numbers transfer directly. A ~150-line driver (jobs/driver.py) takes a list of server configs, starts each one, runs an unmeasured warmup, calls bench.py unmodified, shuts the server down, and prints one ledger line per run. Because Jobs run on separate machines, the agent swept SGLang (lmsysorg/sglang:inkling-2-mini) and vLLM nightly (vllm/vllm-openai:nightly) in parallel.
  • CPU Jobs for reading engine source. When a flag was undocumented, the agent ran a cheap cpu-upgrade Job to grep the installed Python package inside the container. That is how it found SGLang's SGLANG_OPT_* environment variables and vLLM's speculative-config fields.
  • Inference Endpoints for deployment, created via hf endpoints deploy using the exact image digest and flags that passed verification.

The baseline was our existing org endpoint config: SGLang with --attention-backend fa4 and no speculative decoding.

Results

Single-user decode speed of Inkling 2 Mini on one RTX PRO 6000 for four configurations

Single-user decode speed (median of 12 requests). vLLM + DSpark reaches ~95% of the memory-bandwidth ceiling at its measured acceptance rate.

Config (1× RTX PRO 6000)

1-user decode (tok/s)

8-user aggregate (tok/s)

Prefill 4K / 32K (tok/s)

TTFT

SGLang, no speculation (baseline)

134–139

543–598

18.7–19.1K / 16.9–19.1K

41–114 ms

vLLM, no speculation

157.0

638

20.7K / 20.7K

33 ms

SGLang + DSpark (8 drafts)

166.6

— ¹

18.0–19.5K / 18.9–19.1K

38–51 ms

vLLM + DSpark (7 drafts)

190.6

716

20.7K / 20.6K

40 ms

Deployed endpoint (over the internet)

194.9

673

11.7K / 19.2K ²

198 ms ²

¹ SGLang's RTX PRO 6000 DSpark recipe caps --max-running-requests at 4. Raising it to 8 reached 660 tok/s, still behind vLLM. ² Includes ~160 ms of client-to-endpoint network round trip.

All of the speedup comes from switching to vLLM nightly (+15% over SGLang without speculation, 136 → 157 tok/s), enabling DSpark with 7 drafts and probabilistic draft sampling (+21% on top, 157 → 190.6 tok/s across four runs: 189.3, 190.4, 191.1, and 190.7), and adding two memory flags so vLLM's DSpark setup actually starts on 96 GB:

vllm serve thinkingmachines/Inkling-2-Mini \
  --tool-call-parser inkling \
  --enable-auto-tool-choice \
  --reasoning-parser inkling \
  --max-model-len 262144 \
  --gpu-memory-utilization 0.85 \
  --speculative-config '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"probabilistic"}'

Both num_speculative_tokens: 7 and draft_sample_method: "probabilistic" were validated directly: shorter draft counts (such as 5) are rejected at startup because both engines enforce the checkpoint's fixed block size, and switching to greedy draft sampling dropped vLLM decode speed by 11% at temperature 1.0 (see What didn't work).

Why it stops around 190 tok/s

Before tuning, the agent probed the RTX PRO 6000 inside a Job (1,469 GB/s copy bandwidth, 416 TFLOPS BF16, 792 TFLOPS FP8) and read tensor sizes from the safetensors header. Because every token makes 48 layer visits, plain decode re-reads ~2.7 GB of attention and dense weights, ~2 GB of routed experts (8 of 128 per layer), and ~0.9 GB for the LM head. At 1,469 GB/s, that gives a single-user bandwidth ceiling of ~256 tok/s. Without speculation, vLLM at 157 tok/s hits 61% of that ceiling, mostly limited by kernel launch latency across 48 visits.

Speculative decoding changes the memory math on an MoE. Verifying 8 positions together activates the union of their routed experts, reading roughly 40% of each layer's experts instead of 6%. At our measured acceptance of ~2.3 tokens per step at temperature 1.0 (per-position acceptance drops from 0.6 on the first draft to 0.33 and 0.19), the bandwidth ceiling falls to ~201 tok/s. At 190.6 tok/s, vLLM + DSpark is already at ~95% of hardware bandwidth, so further flag tuning has almost nowhere left to go. Moving past 190 tok/s would take a drafter with higher acceptance at temperature 1.0 or a verification path that touches fewer experts per layer.

What didn't work

Most candidate flags were unsupported, noisy, or slower:

vLLM

Lever

Result

Shorter draft length (3–6)

Rejected at startup; requires num_speculative_tokens = 7 (checkpoint block size − 1).

draft_sample_method: "greedy"

−11% at temperature 1.0 (168.6 vs ~190.4 tok/s).

rejection_sample_method: "block"

190.1 vs 190.3–190.5 for controls; no effect.

enable_adaptive_verification

Assertion error at startup for the Inkling 2 drafter.

draft_lm_head_quantization: "fp8"

Only supported for DeepSeek DSpark drafters.

We also skipped rejection_sample_method: "fly" and "synthetic" on purpose because they alter the output distribution, and we wanted a strictly lossless speedup.

SGLang

Lever

Result

Shorter draft length (3–6)

Rejected at startup; requires --speculative-num-draft-tokens 8 (gamma + 1 for the bundled drafter).

SGLANG_ENABLE_NV_MEGA_RUNTIME_OPTIMIZATION=1

+4% once, failed to reproduce against fresh controls.

SGLANG_OPT_USE_FUSED_DRAFT_SAMPLE=1

+2%, within run-to-run noise.

SGLANG_OPT_MOE_QUANT_ONCE=1

+1%, within run-to-run noise.

SGLANG_DSPARK_USE_GREEDY_DRAFT=1

−9% at temperature 1.0 (156.8 vs ~172 tok/s).

Benchmarking gotchas

A few measurement issues caught us along the way:

  • Triton JIT during timed prefill. vLLM's first 4K prefill came back at 202 tok/s instead of 20K because Triton was compiling kernels during the timed request. Running an unmeasured warmup across prompt lengths and concurrency fixed 4K prefill, though the first run in each Job still under-reported 32K prefill due to last-chunk shape differences (flagged in the ledger).
  • Orphaned servers holding GPU memory. The initial driver stopped servers via a PID saved from setsid … &, which is not guaranteed to match the process group ID. The previous server stayed alive on port 8000, broke the next launch, and turned into a zombie that still passed kill -0. Managing the process with subprocess.Popen(start_new_session=True) and waiting until both GPU memory and port 8000 are free fixed it.
  • Hidden OOM errors in vLLM logs. vLLM + DSpark twice died with "Engine core initialization failed" at the end of the log while the real causes sat 200 lines up. First, the default 1M-token KV cache needed 52.6 GiB with only 48.1 GiB free alongside the drafter (--max-model-len 262144 fixed this). Next, because vLLM v0.34.0 raised the default --gpu-memory-utilization from 0.92 to 1.0, the KV cache claimed the remaining VRAM and OOMed the drafter's 5 GiB allocation (--gpu-memory-utilization 0.85 fixed this). The driver now prints every error line from the server log instead of just the tail.
  • Engine variance. Across identical runs with speculation, vLLM stayed within 0.4% while SGLang swung by ±4.5%. That was wide enough to make SGLANG_ENABLE_NV_MEGA_RUNTIME_OPTIMIZATION=1 look like a +4% win on its first run before repeat controls ruled it out.

Verification and deployment

Before deploying, we pinned the exact vLLM nightly digest (vllm/vllm-openai@sha256:eaa63fd6…, build 0.34.0rc1.dev1235+gf2f9edcac) and ran the acceptance gates inside a Job:

Gate

Result

Needle retrieval at ~50% context (126,537 tokens)

3/3, TTFT 12.5 s

Needle retrieval at ~95% context (249,970 tokens)

3/3, TTFT 28.7 s

Concurrent soak (4 × ~58K-token requests)

4/4 succeeded, 3/3 retrieval each

Greedy equivalence, DSpark vs no speculation (6 prompts, temp 0)

6/6 byte-identical

Single-user decode on pinned image

189.9 / 190.2 tok/s

Once those passed, we deployed the endpoint with a single hf endpoints deploy command, pinning both the image digest and model revision (authenticated access, scale-to-zero after 60 idle minutes):

hf endpoints deploy inkling2mini-tuned-dspark --namespace <your-org> \
  --repo thinkingmachines/Inkling-2-Mini --revision 7a67ae2314b44ef05c87fd1d4d311c58aaeb18f6 \
  --framework custom --custom-image "vllm/vllm-openai@sha256:eaa63fd6ee3aac77f3158e80ed79ec425db3a53f7cd666bf1954e96abfaf19a7" \
  --health-route /health --port 8000 \
  --vendor aws --region us-east-2 --accelerator gpu --instance-type nvidia-rtx-pro-6000 --instance-size x1 \
  --min-replica 0 --max-replica 1 --scale-to-zero-timeout 60 --type authenticated \
  --container-command "vllm serve" \
  --container-args "/repository --served-model-name thinkingmachines/Inkling-2-Mini --host 0.0.0.0 --port 8000 --tool-call-parser inkling --enable-auto-tool-choice --reasoning-parser inkling --max-model-len 262144 --gpu-memory-utilization 0.85 --speculative-config '{\"method\":\"dspark\",\"num_speculative_tokens\":7,\"draft_sample_method\":\"probabilistic\"}'"

Running bench.py against the live endpoint gave 194.9 tok/s single-user, matching the Job runs once network latency is accounted for.

Everything from this run (PLAN.md, THEORY.md, jobs/driver.py, submit.sh, deploy.sh, and the raw ledger-*.jsonl files) is in NielsRogge/inkling-2-mini-hillclimb. To reuse the loop on another model, put your candidate and control server commands into a configs/plan-*.json file and submit it to whichever HF Jobs GPU flavor matches your target endpoint.

原文版权归 Hugging Face Blog 及原作者所有,本站转载仅供阅读。如需删除,请联系 support@aisa.one。

事件综述

Thinking Machines 开源 Inkling 2 Mini,社区密集优化本地推理

Thinking Machines Lab(前 OpenAI CEO/CTO 创办的实验室)开源了 Inkling 2 Mini(26.4B MoE looped transformer,每 token 激活 3.4B,支持文本与图像输入,最高 1M token 上下文),随后一周内社区围绕其本地推理与量化展开大量跟进。 11 月 21 日,两名 Reddit 用户分别报告:自研 Rust GGUF 引擎 RustingStrata 在 RTX 3060 12 GB 上用 IQ4_NL 量化跑出 31.2 tok/s(约为 llama.cpp 的 3–3.5 倍,但 prompt 读取慢约 1.5 倍);另一用户用 NInfer-all 在双 RTX 3090 上实现 557K 上下文约 100 tok/s,并展示 RAM prefix caching 使 63K 文档重开对话首 token 仅 0.85 秒。11 月 22 日,有用户将官方 NVFP4/MXFP8 权重移植到单张 R9700 的 vLLM,实现 196K 上下文、约 80–115 tok/s;另有用户 fork llama.cpp 构建 2-3 bit 混合量化 mixB,在单张 12 GB RTX 4070 Ti 上以 64K 上下文跑到 51–64 tok/s decode。同日 X 上有帖子推广该模型为“无审查”并称 CyberBench 打平 Opus 5.5(此为帖子说法)。11 月 24 日,AtomicChat 发布去审查 GGUF 与 rank-1 LoRA,称拒绝率降至 0 但 MMLU 下降 1.5 个百分点、首 token KL 0.94;LlamAmpere 运行时在单张 RTX 3090 的 100k 深度达 125 TPS;Strata 发布面向 12/16/24 GiB 显卡的 SQ-10/15/20 量化包(4 GiB 显卡可借系统内存运行);评测数据显示其在多项编码基准领先(如 <128B SWE-bench Verified 第 1,79.2%)。11 月 25 日,Hugging Face 用智能体爬山调优,在单张 RTX PRO 6000 上把单用户解码从 136 提升到 190.6 tok/s,称已达约 95% 硬件极限;另有用户复测 RustingStrata 在 RTX 3060 上各上下文长度均快于手工调优的 llama.cpp;还有用户将模型压到 10.87 GB 主打 2-bit,称在 16 GB RX 9060 XT 上跑 52–57 tok/s。 目前该模型的本地运行生态(多种引擎、量化与去审查变体)仍在快速扩展。

其他来源的报道 3