Verba/Rapida

Atlante delle accelerazioni per Gemma 4

I modi noti per rendere più veloce l'inferenza di Gemma 4, dai motori come vLLM, SGLang e llama.cpp ai kernel, alle modifiche al modello e all'hardware: cosa il laboratorio ha misurato, cosa è in programma e cosa nessuno ha provato, in sei livelli.

4Hardware

RTX PRO 4500 Blackwell as the default rented card

in programma

32 GB GDDR7, 800 GB/s per NVIDIA's datasheet (896 GB/s per PNY), FP8 and NVFP4 tensor cores (about 809 TFLOPS FP4 dense, reported), 165 to 200 W.

Which card for which job (selection of 2026-10-26)

non provato

Blackwell (sm120) software friction

non provato

Batch-1 decode bandwidth ceiling for MoE on the RTX PRO 4500

non provato
49Engines

KV-sharing fast prefill

in programma

E2B and E4B share KV in their top layers (20 of 35, 18 of 42); `--kv-sharing-fast-prefill` makes those layers compute only the position that emits the next token during prefill.

SWA bounded replay (SWA-aware prefix caching)

in programma

after a prefix-cache hit, rebuild the sliding-window KV by replaying only the last window (128 tokens in DeepSeek) instead of a multiple of it. **Origin:** DeepSeek DeepInfer, vLLM on V4.1 (posts 2026-10-07); repo created 2026-10-16.

Prefix and KV reuse across turns on Gemma 4's hybrid layout

non provato

reuse cached prompt KV across turns so later-turn TTFT drops; Gemma 4's mixed sliding/full layers make this engine-specific. **Origin:** LMCache Hybrid Memory Allocator for vLLM (2026-06-08); llama.cpp `--swa-full` workaround (2026-04-17).

Hybrid CPU/GPU expert execution and SSD expert streaming

non provato

attention and shared weights on the GPU; routed experts run (or stream) from CPU RAM or SSD. **Origin:** KTransformers (Tsinghua MADSys + Approaching.AI, SOSP 2025, reported); llama.cpp `-ncmoe`; turbo-fieldfare (community, 2026-09-21).

Fused-MoE kernel tuning for 26B-A4B

non provato

tuned Triton MoE configs for E=128 (vLLM PR 60504, open, title only). **Origin:** vLLM community.

Attention backend selection on Ada (head_dim 256/512)

in programma

Gemma 4's 256- and 512-wide heads push vLLM and SGLang onto slower kernel paths (FA2 supports up to 256; FlashInfer rejects 256/512 mixes). **Origin:** vLLM issue #38887; LMCache recipe.

Argon PR stack for vLLM (fused kernels, tile retune, fused MTP)

in programma

