速度测试
Inkling-2-Mini
RTX 5090 32GB ×2 · sglang · v0.0.0.dev1+inkling2 · NVFP4
finnff已验证2026年11月21日
解码
392tok/s
预填充
12.3ktok/s
首个 token 延迟
255ms
总计
950tok/s
峰值 VRAM
—
上下文长度
256K
KV 深度
0
批大小
1
并发数
1
功耗
—
验证
未验证 — 实验性结果
已验证的运行使用标准测试提示词,并记录足够的数据以核对结果。
- The run did not use one of the standard test prompts.
启动命令
SGLANG_OPT_INKLING2_VERIFY_REL_BIAS_KERNEL=1 SGLANG_OPT_DSV41_DSPARK_MID_FOLD=1 SGLANG_OPT_DSV41_DSPARK_PREPARE_INPUTS_ONCE=1 SGLANG_OPT_DSV41_DSPARK_SKIP_PREFILLED_INPUTS=1 sglang serve --model-path thinkingmachines/Inkling-2-Mini --served-model-name inkling-2-mini --tp 2 --ep 2 --attention-backend fa4 --dtype bfloat16 --page-size 128 --context-length 262144 --max-running-requests 6 --mem-fraction-static 0.86 --grammar-backend xgrammar --reasoning-parser inkling --tool-call-parser inkling2 --swa-full-tokens-ratio 0.05 --mamba-full-memory-ratio 0.04 --schedule-policy lpm --enable-hierarchical-cache --hicache-ratio 2 --hicache-write-policy write_through --speculative-algorithm DSPARK --speculative-num-draft-tokens 8 --disable-prefill-cuda-graph --enable-multimodal --enable-metrics --enable-cache-report --sleep-on-idle
Theoretical memory ceiling
This mixture-of-experts model doesn't list how many parameters are used per token, so a ceiling can't be estimated.
模型
- GPU
- RTX 5090
- 数量
- 2
- VRAM
- 32 GB
- OS
- Ubuntu 24.04.3 LTS
引擎
- 引擎
- sglang
- 版本
- 0.0.0.dev1+inkling2
- Build
- lmsysorg/sglang:inkling-2-mini
- Commit
- 03fde9cc392a5f84a54a365635ffed0061cdf1b8
- 量化
- NVFP4
- TP
- 2
- GPU mem util
- 0.86
- 前缀缓存
- 是
- 最大运行序列数
- 6
- Attn
- fa4
- Spec decode
- 已启用
运行配置
- 上下文
- 262,144 个 token
- 深度
- 0 个 token
- 批量大小
- 1
- 提示词 token
- 3144
- 预填 tok/s
- 12.3K tok/s
- 输出 token
- 2048
- 提交工具
- lmx dev speed-test submit
- 备注
- 2x RTX 5090, TP2/EP2 over PCIe P2P, lmsysorg/sglang:inkling-2-mini image plus two small local patches (sm120 attn_res memory fix, verify-kernel limit 48). Greedy, cold prefill (nonce per request); best of 3 runs, each the median of 7 x 2,048 tokens. Draft/accepted counts are from the last timed request (405.9 t/s).
推测解码
- 方法
- dspark
- 每步接受数
- 3.46 个 token
- 接受率
- 35%
- 草稿 token
- 4,144
- 已接受 token
- 1,456
已记录的证据
- 提示词哈希(SHA-256)
- 7ae06c0001c6…
提示词样本 · 2,000 chars
[LocalMaxxing cache-bust nonce: 12dbee8c5e59faf680b969e80dccdc2a]
I have a FastAPI service that receives webhook events from a payment provider and stores them in Postgres with asyncpg. The current handler:
```python
@app.post("/webhooks/payments")
async def payments_webhook(request: Request) -> dict[str, str]:
payload = await request.json()
if payload["type"] == "invoice.paid":
await pool.execute(
"INSERT INTO invoices (id, amount) VALUES ($1, $2)",
payload["data"]["id"], payload["data"]["amount"],
)
return {"status": "ok"}
```
Problems: the `X-Signature` header is never verified, retried deliveries insert the same invoice twice, and any exception returns a 500 so the provider retries forever.
Rewrite this, returning a single python file: verify the signature with HMAC-SHA256 over the raw body and reject stale timestamps, make inserts idempotent on the event id, dispatch event types through a registry instead of if-chains, and return 2xx for event types we don't handle. Use pydantic models, full type hints, and no bare except. Include the SQL for the idempotency table and a pytest test for the signature check.
I have a FastAPI service that receives webhook events from a payment provider and stores them in Postgres with asyncpg. The current handler:
```python
@app.post("/webhooks/payments")
async def payments_webhook(request: Request) -> dict[str, str]:
payload = await request.json()
if payload["type"] == "invoice.paid":
await pool.execute(
"INSERT INTO invoices (id, amount) VALUES ($1, $2)",
payload["data"]["id"], payload["data"]["amount"],
)
return {"status": "ok"}
```
Problems: the `X-Signature` header is never verified, retried deliveries insert the same invoice twice, and any exception returns a 500 so the provider retries forever.
Rewrite this, returning a single python file: verify the signature with HMAC-SHA256 over the raw body and reject stale tim输出样本 · 4,000 chars
The user pasted a repeated prompt many times. The actual task is legitimate: rewrite a FastAPI webhook handler. This is a benign coding task. The repeated text is just duplication. I should answer once, not be confused.
Need to produce a single python file with:
- HMAC-SHA256 signature verification over raw body
- reject stale timestamps
- idempotent inserts on event id
- registry dispatch
- 2xx for unhandled event types
- pydantic models, full type hints, no bare except
- SQL for idempotency table
- pytest test for signature check
Design:
Signature header format: e.g. `t=<timestamp>,v1=<hex hmac>` (Stripe-style). Verify:
- parse header
- timestamp within tolerance (e.g. 300s)
- compute HMAC over f"{timestamp}.{body}" and compare with hmac.compare_digest
Idempotency: table `processed_events(event_id text primary key, processed_at timestamptz default now())`. In handler, within transaction: INSERT INTO processed_events ... ON CONFLICT DO NOTHING; if no row inserted, return 200 already processed. Then dispatch handler.
Registry: dict[str, Callable[[WebhookEvent, Pool], Awaitable[None]]].
Error handling: signature failure -> 401; stale timestamp -> 401/400; validation error -> 400; unknown event type -> 200 {"status": "ignored"}; handler exceptions -> let them propagate? The problem says "any exception returns a 500 so the provider retries forever". Hmm — actually for transient DB errors, 500 is correct so provider retries. But the complaint is that any exception returns 500. The fix: catch expected errors (validation, signature) and return 4xx; for unexpected errors, we could return 500 so provider retries — that's actually correct behavior. But the user says "any exception returns a 500 so the provider retries forever" — meaning e.g. a malformed payload causes 500 and infinite retries. So we should return 4xx for permanent errors (bad signature, stale timestamp, invalid payload, unknown type) and only 500 for transient errors. Also maybe catch handler errors and return 500 deliberately.
Let me write the code.
```python
"""FastAPI webhook receiver for payment provider events."""
from __future__ import annotations
import hashlib
import hmac
import json
import logging
import time
from typing import Any, Awaitable, Callable
import asyncpg
from fastapi import FastAPI, Request, Response
from fastapi.responses import JSONResponse
from pydantic import BaseModel, Field, ValidationError
logger = logging.getLogger(__name__)
# ---------- config ----------
WEBHOOK_SECRET = "whsec_..." # from env
TIMESTAMP_TOLERANCE_SECONDS = 300
# ---------- models ----------
class InvoicePaidData(BaseModel):
id: str
amount: int
class WebhookEvent(BaseModel):
id: str
type: str
data: dict[str, Any] # or discriminated union
```
Better: discriminated union on type. Use `data: InvoicePaidData` for invoice.paid. Could do a registry of handlers each with its own model. Simpler: WebhookEvent with id, type, data: dict[str, Any]; handlers parse data
…
it? In asyncpg, returning from inside `async with conn.transaction()` — the context manager's __exit__ runs on return, committing. Actually yes, `return` inside the with block triggers __exit__ which commits. But if we return "duplicate" after inserting nothing... wait, in duplicate case we did INSERT ... ON CONFLICT DO NOTHING which inserted nothing, so commit is fine.
But careful: if handler raises, transaction rolls back, then we return 500. We should catch the exception and return 500 JSONResponse rather than let it propagate (FastAPI would return 500 anyway but with default handler). Catching and returning 500 with detail is fine. But "no bare except" — catching `Exception` is not bare; but is it acceptable? The user said no bare except. Catching Exception and returning 500 is deliberate. Alternatively let it propagate. I'll catch `Exception` and return 500 with a generic detail, logging the exception. That's not bare.
Actually, should we return 500 for handler failure? Yes —该模型在此硬件上的更多运行
- 526tok/scustom · v0.5.6 · NVFP4上下文 256K · 深度 0 · 批大小 1已验证运行匿名 · 2026年11月24日
- 489tok/scustom · v0.5.5 · NVFP4上下文 2K · 深度 0 · 批大小 1已验证运行Thomukas1 · 2026年11月23日
- 481tok/scustom · v0.5.6 · NVFP4上下文 256K · 深度 0 · 批大小 1已验证运行匿名 · 2026年11月24日
- 441tok/ssglang · v0.0.0.dev1+inkling2 · NVFP4上下文 256K · 深度 0 · 批大小 1已验证运行finnff · 2026年11月21日
- 414tok/ssglang · v0.0.0.dev1+inkling2 · NVFP4上下文 256K · 深度 0 · 批大小 1已验证运行finnff · 2026年11月21日
