Speedtest
Qwen4-35B-A3B-NVFP4
RTX PRO 6000 Blackwell Max-Q Workstation Edition 96GB ×2 · sglang · v0.5.24.dev1+gcd1dc28 · NVFP4
Decode
510tok/s
Prefill
23.2ktok/s
Zeit bis zum ersten Token
122ms
Gesamt
1.2ktok/s
Peak-VRAM
—
Kontextlänge
40K
KV-Tiefe
0
Batchgröße
1
Parallelität
1
Leistungsaufnahme
—
Verifizierung
Nicht verifiziert — experimentelles Ergebnis
Verifizierte Läufe nutzen einen Standard-Testprompt und speichern genug Daten, um das Ergebnis zu prüfen.
- The run did not use one of the standard test prompts.
Startbefehl
docker run --gpus device=2,3 --ipc=host --shm-size 32g lmsysorg/sglang:qwen4 python3 -m sglang.launch_server --model-path RadixArk/Qwen4-35B-A3B-NVFP4 --served-model-name RadixArk/Qwen4-35B-A3B-NVFP4 --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
6,637.5–7,437.2 tok/s
3,584 GB/s memory bandwidth (spec sheet) · 28.50 GB model weights · 16-bit KV cache · 1–2,836 tokens of context
Includes speculative decoding: 4.26 tokens accepted per model step on average (1,558.1–1,745.9 steps/s) · measured 119.8 steps/s
7–8%
of the ceiling reached
Medium confidenceThe fastest this hardware's memory could serve a single request; real runs are slower. Model details from RadixArk/Qwen4-35B-A3B-NVFP4; size from NVFP4 estimate. Hardware source · Open calculator
Hardware
- GPU
- RTX PRO 6000 Blackwell Max-Q Workstation Edition
- Anzahl
- 2
- VRAM
- 96 GB
- OS
- Ubuntu 26.04.1 LTS
Engine
- Engine
- sglang
- Version
- 0.5.24.dev1+gcd1dc28
- Build
- lmsysorg/sglang:qwen4 (sha256:a574b8c4d271459718a64f9dacd5ba373fcd4e75ee99770abeab4203557eccbd)
- Commit
- cd1dc28
- Quant
- NVFP4
- Backend
- cuda
- TP
- 2
- GPU mem util
- 0.6
- Prefix caching
- nein
- Max running seqs
- 64
- Spec decode
- aktiviert
Run-Konfiguration
- Kontext
- 40.960 Tokens
- Tiefe
- 0 Tokens
- Batch-Größe
- 1
- Prompt-Tokens
- 2836
- Prefill tok/s
- 23.2K tok/s
- Output-Tokens
- 2048
- Notizen
- 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. Target RadixArk NVFP4 (W4A4 experts) 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). 481 verify steps, 4.26 tokens/step, 8.3 ms/step.
Spekulatives Decoding
- Methode
- DFlash
- Akzeptiert pro Schritt
- 4,26 Tokens
- Akzeptanzrate
- 47 %
- Draft-Tokens
- 3.367
- Akzeptierte Tokens
- 1.568
Erfasste Nachweise
- Prompt-Hash (SHA-256)
- 5a6b7bc1cbbc…
Prompt-Beispiel · 2,000 chars
[LocalMaxxing cache-bust nonce: 67235f5279a5e438533923252e49f591]
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 bodAusgabebeispiel · 4,000 chars
# Production Webhook Handler
## 1. SQL — Idempotency Table
```sql
CREATE TABLE webhook_events (
event_id TEXT PRIMARY KEY,
event_type TEXT NOT NULL,
received_at TIMESTZONE NOT NULL DEFAULT now()
);
-- Optional: prune old events after 90 days
CREATE INDEX idx_webhook_events_received_at ON webhook_events (received_at);
```
---
## 2. Full Module — `webhooks.py`
```python
"""
webhooks.py — Secure, idempotent payment-webhook receiver.
Responsibilities:
1. Verify HMAC-SHA256 signature over the raw request body.
2. Reject events whose timestamp is outside an acceptable window.
3. Deduplicate by event_id via a Postgres primary-key constraint.
4. Dispatch known event types through a handler registry.
5. Return 2xx for unrecognised event types (no infinite retries).
"""
from __future__ import annotations
import hashlib
import hmac
import logging
import time
from collections.abc import Awaitable, Callable
from typing import Any, Final
import asyncpg
from fastapi import APIRouter, Header, HTTPException, Request, Response
from pydantic import BaseModel, Field, field_validator
logger = logging.getLogger(__name__)
# ---------------------------------------------------------------------------
# Configuration
# ---------------------------------------------------------------------------
WEBHOOK_SECRET: Final[str] = "whsec_replace_with_real_secret"
MAX_TIMESTAMP_AGE_SECONDS: Final[int] = 300 # 5 minutes
# ---------------------------------------------------------------------------
# Pydantic models
# ---------------------------------------------------------------------------
class InvoiceData(BaseModel):
id: str
amount: int # amount in smallest currency unit (cents)
currency: str = "usd"
class WebhookEvent(BaseModel):
"""Top-level envelope sent by the payment provider."""
id: str = Field(..., description="Unique event identifier (used for idempotency)")
type: str = Field(..., description="Event type, e.g. 'invoice.paid'")
created: int = Field(..., description="Unix timestamp of event creation")
data: dict[str, Any] = Field(
..., description="Raw payload; parsed per event type by handlers"
)
@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
# ---------------------------------------------------------------------------
# Signature verification
# ---------------------------------------------------------------------------
class SignatureError(Exception):
"""Raised when 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 the webhook signature.
Expected headers (typical Stripe-style scheme):
X-Timestamp: <unix-seconds>
X-Signature: t=<unix-seconds>,v1=<hex-digest>
The signed payload is ``b"<timestamp>.<raw_body>"``.
Raises:
SignatureError: on any verification failure.
"""
# --- parse the signature header ---
parts: dict[str, str] = {}
for segment in signature_header.split(","):
key, _, value = segment.partition("=")
parts[key.strip()] = value.strip()
timestamp_str = parts.get("t")
provided_sig = parts.get("v1")
if not timestamp_str or not provided_sig:
raise SignatureError(
"Malformed X-Signature header: expected 't=<ts>,v1=<hex>'"
)
# --- staleness check ---
try:
event_timestamp = int(timestamp_str)
except ValueError:
raise SignatureError(f"Non-integer timestamp: {timestamp_str!r}")
now = int(time.time())
if abs(now - event_timestamp) > max_age_seconds:
raise SignatureError(
f"Timestamp {event_timestamp} is outside the "
Weitere Runs dieses Modells auf dieser Hardware
- 561tok/ssglang · v0.5.24.dev1+gcd1dc28 · NVFP440K Kontext · 0 Tiefe · Batch 1Verifizierter Laufpuretensor · 04.12.2026
- 332tok/ssglang · v0.5.24.dev1+gcd1dc28 · NVFP440K Kontext · 0 Tiefe · Batch 1Verifizierter Laufpuretensor · 04.12.2026
- 212tok/ssglang · v0.5.24.dev1+gcd1dc28 · NVFP440K Kontext · 0 Tiefe · Batch 1Verifizierter Laufpuretensor · 04.12.2026
- 212tok/ssglang · v0.5.24.dev1+gcd1dc28 · NVFP440K Kontext · 0 Tiefe · Batch 1Verifizierter Laufpuretensor · 04.12.2026
- 208tok/ssglang · v0.5.24.dev1+gcd1dc28 · NVFP440K Kontext · 0 Tiefe · Batch 1puretensor · 04.12.2026
