Group sizes (D_FFN / 96): 64 in early layers (D_FFN=6144), 128 in late layers
(D_FFN=12288). 64-element groups in bf16 = exactly 128B = one L2 cache line on
NVIDIA GPUs — memory-bandwidth-aligned routing.
1git lfs install
2git clone https://huggingface.co/Cactus-Compute/gemma4-e2b-grouped-k96
3cd $(basename Cactus-Compute/gemma4-e2b-grouped-k96)
4pip install torch transformers
5python inference_k96.py --prompt "The capital of France is"
The inference script loads the base Gemma-4 weights from HuggingFace, installs
the grouped routing wrappers (loading cluster assignments from groups/), then
applies int4 QAT + LoRA + the trained state dict. verify_grouped_routing()
asserts every layer is genuinely a GroupedMaskedMLP with K=96 before generation.
Internal research (Anthropic Claude + Noah Cylich, Cactus Compute), 2026-04.