速度テストモデルベンチマークレンタルレポートハードウェアデコード計算機組織ProAPIドキュメント送信
言語
Actual Computer — Every computer, one endpoint

速度テスト

Qwen4-35B-A3B

RTX PRO 6000 Blackwell Max-Q Workstation Edition 96GB ×2 · sglang · v0.5.24.dev1+gcd1dc28 · BF16

puretensor検証済み2026/12/04

デコード

429tok/s

プリフィル

25.5ktok/s

最初のトークンまでの時間

1,326ms

合計

5.9ktok/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

1,639.5–2,401.0 tok/s

3,584 GB/s memory bandwidth (spec sheet) · 114.00 GB model weights · 16-bit KV cache · 1–33,856 tokens of context

Includes speculative decoding: 4.40 tokens accepted per model step on average (372.4–545.4 steps/s) · measured 97.4 steps/s

18–26%

of the ceiling reached

Medium confidence

The 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
バックエンド
cuda
TP
2
GPUメモリ使用率
0.6
プレフィックスキャッシュ
いいえ
最大実行シーケンス数
64
Spec decode
有効

実行設定

コンテキスト
40,960 トークン
深度
0 トークン
バッチサイズ
1
プロンプトトークン
33856
プリフィル tok/s
25.5K tok/s
出力トークン
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). Long cold prompt: the webhook prompt repeated to about 33.9K tokens, nothing cached (radix cache off). Batch 1, temperature 0, streamed; median of 5 runs after 2 warmup(s). 465 verify steps, 4.40 tokens/step, 10.3 ms/step.

投機的デコード

手法
DFlash
ステップあたりの採択数
4.4 トークン
採択率
49%
ドラフトトークン
3,255
採択トークン
1,582

記録された証跡

プロンプトハッシュ (SHA-256)
2d56214bb6db…
プロンプトサンプル · 2,000 chars
[LocalMaxxing cache-bust nonce: b984dd72eaaa534360e98993e813106b]
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 Webhook Handler

## SQL Migration

```sql
-- Idempotency table: tracks processed event IDs to prevent duplicate processing
CREATE TABLE IF NOT EXISTS webhook_events (
    event_id    TEXT PRIMARY KEY,
    event_type  TEXT NOT NULL,
    processed_at TIMESTAMPTZ NOT NULL DEFAULT now()
);

-- Optional: auto-purge old events after 30 days
CREATE INDEX IF NOT EXISTS idx_webhook_events_processed_at
    ON webhook_events (processed_at);
```

## Module: `webhooks.py`

```python
"""Payment webhook handler with signature verification, idempotency, and event dispatch."""

from __future__ import annotations

import hashlib
import hmac
import logging
import time
from collections.abc import Awaitable, Callable
from typing import Any, Final

from fastapi import APIRouter, Header, HTTPException, Request, Response
from pydantic import BaseModel, Field, field_validator

logger = logging.getLogger(__name__)

# ---------------------------------------------------------------------------
# Configuration
# ---------------------------------------------------------------------------

WEBHOOK_SECRET: Final[str] = "your-webhook-signing-secret"  # inject via settings
MAX_TIMESTAMP_AGE_SECONDS: Final[int] = 300  # 5 minutes


# ---------------------------------------------------------------------------
# Pydantic models
# ---------------------------------------------------------------------------


class WebhookEvent(BaseModel):
    """Envelope for incoming payment provider webhooks."""

    id: str = Field(..., description="Unique event identifier")
    type: str = Field(..., description="Event type, e.g. invoice.paid")
    created_at: int = Field(..., description="Unix timestamp of event creation")
    data: dict[str, Any] = Field(..., description="Event payload")

    @field_validator("id")
    @classmethod
    def id_not_empty(cls, v: str) -> str:
        if not v.strip():
            raise ValueError("event id must not be empty")
        return v


class WebhookResponse(BaseModel):
    """Response body returned to the provider."""

    status: str
    event_id: str | None = None


# ---------------------------------------------------------------------------
# Signature verification
# ---------------------------------------------------------------------------


class SignatureError(Exception):
    """Raised when webhook signature verification fails."""


def verify_signature(
    *,
    raw_body: bytes,
    signature_header: str,
    timestamp_header: str,
    secret: str = WEBHOOK_SECRET,
    max_age_seconds: int = MAX_TIMESTAMP_AGE_SECONDS,
) -> None:
    """
    Verify HMAC-SHA256 signature and reject stale timestamps.

    Expected headers:
        X-Signature: sha256=<hex-digest>
        X-Timestamp: <unix-seconds>

    The signed payload is: f"{timestamp}.{raw_body}"

    Raises:
        SignatureError: on any verification failure.
    """
    # --- timestamp freshness check ---
    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 future: {event_timestamp} vs {now}"
        )

    # --- HMAC verification ---
    if not signature_header.startswith("sha256="):
        raise SignatureError("Signature header missing 'sha256=' prefix")

    provided_sig = signature_header[len("sha256="):]

    signed_payload = f"{timestamp_header}.".encode() + raw_body
    computed = hmac.new(
        key=secret.encode(),
        msg=signed_payload,
        digestmod=hashlib.sha256,
    ).hexdigest()

    if not hmac.compare_digest(computed, provided_sig):
        raise SignatureError("HMAC mismatch")


# ---------------------------------------------------------------------------
# Event handler registry
# -------------------------------------------------------------

このハードウェアでのこのモデルの他の実行