Views
No views yet
coder3101/gemma-4-26B-A4B-it-heretic.| Component | Bits | Group size | Why |
|---|---|---|---|
*.mlp.gate_proj (dense) | 8 | 64 | always-on hot path, every token routes through it |
*.mlp.up_proj (dense) | 8 | 64 | same |
*.mlp.down_proj (dense) | 8 | 64 | same |
*.router.proj | 8 | 64 | routing decisions are 1×N, error compounds |
*.experts.switch_glu.* | 4 | 64 | sparse top-8 / 128, error averages out |
| Attention (q/k/v/o) | 4 | 64 | default mlx-lm |
| embed / norms | default | — | mlx-lm leaves these unquantized |
quant_predicate callback (source):1def gemma4_moe_predicate(path, _module):
2 if any(s in path for s in (".mlp.gate_proj", ".mlp.up_proj", ".mlp.down_proj")):
3 return {"group_size": 64, "bits": 8}
4 if path.endswith("router.proj"):
5 return {"group_size": 64, "bits": 8}
6 return True # base 4-bit| Metric | v0 (standard 4-bit) | v1 (mixed 4/8) | Δ |
|---|---|---|---|
| Perplexity | 156.93 ± 2.77 | 119.87 ± 2.09 | −23.6% ✅ |
| Eval time | 226 s | 184 s | −19% |
| Eval throughput (tok/s) | 579 | 710 | +23% |
allenai/tulu-3-sft-mixture, 256 samples × 512 tok = 131,072 tokens, batch 8.mlx-community/...-4bit reports PPL ~109.4 on the same eval. v1 closes the gap from 43% (v0) to 9.6% of mlx-community.| Metric | v0 | v1 | Δ |
|---|---|---|---|
| Prefill (tok/s) | 769 | 729 | −5.2% |
| Generation (tok/s) | 75.1 | 67.6 | −10% |
| Inference peak memory (GB) | 14.7 | 15.0 | +0.3 GB |
prompt_tokens=512, generation_tokens=128, batch_size=1, 5 trials averaged.| Variant | Size |
|---|---|
| Original (bf16) | ~52 GB |
| v0 (standard 4-bit) | 13 GB |
| v1 (mixed 4/8) | 14 GB |
| v0 | v1 | Verdict | |
|---|---|---|---|
| PPL | 156.93 | 119.87 | v1 +23.6% |
| Gen TPS | 75.1 | 67.6 | v0 +11% |
1from mlx_lm import load, generate
2
3model, tokenizer = load("BRlin/gemma-4-26B-A4B-it-heretic-mlx-mixed-4-8")
4response = generate(model, tokenizer, prompt="Hello", max_tokens=100, verbose=True)1mlx_lm.generate --model BRlin/gemma-4-26B-A4B-it-heretic-mlx-mixed-4-8 \
2 --prompt "Explain quantization in one paragraph." --max-tokens 200| Version | Repo | Recipe | PPL | Gen TPS | Disk | Status |
|---|---|---|---|---|---|---|
| v0 | gemma-4-26B-A4B-it-heretic-mlx-4bit | Standard 4-bit | 156.93 | 75.1 | 13 GB | baseline |
| v1 (this) | gemma-4-26B-A4B-it-heretic-mlx-mixed-4-8 | 8-bit dense MLP + router, 4-bit experts | 119.87 | 67.6 | 14 GB | recommended default |
| v2 | gemma-4-26B-A4B-it-heretic-mlx-awq-mixed-4-8 | v1 + AWQ calibration | TBD | TBD | TBD | planned |
| v3 | gemma-4-26B-A4B-it-heretic-mlx-dwq-mixed-4-8 | v1/v2 + DWQ distillation | TBD | TBD | TBD | planned |
quant_predicate API contribution to mlx-lm