ทดสอบความเร็ว
Qwen4-35B-A3B
RTX PRO 6000 Blackwell Workstation Edition 96GB ×2 · sglang · v0.5.24.dev1+gcd1dc28 · BF16
Decode
382tok/s
Prefill
19.7ktok/s
เวลาถึงโทเค็นแรก
144ms
รวม
888tok/s
VRAM สูงสุด
—
ความยาวบริบท
40K
ความลึก KV
0
ขนาด batch
1
การทำงานพร้อมกัน
1
การใช้พลังงาน
—
การตรวจสอบ
ยังไม่ตรวจสอบ — ผลลัพธ์เชิงทดลอง
การรันที่ตรวจสอบแล้วใช้พรอมต์ทดสอบมาตรฐานและบันทึกข้อมูลเพียงพอสำหรับตรวจสอบผลลัพธ์
- The run did not use one of the standard test prompts.
คำสั่งเริ่มรัน
docker run --gpus all --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,289.5–2,377.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.36 tokens accepted per model step on average (525.7–545.9 steps/s) · measured 87.8 steps/s
16–17%
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 Workstation Edition
- จำนวน
- 2
- VRAM
- 96 GB
- OS
- Ubuntu 24.04.5 LTS
Engine
- Engine
- sglang
- เวอร์ชัน
- 0.5.24.dev1+gcd1dc28
- Build
- lmsysorg/sglang:qwen4 (sha256:a574b8c4d271459718a64f9dacd5ba373fcd4e75ee99770abeab4203557eccbd)
- Commit
- cd1dc28
- Quant
- BF16
- Backend
- cuda
- TP
- 2
- GPU mem util
- 0.6
- Prefix caching
- ไม่
- Max running seqs
- 64
- Spec decode
- เปิดใช้งาน
Run config
- Context
- 40,960 tokens
- ความลึก
- 0 tokens
- Batch size
- 1
- Prompt tokens
- 2834
- Prefill tok/s
- 19.7K tok/s
- Output tokens
- 2048
- หมายเหตุ
- PureTensor lab, fox-n0: two RTX PRO 6000 Blackwell Workstation Edition cards (600 W limit), Threadripper 7970X, 256 GB RAM. 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). CPU in a performance window (boost on, performance governor, C2 off). Radix (prefix) cache off as in the drafter model card. A small reranker (2.3 GB) stayed loaded on GPU 0. Thinking off (enable_thinking=false). Batch 1, temperature 0, streamed; median of 5 runs after 2 warmup(s). 470 verify steps, 4.36 tokens/step, 11.4 ms/step.
Speculative decoding
- วิธี
- DFlash
- ที่ยอมรับต่อขั้น
- 4.36 โทเค็น
- อัตราการยอมรับ
- 48%
- โทเค็นร่าง
- 3,290
- โทเค็นที่ยอมรับ
- 1,577
หลักฐานที่บันทึกไว้
- แฮชพรอมป์ต์ (SHA-256)
- 5a6b7bc1cbbc…
ตัวอย่างพรอมป์ต์ · 2,000 chars
[LocalMaxxing cache-bust nonce: 56227c748ecf61a2535d41bd47718b51]
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 webhook_events (
event_id TEXT PRIMARY KEY,
event_type TEXT NOT NULL,
received_at TIMESTALMPZ NOT NULL DEFAULT now(),
processed_at TIMESTAMPTZ
);
-- Optional: prune old events after 90 days
CREATE INDEX idx_webhook_events_received_at
ON webhook_events (received_at);
```
The `ON CONFLICT DO NOTHING` on `event_id` is the idempotency gate — if the row already exists the insert is a no-op and we skip processing.
---
## 2. Full Module — `webhooks/payments.py`
```python
"""
Payment-provider webhook receiver.
Responsibilities:
1. Verify HMAC-SHA256 signature + reject stale timestamps.
2. Parse the envelope into a typed Pydantic model.
3. Idempotently record the event id in Postgres.
4. Dispatch to a registered handler (or silently ack unknown types).
5. Never return 5xx for payloads we simply don't handle.
"""
from __future__ import annotations
import hashlib
import hmac
import json
import logging
import time
from typing import Any, Awaitable, Callable, Coroutine
import asyncpg
from fastapi import APIRouter, FastAPI, Header, HTTPException, Request, Response
from pydantic import BaseModel, Field, field_validator
logger = logging.getLogger(__name__)
# ---------------------------------------------------------------------------
# Configuration (inject via settings / env in production)
# ---------------------------------------------------------------------------
WEBHOOK_SECRET: str = "whsec_replace_me"
MAX_TIMESTAMP_AGE_SECONDS: int = 300 # 5 minutes
# ---------------------------------------------------------------------------
# Pydantic envelope model
# ---------------------------------------------------------------------------
class WebhookEvent(BaseModel):
"""Top-level envelope sent by the payment provider."""
id: str = Field(..., description="Unique event id (idempotency key)")
type: str = Field(..., description="Event type, e.g. 'invoice.paid'")
created: int = Field(..., description="Unix timestamp set by the provider")
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 blank")
return v
# ---------------------------------------------------------------------------
# Signature verification
# ---------------------------------------------------------------------------
def verify_signature(
*,
raw_body: bytes,
signature_header: str,
timestamp_header: str,
secret: str = WEBHOOK_SECRET,
max_age: int = MAX_TIMESTAMP_AGE_SECONDS,
) -> None:
"""
Verify the HMAC-SHA256 signature and timestamp freshness.
Expected headers (provider convention):
X-Signature: sha256=<hex-digest>
X-Timestamp: <unix-seconds>
The signed payload is ``f"{timestamp}.{raw_body}"`` to prevent
replay of a captured body at a later time.
Raises HTTPException(403) on any verification failure.
"""
# --- timestamp freshness ------------------------------------------------
try:
ts = int(timestamp_header)
except (ValueError, TypeError):
raise HTTPException(status_code=403, detail="Malformed timestamp header")
now = int(time.time())
if abs(now - ts) > max_age:
raise HTTPException(status_code=403, detail="Timestamp outside acceptable window")
# --- HMAC verification --------------------------------------------------
signed_payload = f"{timestamp_header}.".encode() + raw_body
expected = hmac.new(
key=secret.encode(),
msg=signed_payload,
digestmod=hashlib.sha256,
).hexdigest()
# The provider may prefix with "sha256="
provided = signature_header.removeprefix("sha256=")
if not hmac.compare_digest(expected, provided):
raise HTTPException(status_code=403, detail="SignaRuns อื่นของโมเดลนี้บนฮาร์ดแวร์นี้
- 414tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF16บริบท 40K · ความลึก 0 · batch 1puretensor · 5 ธ.ค. 2569
- 408tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF16บริบท 40K · ความลึก 0 · batch 1การรันที่ตรวจสอบแล้วpuretensor · 5 ธ.ค. 2569
- 248tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF16บริบท 40K · ความลึก 0 · batch 1การรันที่ตรวจสอบแล้วpuretensor · 5 ธ.ค. 2569
- 203tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF16บริบท 40K · ความลึก 0 · batch 1การรันที่ตรวจสอบแล้วpuretensor · 5 ธ.ค. 2569
- 195tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF16บริบท 40K · ความลึก 0 · batch 1puretensor · 5 ธ.ค. 2569
- 163tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF16บริบท 40K · ความลึก 0 · batch 1การรันที่ตรวจสอบแล้วpuretensor · 5 ธ.ค. 2569
