Pre-quantized weights and TTNN tensor caches for running Qwen/Qwen4-35B-A3B (35B total / ~3B active MoE, 40 layers, 256 routed experts, 4-stream Hyper-Connections, Per-Layer Embeddings, and MTP-1 speculative decoding) on a single Tenstorrent Blackhole P150 (32 GB GDDR6).
Companion model code & vLLM adapter:
Lottolabs/Qwen4-35B-A3B-TT-Mixed-BFP4-BFP8-P150-tt-model
| Weight Family | Format | Quantization Method | Location |
|---|---|---|---|
Routed MoE Experts (40 × 256 gate_up_proj, down_proj) |
BFP4 | GPTQ (act_order=True) on 66 disjoint calibration records (6,738 tokens) |
P150 DRAM |
Gated DeltaNet (in_proj_qkv, in_proj_z) |
BFP4 | Per-block clip_search=2 |
P150 DRAM |
Gated DeltaNet (in_proj_a, in_proj_b, out_proj) |
BFP4 / BFP8 | a/b RTN-BFP4, out_proj BFP8 |
P150 DRAM |
Full Attention (q/k/v/o_proj), Hyper-Connections, PLE |
BFP8 | Standard TTNN BFP8 | P150 DRAM |
LM Head ([2048, 248320]) |
BFP4 (bfp4:ram) |
RTN-BFP4 (streamed from Host RAM) | Host RAM |
PLE N-gram Table (40.96 GB BF16 / 20 GB INT8) |
BF16 / INT8 | Host-RAM lookup | Host RAM |
RMSNorm (group_rms_norm_4, MTP norms) |
BF16 I/O, FP32 HiFi4 acc | Exact FP32 HiFi4 compute_kernel_config |
P150 L1/DRAM |
Evaluated teacher-forced across 34 records (2,528 scored token positions) spanning 5 domains (math, code, science, prose, reasoning) directly against upstream BF16 modeling_qwen4_moe.py (ref PPL = 4.526).
CPU reference parity vs upstream modeling_qwen4_moe.py was first verified across all 40 layers (kl_full = 0.00196, 5/5 top-5 match).
| Configuration | Mean KL ↓ | Top-1 Agree ↑ | TT PPL (Ref 4.526) | ΔPPL ↓ | Notes |
|---|---|---|---|---|---|
| RTN-BFP4 MoE + All-non-MoE BFP8 | 0.0976 | 90.47% | 4.646 | +2.67% | Pre-GPTQ baseline |
| GPTQ-BFP4 MoE + All-non-MoE BFP8 | 0.0706 | 91.77% | 4.695 | +3.74% | -27.7% KL from GPTQ |
| Default (≤512K): GPTQ-BFP4 MoE + GDN clip2-BFP4 + BFP8 KV | 0.0820 | 92.29% | 4.617 | +2.01% | Locked default |
| Native 1M Mode: Default + Hadamard-Rotated BFP4 KV | 0.0984 | 91.02% | 4.651 | +2.77% | 6.64 GB KV for 1,048,576 tok |
| Default + Plain BFP4 KV (no Hadamard) | 0.1038 | 91.18% | 4.578 | +1.16% | Ablation |
+ Hyper-Connection w_up clip2-BFP4 |
0.0955 | 90.19% | 4.677 | +3.34% | Not enabled by default |
| + Full-Attention clip2-BFP4 | 0.1037 | 91.97% | 4.605 | +1.74% | Not enabled by default |
| Domain | Positions | Ref PPL | Default KL | Default Top-1 | Default ΔPPL | GPTQ+BFP8 KL |
|---|---|---|---|---|---|---|
math |
628 | 2.176 | 0.0606 | 96.02% | -0.97% | 0.0499 |
code |
525 | 2.340 | 0.0459 | 95.62% | +0.88% | 0.0411 |
science |
235 | 11.033 | 0.0586 | 93.19% | +4.30% | 0.0514 |
prose |
570 | 11.830 | 0.1742 | 83.16% | +6.15% | 0.1560 |
reasoning |
570 | 4.934 | 0.0563 | 93.86% | +1.40% | 0.0431 |
| Overall | 2,528 | 4.526 | 0.0820 | 92.29% | +2.01% | 0.0706 |
Measured end-to-end against a live vllm serve OpenAI HTTP server (POST /v1/completions, stream=True, temperature=0.0, --max-model-len 8192 --max-num-seqs 1 --block-size 64 --no-enable-prefix-caching --speculative-config '{"method": "mtp", "num_speculative_tokens": 1}') with warm TT-Metal kernel cache:
| Benchmark Case | Prompt Toks | Gen Toks | TTFT (ms) | Prefill (tok/s) | Decode (tok/s) | E2E (tok/s) |
|---|---|---|---|---|---|---|
short_qa_128 (Quicksort complexity) |
32 | 128 | 340.9 | 93.9 | 134.33 | 99.51 |
med_arch_256 (Accelerator memory) |
48 | 256 | 254.8 | 188.3 | 126.15 | 112.47 |
med_code_256 (Thread-safe LRU cache) |
53 | 256 | 262.9 | 201.6 | 127.58 | 113.19 |
long_1k_128 (1K context) |
1,102 | 84 | 1,479.3 | 745.0 | 123.38 | 39.03 |
long_2k_128 (2K needle recall) |
2,236 | 128 | 2,705.5 | 826.5 | 120.68 | 34.06 |
78.9–84.6% draft acceptance (mean_cycle_ms = 13.82 ms, mean acceptance length 1.79–1.85).Q4-BH-8821) and target frequency (1400 MHz).Using fixed 4-bucket chunked prefill (64 / 256 / 1024 / 2048 tokens) + release_traces() before long eager prefill:
1,310–1,316 tok/s prefill), 17,711 tok (1,424.3 tok/s prefill), and 29,051 tok (1,123.7 tok/s prefill, 95.0% MTP-1 acc) — 100% exact needle recall on every length.1,048,576 tokens) via Hadamard-Rotated BFP4 KV (QWEN4_KV_DTYPE=bfp4 QWEN4_KV_HADAMARD=1): Full 40-layer model + MTP-1 drafter + 16,384 × 64-token paged BFP4 KV cache (6.64 GB KV, ~28.2 GB total) loads cleanly on a single 32 GB P150 (124.7s). Verified exact needle recall at 4,481 tok (872.4 tok/s prefill) and 32,831 tok (912.5 tok/s prefill, 94.4% MTP-1 acc).--max-num-seqs 1 with --no-enable-prefix-caching.bfp4:ram LM head.有文件?提交种子。
发布种子Qwen/Qwen4-35B-A3B