Core AI model zoo

Accel levers — industry survey + zoo maximal-optimization plan (2026-07-01)

Companion docs: tensorops-zoo-impact-and-kernel-wins.md (per-model TensorOps impact table + the absorbed-MLA win) and tensorops-quantized-kernels.md (WWDC26 §330 foundation). Purpose: run the four levers (custom kernel / TensorOps / spec-decode / quantization) as PARALLEL work streams next session. Parallel = explicit separate sessions — background agents collide on CoreAIChat, _GPU_LOCK, and the single A19 device. All speedups marked ⚗️ are targets/estimates (industry numbers are cited; nothing below is zoo-device-measured yet).


PART 1 — Industry survey (top-3 × 4 categories, 2025–2026, cited)

① Custom GPU kernels

  1. FlashAttention v1→v4 — fused IO-aware attention. FA3: 75% Hopper util + FP8; FA4: 1605 TFLOP/s on Blackwell (~2.7× over Triton). Universal (PyTorch SDPA, vLLM, SGLang, TRT-LLM). FA3 · FA4
  2. PagedAttention (vLLM) — paged KV cache, 2–4× serving throughput, <4% KV waste. paper
  3. Marlin→Machete — fused dequant+GEMM, ~4× FP16×INT4 to batch 16–32 (AWQ ~10.9× in vLLM). Marlin
    • Frontier 2026: FA4, FP4 GEMM (NVFP4/MXFP4), MoE grouped-GEMM (DeepGEMM/DeepEP).

② Hardware matmul accel (= TensorOps’ industry analog)

  1. FP8 + Transformer Engine (Hopper) — DeepSeek-V3 trained in FP8, ~2 PFLOPS. DeepSeek-V3
  2. FP4 / NVFP4·MXFP4 (Blackwell) — 4× over FP8, ~7× GEMM over Hopper, ≤1% accuracy drop. gpt-oss ships native MXFP4; DeepSeek-V4 ships FP4 experts. NVFP4
  3. Marlin→Machete in-kernel dequant GEMM — the direct software analog of Apple matmul2d.
    • Apple TensorOps / M5-A19: matmul2d auto-dequant (int4/int8/fp8/fp4) on the neural accelerator. MLX-on-M5: prefill 3.33–4.06×, decode +19–27%. Third-party cider already gets 1.2–1.9× prefill via INT8 TensorOps on M5. Apple MLX/M5 · cider
    • Headline 2025–2026 = FP4 on Blackwell.

③ Speculative decoding (all lossless)

  1. EAGLE-3 — trained draft head fusing 3-layer features + tree verify. 3–5× (4.8× on 70B code), accept 0.80–0.88. Pretrained heads exist for Qwen3 (1.7B–235B), Llama, DeepSeek-distill, etc. Requires training a head (cheap: ~1–2 days / 8×3090); Red Hat Speculators standardizes Qwen3 EAGLE-3 → vLLM. EAGLE-3 · Speculators
  2. MTP (DeepSeek-V3/V3.2 built-in) — self-draft head shipped in the checkpoint, ~1.8×, >80% accept, free at deploy. MTP
  3. N-gram / prompt-lookuptraining-free, 2–4× on input-grounded tasks (RAG/code/structured), ~0 on free chat. vLLM n-gram
    • Vanilla off-the-shelf draft (no training) = ~2–3× baseline, the fallback when no EAGLE head exists.

④ Quantization

  1. GGUF k-quants (Q4_K_M) — PTQ, most-downloaded, Apple-Silicon-friendly (Gemma official QAT ships as q4_0 GGUF). GGUF/AWQ/MLX 2026
  2. AWQ — PTQ, production GPU int4 default, 0.5–1.5% PPL at int4; AWQ > GPTQ is the 2026 verdict.
  3. FP4 (MXFP4/NVFP4) — the defining 2025–26 trend, near-FP8 quality (≤1%); gpt-oss/DeepSeek-V4/Llama-405B. gpt-oss MXFP4
    • Quality champion at 4-bit = official QAT (Gemma q4_0, PPL −54%). Gemma QAT
    • HONEST NUANCE (decides a zoo bet): AWQ/GPTQ vs naive RTN at 4-bit / gs128 / large model is a surprisingly small gap (<1pt PPL) — AWQ’s edge is at 3-/2-bit and small models. So “AWQ rescues Qwen3.6 int4” is weak. The real 4-bit-quality answers are (a) official QAT, (b) FP4 (E2M1) — and Apple TensorOps natively dequants fp4 on A19 (OS27). QuaRot RTN-vs-GPTQ-by-size

Industry’s three strongest cards right now: FP4 (quant×HW), EAGLE-3 (spec-decode), FlashAttention (kernel).


PART 2 — The plan: 4 parallel streams (one session each)

Each stream = “apply the lever to the models where the survey says it’s effective, and optimize those to the metal.” Effectiveness mapping is grounded in the 5-bucket zoo analysis (see companion doc): TensorOps wins on non-AR/one-shot compute-bound forwards (diffusion/dLLM/encoders) + LLM prefill; spec-decode wins on LLM decode; FP4/QAT solves the int4-cliff/size; the pure-MSL MLA kernel is the frontier moat.

Stream A — PURE custom Metal kernel: Absorbed-MLA cross-head staging ★ moat, no Apple-HW dep

Stream B — TensorOps matmul2d on compute-bound forwards (diffusion/dLLM + encoders) ★ greenfield, biggest multiplier

Stream C — Speculative decoding on the flagship LLMs ★ most bankable decode 爆速

Stream D — Quantization: FP4-via-TensorOps + QAT-int4 (int4-cliff / iPhone-fit) ★ size + the int4 answer


PART 3 — Cross-stream coordination + conventions (non-negotiable)


PART 4 — Start-here per session

Ranked by confidence-of-win: C (spec-decode, technique proven) > A (MLA, half-built, real risk) > B (TensorOps, greenfield but Apple-measured 3–4×) > D (FP4 quality unproven on these models). Ranked by “地味でない / kernel romance”: A (pure MSL moat) > B (neural-accelerator) > D > C (engine/algo).