Triton fusion of QK RMSNorm+RoPE, FFN norms, PLE projection and MoE routing (#60674); tile retune for head_dim 512 (#60317); fused MTP layers and sparse gather-GEMV LM head (#60689); plus fast prefill by default (#60445, above).

Engine comparison on consumer cards (llama.cpp, mistral.rs, LiteRT-LM)

non provato

alternative engines with their own Gemma 4 kernels. **Origin:** mistral.rs v0.8.2 (2026-06-01); LiteRT-LM; llama.cpp.

Fast Gemma Challenge (agent-driven optimization)

non provato

agents collaborate to speed up Gemma 4 E4B under a perplexity guardrail, using drafters, speculative decoding, kernels and quantization. **Origin:** Hugging Face + Google, June 2026.

Kernels from the Chinese labs (SageAttention, FlashMLA/DeepGEMM, FlashKDA, HPC-Ops)

non provato

SageAttention2/2++ quantizes QK to INT8 and PV to FP8; FlashMLA, DeepGEMM (FP8 BLAS), FlashKDA and Tencent HPC-Ops are lab kernel libraries.

KV pools, disk tiers and disaggregation (Mooncake, DualPath, Prefill-as-a-Service)

non provato

a disaggregated KV pool across GPU, DRAM and SSD, dual-path KV loading, cross-datacenter prefill. **Origin:** Moonshot + Tsinghua Mooncake (arXiv 2407.00079); DeepSeek DualPath (arXiv 2602.21548); Moonshot Prefill-as-a-Service (arXiv 2604.15039); V4-Flash disk KV.

DeepInfer and large-scale serving designs (AFD, TileRT, TokenRouter, MoE comms)

non provato

DeepInfer open-sources DeepSeek's serving stack (DSpark, SWA bounded replay, async scheduler); StepFun Attention-FFN Disaggregation runs attention and FFN on separate GPU pools; TileRT, TokenRouter and Mega MoE are further system designs.

vLLM engine profile

misurato

v0.32.0 (2026-10-18, reported). Scheduler V1 with chunked prefill, Model Runner V2. Prefix cache is hash-based block reuse (hash of parent hash, block tokens and extras such as LoRA id, mm hash, cache salt; sha256 default, `xxhash` option). A hybrid KV manager groups SWA and full layers (see [Hybrid sliding-window prefix caching](#hybrid-sliding-window-prefix-caching)). Cascade attention was removed in v0.32.0.

SGLang engine profile

in programma

v0.5.22 (2026-10-19, reported). RadixAttention tree with SWA specializations (`PureSWARadixCache`, `UnifiedRadixCache`, SWA pool allocators, `--swa-full-tokens-ratio`), HiCache across GPU, host and external tiers, overlap scheduler, Breakable CUDA Graph as the default prefill graph backend (reported).

TensorRT-LLM engine profile

in programma

PyTorch-backend models, KV cache manager V2 with SWA block eviction, trtllm-gen cubins on sm100 and FlashInfer JIT on sm120 (one benchmark author, reported). Gemma 4 support and fused Gemma 4 kernels landed in v1.3.0rc21 (release 2026-07-15, **verified**); v1.4.0rc1 (2026-10-22) is a pre-release.

llama.cpp engine profile

in programma

build b11815 (2026-10-22, reported). Per-slot prompt cache with similarity match. Gemma 4 cache reuse broke on shared KV layers plus SWA (issue 21468: about 96 s to re-evaluate 46K tokens each request); PR 22288 "server : fix swa-full logic" closed it on 2026-04-24; the workaround is `--swa-full --no-mmproj` (reported).

mistral.rs engine profile

non provato

Rust engine with candle-based kernels, paged attention (`--paged-attn on`), CUDA graphs and fused MoE. v0.9.5 (2026-10-19, reported). Gemma 4 needed a KV-sharing correctness fix (reruns 2026-06-01); MTP merged (PR 2159).

Modular MAX engine profile

non provato

Mojo kernels and custom ops, NVIDIA and AMD. max/v26.6.0 (2026-09-17, reported); day-zero Gemma 4 on 2026-04-02. In the repo: `architectures/gemma4`, `dspark_gemma4`, `gemma4_assistant`, and a layer benchmark `bench_gemma4_attention.yaml` with head_dim 256/512, window 1024; sm_120 is in the hardware table; NVFP4 loader PR 6699 open.

ExLlamaV3 engine profile

non provato

Python plus CUDA extension, EXL3 quantization. v1.6.4 (2026-10-20, reported). PR 394 (open): sm120 TMA paged prefill FlashAttention for D128/256/512, FP16 only, 256-token pages, helps beyond 10k context, no sliding window or varlen. A windowed KV ring for sliding layers on Spark (PR 377, merged).

LMDeploy engine profile

non provato

TurboMind and PyTorch engines. v0.18.0 (2026-09-28, reported).

MLC-LLM engine profile

non provato

TVM-compiled engine. No release since a 2023 tag; the repo was pushed 2026-10-06 (reported).

TGI engine profile

non provato

Hugging Face Text Generation Inference. Last release v3.3.7 (2025-12-19); maintenance mode from 2025-12-11 and the repo is archived (last push 2026-03-21, reported).

Newer niche engines

non provato

single-developer or small-team engines that appear with narrow wins: sparkinfer (v0.3.7, 2026-07-07, Blackwell-native, decode only), halogen and Strata (Strix Halo), beellama.cpp (windowed SWA KV plus DFlash), inferrs, FreeToken, b12x (CuTe DSL and Triton kernels for SM120/SM121, also an optional vLLM backend), LiteRT-LM, DeepInfer (see [DeepInfer and large-scale serving designs (AFD, TileRT, TokenRouter, MoE comms)](#deepinfer-and-large-scale-serving-designs-afd-tilert-tokenrouter-moe-comms)).

NVIDIA Flare (sm120/sm121 Rust runtime)

non provato

a Rust runtime for SM120/SM121 only (not 4090, H100 or B200), CUDA graphs captured at build time, FP8 KV by default, packages built per architecture (SM120 packages fail the arch check on a Spark). Repo `NVIDIA/flare-local-inference`, Apache-2.0, created 2026-10-20 (**verified**, `gh api`). Launch post 2026-10-20 (X, reported).

TensorFold (single-model decode engine)

non provato

an engine that wins single-stream decode by being built per model (60+ models ported, reported). The 1.0.3 release binary has no RTX 5090 kernels; build from source with `-Dsm=120`.

NInfer (a single-model engine pattern; Gemma 4 not supported)

non provato

a from-scratch C++/CUDA engine for one card and a few models (repo `Neroued/ninfer`, Apache-2.0, 3,149 stars, **verified** to exist). Its README supports Qwen models only and builds only for the RTX 5090 (`sm_120a`); no Gemma 4 artifact (**verified** by this session).

New fast matrix multiplication algorithms (AlphaEvolve, OpenAI omega <= 9/4)

non provato

schemes that multiply matrices with fewer scalar multiplications: AlphaEvolve's 4x4 in 48 multiplications (arXiv 2506.13131, complex; rational version arXiv 2506.13242, **verified** abstract), omega < 2.371177 (arXiv 2608.16884, abstract **verified**), and OpenAI's claimed omega <= 9/4 (manuscripts of 2026-09-24 and 2026-10-02, announced 2026-10-06; Lean-checked and generalised to all fields by others; **reported**, the paper was not read).

Hybrid sliding-window prefix caching

in programma

Gemma 4 mixes sliding and full layers, so a prefix hit must reuse the full-attention prefix plus only the last sliding window. vLLM's hybrid KV manager keeps one KV group per layer type, finds the full-attention hit first, then the longest SWA hit within it scanning right to left; only the last `sliding_window - 1` tokens must be cached. SGLang's Unified Radix Cache (blog 2026-08-11) has a SWA component that keeps a contiguous trailing window while older SWA slots become tombstones. llama.cpp uses `--swa-full` or the post-April fixes (see [Prefix and KV reuse across turns on Gemma 4's hybrid layout](#prefix-and-kv-reuse-across-turns-on-gemma-4s-hybrid-layout)).

Per-layer attention backend mix

in programma

run each layer kind on the kernel that suits it: FA2 for the head_dim 256 sliding layers, Triton or FlashInfer for the head_dim 512 global layers. vLLM exposes `backend_per_kind` (per KV-cache group since v0.26.0, reported); SGLang PR 44399 (open, Hopper only) uses FA3 for the 256 layers and FA4 for the 512 layers.

sm120 platform constraints

in programma

sm120 (RTX 5090, RTX PRO 6000, presumably the PRO 4500) has 99 KB of shared memory per SM vs 228 KB on datacenter Blackwell and no TMEM or tcgen05, so datacenter-Blackwell kernels fall back or raise (reported). RTX PRO 4500 Blackwell Server Edition: 32 GB GDDR7, 800 GB/s, 10,496 CUDA cores (one X post, reported).

FA4 sliding-window forward on sm120

in programma

`FlashAttentionForwardSm120` inherits the SM80 kernel, which walks every KV block for local attention, so cost is quadratic instead of linear in prompt length. Flash-attention issue #2953 is open (**verified**).

Drafter support across engines and structured-output acceptance

in programma

every Gemma 4 size ships a `*-assistant` MTP drafter that shares the target's KV. vLLM (day-0 recipes), SGLang (NEXTN, 5 steps / 6 draft tokens), TRT-LLM (`Gemma4AssistantForCausalLM`) and llama.cpp (PR 23398) support it; EAGLE3 speculators (Red Hat), DFlash and DSpark are the other drafters (vLLM PR 46995 runs the DSpark draft loop in one CUDA graph, compatible with prefix caching). Model-side detail: [Gemma 4 MTP assistant drafters (Google)](model.md#gemma-4-mtp-assistant-drafters-google).

Megakernels and CUDA graphs

non provato

a megakernel fuses a decode step into one persistent kernel; CUDA graphs with PDL cut launch cost. Both target decode, not prefill (merge note).

vLLM plugins and CustomOp

in programma

entry-point groups `vllm.general_plugins`, `platform_plugins`, `stat_logger_plugins`, `endpoint_plugins`; `ModelRegistry.register_model`; `@CustomOp.register("name")` enabled with `--compilation_config.custom_ops '["+name"]'`; out-of-tree replacement with `@CustomOp.register_oot("TargetOpName")` implementing `forward_oot()`; `register_backend` for an `AttentionBackendEnum`, then `--attention-backend NAME`. The docs say Triton ops cannot be registered out of tree "now", so a Triton change is a source patch or a `CustomOp` subclass in a plugin.

SGLang attention backend registry

in programma

subclass the base backend, implement `forward_extend`, `forward_decode`, `init_forward_metadata` and the three CUDA-graph hooks, decorate with `@register_attention_backend`, select with `--attention-backend` (or split with `--prefill-attention-backend` and `--decode-attention-backend`). Gemma 4 defaults live in `python/sglang/srt/arg_groups/model_overrides/gemma4.py`. The `sglang.serve_backends` entry point is for whole runtimes, not kernels.

Carrying unmerged PRs as local patches

in programma

install a release tag with the Python-only build (`VLLM_USE_PRECOMPILED=1 uv pip install --editable . --torch-backend=auto`), then `gh pr diff <n> --repo vllm-project/vllm | git apply --3way`. Order for the Argon PRs: 60317, 60674, 60445; expect conflicts since main moved. A C++ or kernel-source change cannot use the Python-only build. Per-commit wheels: `https://wheels.vllm.ai/<commit>` with `VLLM_PRECOMPILED_WHEEL_COMMIT` (reported).

Triton autotuning

in programma

a standalone bench around one kernel (vLLM pattern: `benchmarks/kernels/benchmark_*.py`, `tests/kernels/attention/test_triton_unified_attention.py`) with `@triton.autotune` configs on the target card. `vllm preload --preload-autotune` keeps the FlashInfer autotune table warm across restarts and `vllm download-kernels` installs precompiled FlashInfer kernels (reported). The exact Triton autotune cache mechanics were not read.

Helion

non provato

a Python-embedded tile DSL that compiles to Triton, with an autotuner (default LFBO); GA listed April 7, 2026 and about 10 minutes of tuning per kernel (snippets). vLLM added a Helion kernel framework with autotuning, and AOT autotuning with runtime dispatch (reported).

CuTe DSL and other kernel DSLs

non provato

CuTe DSL is the Python route to CUTLASS-style kernels: FlashAttention-4 is a CuTe DSL kernel (Hopper and Blackwell; the sm120 path is SM80-derived), vLLM v0.32.0 pulls CuTe DSL 4.8.0 block-scale APIs and a FlashInfer CuTeDSL MegaMoE backend, FlashInfer v0.7.2 has a CuTe DSL grouped-GEMM backend that also runs BF16 on SM120, TRT-LLM rc21 ships CuTe DSL kernels (reported).

AI-generated kernels with end-to-end gating

in programma

an agent writes or tunes kernels in a keep-or-revert loop; the gate is an end-to-end run (torch.compile and CUDA graphs on, token identity checked), never a kernel micro-benchmark.

Profiling an engine

in programma

DSpark in vLLM 0.31 and 0.32, and adaptive verification on sm120

non provato

vLLM serves DSpark drafters with `method: dspark`; `dspark_draft_topk` picks Markov-head candidates from the base logits first (64 instead of a 262k vocabulary); adaptive verification (`enable_adaptive_verification`) lets a confidence head trim each request's verify window on the device.

Triton split-K for multi-query verify (vLLM PR 56148)

non provato

lets verify batches with up to 8 query tokens per request use the 3D split-K kernel instead of the 2D one, which parallelizes only over query blocks and is slow at long context and low batch.

Google's Gemma 4 vLLM PR series (October 2026)

non provato

Google's Luciano Martins opened a set of Gemma 4 speed PRs on 2026-10-06 to 10-08 (X: "8 PRs in total", one dedicated to 26B).

MLX Metal kernels for verify shapes (MLX 0.32.3 to main, October 2026)

non provato

a speculative verify step runs 2 to 16 query rows per request; MLX's quantized matmul and SDPA had fast paths for 1 row and for many rows, and a slow path between.

Gemma 4 drafters in the Mac engines (mlx-serve, mlx-vlm, mlx-dspark, dflash-mlx)

non provato

Gemma 4 26B-A4B drafter inventory and the Mac evidence for one user (2026-11-13 sweep)

non provato

draft k tokens cheaply, verify them in one k+1-row target forward, keep the agreeing prefix (lossless under greedy only if the k-row forward's argmax equals the one-row step's).

Other engine items in the window (watch list)

non provato

Shorter drafts at high load (Cline, Nemotron 3.5 Super VL on vLLM, reported)

non provato

at high concurrency the GPU already has work, so drafted tokens that get rejected cost verify time

84Model

FP8 and low-bit KV cache

in programma

store K/V in FP8 or fewer bits to cut cache memory and bandwidth.

OSCAR INT2 KV cache

non provato

calibrated rotations (query covariance for K, score-weighted value covariance for V) push quantization noise into attention-insensitive directions.

Smaller sliding window with a learnable sink bias

in programma

shrink the local window (128 tokens in MiMo) at 5:1 SWA:global and add a learnable per-head sink logit so the hybrid matches all-global attention. **Origin:** Xiaomi MiMo-V2-Flash, arXiv 2601.02780 (2026-01-06; release 2025-12-16).

Training-free search for which layers become SWA

in programma

beam search (PostNAS-inspired) picks which layers of a trained model switch to sliding-window attention.

Global-to-sliding conversion with healing

non provato

replace some global layers (E4B: 7 of 42) with sliding-window layers, then heal by distillation. **Origin:** Attention Editing (arXiv 2604.05688); SWA with sinks (arXiv 2608.28444); GLIDE (arXiv 2607.24788).

Attention Editing (conversion to MLA or GateSWA)

non provato

replace attention modules, then layer-wise teacher-forced and model-level distillation. **Origin:** China Merchants Bank AI Lab, arXiv 2604.05688, 2026-04-07 (Ascend 910B).

DeepSeek Sparse Attention (DSA) and its conversion recipe

non provato

a lightning indexer scores past tokens and each query attends to the top-k (k=2048); the indexer is warmed up with KL to dense attention, then the model trains sparse.

IndexCache and IndexShare (indexer reuse)

non provato

reuse top-k indices across adjacent layers (70% to 100% overlap) by training-free greedy search or multi-layer distillation; GLM-5.2 ships one indexer per 4 sparse layers. **Origin:** Tsinghua + Z.ai, arXiv 2603.12201 (2026-03-12); IndexShare in GLM-5.2 (2026-06-16).

HISA hierarchical indexer

non provato

block-level coarse filter, then token-level indexer inside kept blocks. **Origin:** arXiv 2603.28458, 2026-03-30 (lab not established; Peking University reported).

InfLLM-V2

non provato

dense-sparse switchable trainable block-sparse attention with no extra parameters. **Origin:** Tsinghua/OpenBMB, arXiv 2509.24663, 2025-09-30.

LoZA (LongCat ZigZag Attention)

non provato

calibrate a per-layer alpha on each MLA layer and convert the 50% least important layers to streaming sparse attention at mid-training. **Origin:** Meituan LongCat, 2026-01-07.

Simple Attention Sparsification (SAS), gate-only sparse decode

non provato

learn a block selector end to end by adding its continuous gate inside the softmax so the LM loss trains block ranking; backbone frozen; decode only, prefill unchanged.

LongFlow KV eviction for long reasoning outputs

non provato

importance from an attention intermediate for the current query only; fused FlashAttention plus eviction kernel. **Origin:** Soochow University (reported), arXiv 2603.11504, 2026-03-12.

MHA/GQA to MLA conversion (MHA2MLA, TransMLA, MLAfication)

non provato

re-express K and V as a low-rank latent plus a small RoPE part, initialised by SVD of the pretrained projections and recovered by short distillation or fine-tuning.

SwiftKV and YOCO++ (extend KV sharing to models without it)

non provato

compute later layers' KV from an early layer's output, distilling only the Q/K/V projections. **Origin:** SwiftKV arXiv 2410.03960 (Snowflake); YOCO++ arXiv 2604.13556; YOCO arXiv 2405.05254.

HALO / HypeNet (Transformer to RNN hybrid)

non provato

distil Transformer layers into an RNN-attention hybrid with HyPE position encoding. **Origin:** Tsinghua NLP, arXiv 2601.22156, 2026-01-29.

OPAL (on-policy conversion to Gated DeltaNet hybrid)

non provato

distil a full-attention teacher into a mostly-linear student on the student's own long trajectories. **Origin:** CMU / Cornell (not Chinese), arXiv 2609.31947.

MiniCPM-SALA

non provato

convert a pretrained Transformer into a 1:3 sparse (InfLLM-V2) to linear (Lightning) hybrid with HyPE. **Origin:** OpenBMB, arXiv 2602.11761, 2026-02-12.

Ring-linear and Ling 2.5 (hybrid linear from an existing base)

non provato

initialise a linear+softmax hybrid from a Ling base then continue training; Ling 2.5 rebuilt GQA layers as 1:7 MLA plus Lightning linear attention. **Origin:** Ant Ling, arXiv 2510.19338 (2025-10-22); Ling 2.5 (2026-02-15).

Optical context compression (DeepSeek-OCR, Glyph)

non provato

render text as images and read it through a vision encoder, so fewer vision tokens carry the text. **Origin:** DeepSeek-OCR arXiv 2510.18234 (2025-10-21), OCR 2 arXiv 2601.20552; Zhipu/Tsinghua Glyph arXiv 2510.17800 (2025-10-20).

Natively trained sparse attention (MSA, LSA, QSA, HiLS, HSA)

non provato

block or chunk selection over KV trained from the start: MiniMax MSA (GQA-group top-k over 128-token blocks), LongCat LSA (DSA plus streaming-aware, cross-layer, hierarchical indexing), Qwen QSA (micro-block indexer beside Gated DeltaNet 3:1), Tencent HiLS (landmark tokens), HSA UltraLong (learnable chunk retrieval).

Natively trained linear and hybrid attention (KDA, Gated DeltaNet, Lightning)

non provato

Kimi Delta Attention (gated delta rule, per-channel forget gate, 3:1 with MLA), Qwen Gated DeltaNet (3 linear : 1 gated full), Lightning hybrids (MiniMax-M1, Ant Ling 7:1).

CSA + HCA compressed attention and the V4.1 causal encoder-decoder

non provato

compress KV along the sequence (CSA: 4 entries merged then top-k=512; HCA: 128x, dense over compressed) plus a sliding-window branch; V4.1 prefills with half the layers and decodes with all.

Zero-computation experts and shortcut-connected MoE (ScMoE)

non provato

some experts are identity so easy tokens use less compute; a shortcut overlaps communication with the dense FFN.

Stable LatentMoE

non provato

experts run in a latent dimension (3584 vs hidden 7168) with high sparsity (16 of 896 experts), normalisation on the routed branch and a Quantile Balancing router.

ConceptMoE

non provato

merge similar tokens into concepts before the MoE core.

FP8 W8A8 (weights and activations)

in programma

FP8 E4M3 weights with dynamic or static FP8 activations; the RTX 4090 (compute capability 8.9) has native FP8 tensor cores, so prefill GEMMs should speed up.

Weight-only 4-bit (QAT W4A16, AWQ, GPTQ, AutoRound, HQQ)

in programma

4-bit group-quantized weights with BF16 activations; helps memory-bound decode and fitting, not compute-bound prefill.

Per-layer mixed precision

non provato

assign 8/6/4 (or 1-2) bits per layer or module by sensitivity, keeping fragile tensors high. **Origin:** Tencent AngelSlim MIX-STQ1_0 and Sherry ternary (2026-08-29); IMPQ arXiv 2509.15455; MixQuant arXiv 2607.23047; community maglun MLX mixes.

Rotation methods (QuaRot, SpinQuant) and W4A8/W4A4

non provato

Hadamard or learned rotations remove activation outliers so activations and KV can be 4-bit.

SINQ and CCQ (calibration-free and 2-bit)

non provato

SINQ adds a second scale axis via Sinkhorn-Knopp normalisation with no calibration; Baidu CCQ uses convolutional-code codebooks for 2-bit. **Origin:** Huawei CSL SINQ, arXiv 2509.22944 (2025-09-26); Baidu CCQ, arXiv 2507.07145.

FP4 and NVFP4 (Blackwell-only paths, FP4 QAT)

non provato

4-bit float weights/activations (NVFP4, MXFP4), FP4 QAT on experts (DeepSeek V4 sec. 5.2.1), Ant UFP4 recipe (arXiv 2606.20381), Moonshot K3 MXFP4/MXFP8 QAT (2026-06-13).

AWQ int4 (Marlin) vs NVFP4 vs FP8 at batch 1 on sm120

in programma

Marlin is a fused weight-only dequant kernel that reads 4-bit weights once and computes in BF16/FP16; native NVFP4 uses FP4 tensor cores but on sm120 the kernels are less mature (W4A4 is the vLLM sm120 default since 0.30.0 and costs a few percent at batch-1 decode, PR 55170, reported).

AngelSlim toolkit

non provato

FP8/INT8 PTQ, INT4 AWQ/GPTQ, HY-1.8B-int2, EAGLE-3 training, training-free sparse attention for TTFT, vision/audio token pruning. **Origin:** Tencent Hunyuan, arXiv 2602.21233 (2026-02-07).

LM-head quantization, b12x and other sm120 paths (sweep of 2026-10-26)

non provato

Adaptive scale selection for 8-bit formats (sweep of 2026-10-26)

non provato

Four Over Six's per-block choice between scale candidates, transferred to 8-bit. The MXFP8 version

ThinkingCap: shorter thinking for Gemma 4 26B-A4B (BottleCap AI, 2026-10)

non provato

`bottlecapai/ThinkingCap-gemma-4-26B-A4B-it`, a fine-tune of the 26B-A4B (BF16, about 52 GB, Apache 2.0

REAP expert pruning of 26B-A4B

in programma

remove whole experts scored by router-weighted activation saliency on calibration data; router logits renormalised so active experts per token stay unchanged.

Vocabulary and LM-head trimming

in programma

remove tokens from the 262,144-entry vocabulary in the tied embedding/output head and, for E models, the per-layer embedding table. Google's MTP drafter already uses a top-k cluster LM head (~4k ids instead of 262k).

Layer (depth) pruning with healing

in programma

drop whole layers (ShortGPT block influence, LLM-Streamline), then heal by distillation. **Origin:** Ghosted Layers arXiv 2605.15491; Minitron arXiv 2407.14679; Hub: FlameF0X gemma-4-E2B-it-pruned (35 -> 10 layers, no quality data).

Width pruning (MLP neurons, heads) with distillation, Minitron-style

in programma

prune MLP width by activation importance, heal by KL distillation from the unpruned model. **Origin:** NVIDIA Minitron; Hub: Amiel/pruned_{0.1,0.2,0.3,0.4}-gemma-4-E4B-it (`intermediate_size` 10240 -> 9216/8192/7168/6144; 8.00B -> 7.28B params at 0.2; empty cards).

Unstructured sparsity (SparseGPT) as a pre-quantization step

non provato

10% unstructured sparsity on MLP layers before GPTQ W4A16 (salve-mundii/gemma4-E4B-opt; neokoda 10% sparse E4B).

Text-only strip and PLE offload

in programma

drop vision/audio towers (E2B/E4B 150M vision + 300M audio; 26B-A4B/31B 550M vision); keep the per-layer-embedding (PLE) table off the GPU.

MatFormer / Mix-n-Match slicing

non provato

nested sub-models sliced from one checkpoint.

Visual-token pruning and routing

non provato

prune or route image patches to fewer tokens (HiPrune; InternVL3.5 ViR routes to 256 or 64 tokens). **Origin:** HiPrune (overshootai post); Shanghai AI Lab InternVL3.5, arXiv 2508.18265.

Gemma 4 MTP assistant drafters (Google)

in programma

paired `-assistant` models (E4B: 4 layers, KV-shared) that draft tokens for the target; the report says the drafter cross-attends into target KV with a 4096-token cluster head.

DSpark (parallel block drafter with confidence-scheduled verification)

in programma

a parallel block drafter plus a light sequential (Markov) head; calibrated survival probabilities pick the verified prefix length per request from engine throughput.

DFlash (block-diffusion drafter)

in programma

a block-diffusion drafter conditioned on target hidden features proposes a whole block in one forward pass. **Origin:** z-lab (UCSD), arXiv 2602.06036 (2026-02-05); DeepSpec credits z-lab/dflash, so it is not DeepSeek's method (resolved in the Chinese merge note).

DCOCO (contextual correction of DFlash drafts)

non provato

keeps the top-k candidates per position of a DFlash block, scores neighbouring-candidate compatibility

EAGLE-3 (feature-level drafter, SpecForge, speculators)

in programma

a draft head fed early, middle and late target features, trained with training-time test. **Origin:** EAGLE authors (PKU / Waterloo / Microsoft, reported), arXiv 2503.01840; code adapted in SpecForge (SGLang) and DeepSpec.

Newer parallel drafters (DSpine, UBTree, Domino, JetSpec, ECHO)

non provato

DSpine injects each predecessor's predicted feature into its successor at every draft layer; UBTree builds a verification tree from a DFlash backbone; Domino adds a prefix-aware head; JetSpec builds draft trees in one pass; ECHO schedules draft depth versus width batch-wide.

Self-speculative decoding by layer skipping (LayerSkip, SWIFT, Kangaroo)

in programma

early layers draft and the full model verifies; SWIFT chooses skipped layers on the fly with no training.

MTP heads as built-in drafters (MiMo, GLM-5, Step)

non provato

multi-token-prediction heads trained with the model double as drafters.

Uno self-drafting adapters and n-gram lookup decoding

non provato

adapters make a model draft for itself (Broadnet Uno pilot adapter); n-gram/lookup decoding copies spans from the prompt.

Drafters for Gemma 4 26B-A4B at batch 1 (mixed results from other cards)

in programma

four drafters exist for exactly this model: Google's MTP assistant `google/gemma-4-26B-A4B-it-assistant` (Apache-2.0), z-lab `gemma-4-26B-A4B-it-DFlash`, DSpark (`systalyze/gemma4-26b-a4b-it-dspark`, `makora-ai/gemma4-26b-a4b-dspark`), and the Uno adapter (BroadNet). Details of each: [Gemma 4 MTP assistant drafters (Google)](#gemma-4-mtp-assistant-drafters-google), [DFlash (block-diffusion drafter)](#dflash-block-diffusion-drafter), [DSpark (parallel block drafter with confidence-scheduled verification)](#dspark-parallel-block-drafter-with-confidence-scheduled-verification), [Uno self-drafting adapters and n-gram lookup decoding](#uno-self-drafting-adapters-and-n-gram-lookup-decoding).

MoE-aware verification (AcceptMoE, SpecFit)

non provato

in a MoE, every extra verified token can route to experts no other token in the step uses, so verify cost grows with the union of experts touched. AcceptMoE restricts each verify block to a self-sized expert subset chosen from router scores and offline commitment probabilities (**changes the output distribution**). SpecFit picks the verified subtree by predicted throughput: draft-path reward over a cost that grows with the per-layer expert union (lossless).

AR-to-diffusion conversion (DiffusionGemma, SDAR, LLaDA2.0)

non provato

convert a trained AR model into a (block) diffusion LM that decodes about 20 tokens per forward pass.

Gemma 4 configuration facts (31B and 26B-A4B)

non provato

Draft-vocabulary trimming for drafters (VocabTrim, SpecVocab, SlimSpec, DynaSpec)

in programma

restrict the drafter's output matrix to a frequency-ranked or coverage-optimised subset of the 262,144-token vocabulary, or choose a subset per step; the target still verifies every token, so output is lossless and no healing is needed.

Post-trained MTP heads on a frozen model (repairing a drafter)

in programma

chained multi-token-prediction heads trained with plain cross-entropy on a frozen backbone; self-distillation (MTP-D) raises head acceptance; the heads cross-attend the frozen model's KV.

Dynamic expert re-routing and skipping on MoE (SERE, ZEDA, ACE)

in programma

SERE re-routes secondary experts to similar primary ones to cut expert traffic per batch; ZEDA inserts zero-output experts and self-distills so easy tokens use fewer experts; ACE and ASET/MoDES skip experts training-free.

Fewer experts without the gain shift: top-k1 normalized by the top-k2 mass, and where the cut hurts

non provato

a router that renormalizes over its kept experts calibrates the expert branch's gain to the training top-k; cutting k

Training-free FFN activation sparsity (TEAL, Prox, TopK-Guided)

non provato

skip weight reads for FFN channels that are barely active for the current token; Prox picks channels with an INT4 copy of the gate projection, then computes them exactly.

Semi-structured sparsity (2:4 and 6:8)

non provato

prune weights in a hardware pattern (2 of 4, or 6 of 8 slid onto 2:4 hardware) and heal by distillation.

Dynamic depth: layer-skipping routers and retrofitted recurrence

non provato

small routers on a frozen model skip, execute or repeat each layer per token or example; retrofitted recurrence turns a trained model into a looped one.

Looped, recursive and layer-shared retrofits of pretrained models (2026-11-21 sweep)

non provato

tie a trained model's layers into a block applied k times (Relaxed Recursive Transformers adds a per-depth LoRA initialised from the residual by SVD), or insert a looped block into a trained model and heal it; speed comes only from methods that run several positions at different loop depths in one call, so one weight read serves them (WaveFront Decoding, LoopSpec, Parallel Loop Transformer).

Dynamic Memory Sparsification (learned KV eviction)

non provato

a learned, delayed eviction policy (Gumbel-sigmoid) retrofits an existing model to keep a fraction of its KV cache.

Low-rank (SVD) weight factorization

non provato

replace a weight matrix by two thinner factors, optionally with rank allocation or prompt-aware rank routing.

Dense-to-MoE conversion

non provato

split a trained dense FFN into experts by activation patterns, with a short fine-tune.

Extreme low-bit and ternary conversion (BitDistill, Bonsai, LittleBit)

non provato

convert a trained model to ternary or sub-1-bit weights with distillation: BitDistill adds SubLN, attention distillation and a continual-pretraining warm-up; PT2-LLM is post-training ternarisation; LittleBit factorises weights into binarised low-rank latents.

Normalization folding and removal (TaperNorm)

non provato

fold a norm's scale into the next projection (an exact rewrite) or remove the normalisation during fine-tuning, so fewer small kernels run per layer.

Jacobi Forcing (self-trained parallel decoding)

non provato

fine-tune the model on its own Jacobi-iteration trajectories so it converges to several correct tokens per forward pass, with no draft model.

Manifold-constrained hyper-connections (mHC)

non provato

Attention Residuals (AttnRes, Block AttnRes) and Gated Residual

non provato

Gated attention (sigmoid gate after SDPA)

non provato

Engram conditional memory and N-gram embeddings

non provato

PowLU activation and low-precision pretraining recipes

non provato

Looped LMs, elastic training, native diffusion LMs, Multi-Matrix Factorization Attention

non provato

Weight-Space Programming (direct weight edits by a frontier model)

non provato

a general-purpose LLM reads weights in a Python kernel and edits them by reasoning, with no gradients; on a language model it traces a failure to a direction written by MLP layers and subtracts it from their output columns.

CompressionBench (coding agents compress checkpoints under a storage limit)

non provato

an agent gets a checkpoint, a storage limit, a GPU and 8 hours, and builds weights and kernels; perplexity on source-sampled continuations guides it; a separate check gates on 150 questions.

Retrofitted latent MoE (MoLAE, GS-MoE) and per-token expert skipping (ACE)

non provato

MoLAE (arXiv 2503.23100) factors pretrained experts through a shared projection; GS-MoE (arXiv 2610.32009) shares subspaces by group with no training. ACE (arXiv 2609.05228, code xzktx003/moe-prune) skips top-k slots per token from offline expert scores, always keeping the top expert.

Mechanistic intervention: code layers grown during training (doubleAI)

non provato

an agent inside a training run inserts small programs as layers behind a learnable gate starting at zero, chosen with the phantom gradient (gradient of the loss with respect to the hidden state, per token and layer, centred per next token), with twin and sham controls. On trained models it adds linear probes that drive resampling or a stop policy.

Group-scaled 4-bit codes barely compress

non provato
15Training

INT4 QAT folded into post-training (Kimi K2-Thinking recipe)

in programma

fake-quant QDQ with straight-through estimator on BF16 masters, symmetric INT4, 1x32 groups, W4A16, run during post-training so the released model is the quantized one.

Recovering a pruned or cut model: self-data distillation, data choice, inversion

non provato

the unpruned model writes the fine-tuning data, so the student stays in the distribution it came from. Input inversion instead optimizes inputs to match stored activation statistics, for people with no data at all.

On-policy distillation, single and multi-teacher (MOPD)

in programma

the student samples its own rollouts and trains on token-level reverse KL to one or several teachers; Xiaomi MOPD trains per-domain RL teachers from one SFT checkpoint, routes rollouts to the matching teacher, and uses top-k reverse KL with a bias-correction term.

When on-policy distillation works (conditions and failure modes)

in programma

OPD needs compatible thinking patterns between teacher and student and a teacher that adds new capability; fixes are an off-policy cold start and teacher-aligned prompt selection.

RL algorithms for stability: GSPO, SAPO, CISPO, DAPO, IcePop/KPop, geometric masking, FlowRL, Knapsack RL

non provato

drop-in policy-gradient variants: GSPO (sequence-level importance ratio), SAPO (soft gate), CISPO (clip importance weights), DAPO (decoupled clip, dynamic sampling), IcePop/KPop (mask train/infer mismatch), geometric masking, FlowRL (match reward distribution), Knapsack RL (rollout allocation).

Rollout Routing Replay (R3)

non provato

record the inference engine's expert choices and replay them in the training forward pass.

Muon, MuonClip and optimizer choice for fine-tuning

non provato

matrix-orthogonalising optimizer; MuonClip rescales exploding QK logits after each update. **Origin:** Moonshot (arXiv 2502.16982, 2025-02-24; Kimi K2); used by GLM-5 and DeepSeek V4.

Post-training recipes and data selection (capability-per-token, OPUS)

non provato

Ant Ling/Ring 2.6 uses evolutionary CoT, Linguistic Unit Policy Optimization and shortest-correct-response distillation; OPUS selects training examples by projected update under the actual optimizer.

RL and training systems (Seer, QwenGyre, slime, checkpoint-engine, batch-size laws)

non provato

faster rollouts (Seer), elastic rollout/training GPU split (QwenGyre), SGLang-native RL (slime), fast weight broadcast (checkpoint-engine), RL and WSD batch-size laws (Tencent, InternLM).

On-policy distillation as the healing step after pruning

in programma

the pruned or converted student samples its own rollouts and trains on per-token reverse KL to the unmodified model; ReCal chooses calibration data before pruning so this step can heal reasoning; GOLD extends it across tokenizers.

LOOP: progressive depth pruning with short on-policy distillation

in programma

score each candidate layer by how recoverable it is (not only by importance), remove one layer, run a short on-policy distillation, repeat.

ShortOPD (short-to-long rollouts for pruned models)

in programma

pruned models collapse on free-form generation through repetitive suffixes that plain recovery recipes miss; training on the pruned model's own rollouts with token-level teacher supervision, starting short and growing the horizon, cuts them.

Quantization-aware distillation (NVFP4 QAD)

in programma

quantise to NVFP4, then train with KL to a frozen BF16 teacher so accuracy returns to close to BF16 where plain QAT or PTQ fall short.

Closed-form layer bridges after depth pruning (SHIFT-LLM, Ghosted Layers, Prune&Comp)

in programma

a training-free least-squares linear adapter at each pruning site (mergeable across consecutive pruned layers) or a rescaling of the remaining weights closes the hidden-state gap; minutes of calibration, optionally followed by on-policy distillation.

Healing budgets and how to measure recovery

non provato

a reference of what healing has cost in published work and how to judge whether it worked.

1Workload

Structured-output hidden costs

non provato

a second prefill or hidden reasoning tokens inflate short JSON replies (Ollama ran thinking models in two passes until 2026-09-23; LM Studio e4b/12b emit `reasoning_content` with thinking off).

8Measurement

Benchmark hygiene for TTFT comparisons

in programma

published TTFT numbers are distorted by cold JIT and autotune warm-up, prefix-cache contamination, differing "prompt tok/s" definitions and single runs. Control each before comparing engines or kernels (merge note: it distorts many published numbers; reported).

Experiment protocol: pre-registration, paired timing, a same-versus-same noise floor

non provato

timing on a shared or rented machine drifts between runs (other work on the Mac, swap, a different

Speculative speedups depend on concurrency and on the draft's own cost

non provato

speedup = AL / (1 + Ω), where AL is the tokens committed per target pass and Ω the draft's cost as a fraction of the target's time. At one request the GPU is memory-bound with spare compute, so drafting is nearly free; as the server fills, each draft cycle is taken from the batch it accelerates, Ω rises and the speedup falls toward 1. Accept rate (accepted over drafted) is the depth-independent acceptance measure; AL at different k is not comparable.

The guardrail's perplexity, scored without `<bos>`, ranks bf16 E4B worse than its 4-bit QAT build

non provato

The official E4B QAT build disagrees with bf16 on the next token for 30% of the KL prompts

non provato

Host-to-host spread exceeds the baseline noise: one run per experiment produced a false win

non provato

vLLM 0.32 takes 19 to 26 minutes to start E4B on a fresh RTX PRO 4500 pod

non provato

Where a 28-minute 26B-A4B speed run spends its time, and what waiting can be removed

non provato

Vuoi vedere cosa hanno prodotto questi esperimenti? Lesto, il motore di inferenza per Gemma 4 sui Mac con Apple silicon, è su lestoengine.com

Creato da Federico Andrioli, @fedeandri su X Le misure di un laboratorio di ricerca, ricavate direttamente dai suoi file. Dati aggiornati al