Тест скорости
Qwen4-35B-A3B
RTX PRO 6000 Blackwell Max-Q Workstation Edition 96GB ×2 · sglang · v0.5.24.dev1+gcd1dc28 · BF16
Декодирование
410tok/s
Prefill
22.1ktok/s
Время до первого токена
128мс
Всего
954tok/s
Пиковая VRAM
—
Длина контекста
40K
Глубина KV
0
Размер батча
1
Параллелизм
1
Энергопотребление
—
Проверка
Не проверено — экспериментальный результат
Проверенные запуски используют стандартный тестовый промпт и сохраняют достаточно данных, чтобы проверить результат.
- The run did not use one of the standard test prompts.
Команда запуска
docker run --gpus device=2,3 --ipc=host --shm-size 32g lmsysorg/sglang:qwen4 python3 -m sglang.launch_server --model-path Qwen/Qwen4-35B-A3B --served-model-name Qwen/Qwen4-35B-A3B --trust-remote-code --tp-size 2 --mem-fraction-static 0.6 --disable-radix-cache --max-running-requests 64 --context-length 40960 --random-seed 42 --speculative-algorithm DFLASH --speculative-draft-model-path RadixArk/Qwen4-35B-A3B-Dflash2 --speculative-dflash-block-size 8 --speculative-draft-kv-cache-dtype bf16 --speculative-use-block-verification
Theoretical memory ceiling
2,170.5–2,249.6 tok/s
3,584 GB/s memory bandwidth (spec sheet) · 114.00 GB model weights · 16-bit KV cache · 1–2,834 tokens of context
Includes speculative decoding: 4.10 tokens accepted per model step on average (529.4–548.7 steps/s) · measured 100.0 steps/s
18–19%
of the ceiling reached
Medium confidenceThe fastest this hardware's memory could serve a single request; real runs are slower. Model details from Qwen/Qwen4-35B-A3B; size from BF16 estimate. Hardware source · Open calculator
Оборудование
- GPU
- RTX PRO 6000 Blackwell Max-Q Workstation Edition
- Количество
- 2
- VRAM
- 96 GB
- OS
- Ubuntu 26.04.1 LTS
Движок
- Движок
- sglang
- Версия
- 0.5.24.dev1+gcd1dc28
- Build
- lmsysorg/sglang:qwen4 (sha256:a574b8c4d271459718a64f9dacd5ba373fcd4e75ee99770abeab4203557eccbd)
- Commit
- cd1dc28
- Квант
- BF16
- Backend
- cuda
- TP
- 2
- GPU mem util
- 0.6
- Prefix caching
- нет
- Max running seqs
- 64
- Spec decode
- включено
Конфигурация запуска
- Контекст
- 40 960 токенов
- Глубина
- 0 токенов
- Batch size
- 1
- Prompt tokens
- 2834
- Prefill tok/s
- 22.1K tok/s
- Output tokens
- 2048
- Заметки
- PureTensor lab, tensor-core: two of four RTX PRO 6000 Blackwell Max-Q cards (GPUs 2,3; 325 W limit), Threadripper PRO 9975WX, 512 GB DDR5. SGLang official Qwen4 image, pinned by digest, TP2. Full BF16 weights with the RadixArk DFlash2 block drafter (BF16 draft, 8-token verify width, block verification). Host P2P settings (amd_iommu=off, NVIDIA P2P registry keys). CPU in a performance window (boost on, performance governor, C2 off). Radix (prefix) cache off as in the drafter model card. A small embedding server (12 GB) stayed loaded on GPU 0. Thinking off (enable_thinking=false). Batch 1, temperature 0, streamed; median of 5 runs after 2 warmup(s). 500 verify steps, 4.10 tokens/step, 10.0 ms/step.
Спекулятивное декодирование
- Метод
- DFlash
- Принято за шаг
- Токенов: 4,1
- Доля принятых
- 44 %
- Черновые токены
- 3 500
- Принятые токены
- 1 550
Сохранённые данные
- Хеш промпта (SHA-256)
- 5a6b7bc1cbbc…
Пример промпта · 2,000 chars
[LocalMaxxing cache-bust nonce: f7587af4f2e823491e2a7d2818415843]
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 as a proper module: 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, then list the failure modes you would alert on.
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 as a proper module: verify the signature with HMAC-SHA256 over the raw bodПример вывода · 4,000 chars
# Production-Grade Webhook Handler
## 1. SQL — Idempotency Table
```sql
CREATE TABLE IF NOT EXISTS webhook_events (
event_id TEXT PRIMARY KEY,
event_type TEXT NOT NULL,
received_at TIMESTZONE NOT NULL DEFAULT now()
);
-- Optional: prune old rows with a scheduled job
-- DELETE FROM webhook_events WHERE received_at < now() - INTERVAL '30 days';
```
The `PRIMARY KEY` on `event_id` is the idempotency guarantee — a duplicate delivery hits a unique-constraint violation, which we catch and treat as a success.
---
## 2. Full Module — `webhooks.py`
```python
"""
webhooks.py — Secure, idempotent payment-webhook receiver.
Responsibilities:
1. Verify HMAC-SHA256 signature + reject stale timestamps.
2. Parse & validate payload with Pydantic.
3. Deduplicate via webhook_events table (idempotent inserts).
4. Dispatch to registered handlers via a type→handler registry.
5. Always return 2xx for valid-but-unhandled events to stop retries.
"""
from __future__ import annotations
import hashlib
import hmac
import json
import logging
import time
from collections.abc import Awaitable, Callable
from typing import Any
import asyncpg
from fastapi import APIRouter, Header, HTTPException, Request, Response
from pydantic import BaseModel, Field, field_validator
logger = logging.getLogger(__name__)
# ---------------------------------------------------------------------------
# Configuration
# ---------------------------------------------------------------------------
WEBHOOK_SECRET: str = "" # inject via env / settings
MAX_TIMESTAMP_AGE_SECONDS: int = 300 # 5 minutes
def configure_webhook(secret: str, max_age: int = 300) -> None:
"""Call once at startup to set the signing secret and staleness window."""
global WEBHOOK_SECRET, MAX_TIMESTAMP_AGE_SECONDS
WEBHOOK_SECRET = secret
MAX_TIMESTAMP_AGE_SECONDS = max_age
# ---------------------------------------------------------------------------
# Pydantic models
# ---------------------------------------------------------------------------
class WebhookEvent(BaseModel):
"""Top-level envelope sent by the payment provider."""
id: str = Field(..., description="Unique event ID (used for idempotency)")
type: str = Field(..., description="Event type, e.g. 'invoice.paid'")
created_at: int = Field(
..., description="Unix timestamp when the event was created"
)
data: dict[str, Any] = Field(default_factory=dict)
@field_validator("id")
@classmethod
def id_must_be_non_empty(cls, v: str) -> str:
if not v.strip():
raise ValueError("event id must not be empty")
return v
class InvoicePaidData(BaseModel):
"""Validated payload for invoice.paid events."""
id: str
amount: int # cents
currency: str = "usd"
# ---------------------------------------------------------------------------
# Signature verification
# ---------------------------------------------------------------------------
class SignatureError(Exception):
"""Raised when signature or timestamp validation fails."""
def verify_signature(
*,
raw_body: bytes,
signature_header: str,
timestamp_header: str,
secret: str,
max_age_seconds: int,
) -> None:
"""
Verify HMAC-SHA256 over ``"{timestamp}.{raw_body}"``.
Raises SignatureError on any validation failure.
"""
# --- timestamp freshness ---
try:
event_timestamp = int(timestamp_header)
except (ValueError, TypeError) as exc:
raise SignatureError(f"Invalid timestamp header: {timestamp_header!r}") from exc
now = int(time.time())
if abs(now - event_timestamp) > max_age_seconds:
raise SignatureError(
f"Timestamp too old or too far in the future "
f"(age={abs(now - event_timestamp)}s, max={max_age_seconds}s)"
)
# --- HMAC computation ---
signed_payload = f"{timestamp_header}.".encode() + raw_body
expected = hmac.new(
key=secreДругие запуски этой модели на этом оборудовании
- 477tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF16контекст 40K · глубина 0 · батч 1Проверенный запускpuretensor · 4 дек. 2026 г.
- 429tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF16контекст 40K · глубина 0 · батч 1puretensor · 4 дек. 2026 г.
- 368tok/svllm · v0.1.dev26393+gf247de72b · BF16контекст 1024K · глубина 0 · батч 1Проверенный запускpuretensor · 4 дек. 2026 г.
- 364tok/svllm · v0.1.dev26393+gf247de72b · BF16контекст 1024K · глубина 0 · батч 1puretensor · 4 дек. 2026 г.
- 353tok/svllm · v0.1.dev26393+gf247de72b · BF16контекст 1024K · глубина 0 · батч 1Проверенный запускpuretensor · 4 дек. 2026 г.
- 305tok/svllm · v0.1.dev26393+gf247de72b · BF16контекст 1024K · глубина 0 · батч 1Проверенный запускpuretensor · 4 дек. 2026 г.
- 298tok/svllm · v0.1.dev26393+gf247de72b · BF16контекст 1024K · глубина 0 · батч 1Проверенный запускpuretensor · 4 дек. 2026 г.
- 283tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF16контекст 40K · глубина 0 · батч 1Проверенный запускpuretensor · 4 дек. 2026 г.
- 198tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF16контекст 40K · глубина 0 · батч 1Проверенный запускpuretensor · 4 дек. 2026 г.
- 197tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF16контекст 40K · глубина 0 · батч 1Проверенный запускpuretensor · 4 дек. 2026 г.
