Post
51
🚀 omk-model-optimizer — our fork of NVIDIA Model-Optimizer, retargeted at GGUF: everything it trains or rounds ships as a file for stock llama.cpp and ollama. K-FAC rounding with up to -41% KL / top-1
🧠 One trainer, three modes:
• QAD: every quantized weight trains as an fp16 latent, served fake-quantized in the exact GGUF type and block order llama.cpp reads (IQ1–IQ4, K-quants, Q8_0), distilled on the teacher's top-K. Qwen3.5-4B IQ2_XXS: HumanEval 38.4 vs 10.4 stock.
• Ternary recovery to PrismML PQ2_0 / PTQ1_0: plain ternary Qwen3.5-4B starts at KL 8.0, QAD brings it to 0.46.
• BF16 recovery: trains the model's own weights against a teacher (our Gemma-4 agentic SFTs).
📐 K-FAC rounding: llama-quantize weighs rounding error by the imatrix, a diagonal input-only view. We collect each expert's curvature H ≈ G ⊗ A and re-round the MLP tensors with GPTQ-style error feedback through the real llama.cpp encoders. Same layout, types, size and metadata: only MLP payload bytes change.
⚙️ CUDA encoders ported from ggml-quants.c, IQ2/IQ3/IQ4 + Q8_0 and now Q2_K–Q6_K + Q4_0/Q4_1/Q5_0/Q5_1, byte-identical to libggml.
🔁 Pipeline: stock llama-quantize tier + imatrix (20B: AtomicChat corpus; 26B: its training corpus; both combined: −4% KL at IQ3_XXS) → K-FAC re-rounds it → at IQ2_XXS the K-FAC rounding seeds the QAD instead of round-to-nearest.
📊 Gemma-4-26B-A4B-agentic, top-256 KL / top-1, same file size, stock → K-FAC:
Q6_K 0.00280/98.81% → 0.00259/98.87% (−7.5%)
Q4_K_M 0.00798/97.96% → 0.00660/98.15% (−17%)
IQ4_XS 0.0153/97.15% → 0.0116/97.51% (−24%)
Q3_K_M 0.0366/95.64% → 0.0217/96.64% (−41%)
IQ2_XXS 0.0675/93.92% RTN → 0.0485/94.96% seeded QAD (−28%); unseeded QAD stalls at 0.062
20B v9-agentic: −6% (Q6_K) to −37% (Q3_K_M).
🔗 K-FAC write-up, both ladders: https://github.com/mann1x/omk-model-optimizer/blob/omk-main/omk/docs/kfac-rounding.md
🔗 https://github.com/mann1x/omk-model-optimizer
🔗 ManniX-ITA/gemma-4-26B-A4B-agentic-GGUF
🧠 One trainer, three modes:
• QAD: every quantized weight trains as an fp16 latent, served fake-quantized in the exact GGUF type and block order llama.cpp reads (IQ1–IQ4, K-quants, Q8_0), distilled on the teacher's top-K. Qwen3.5-4B IQ2_XXS: HumanEval 38.4 vs 10.4 stock.
• Ternary recovery to PrismML PQ2_0 / PTQ1_0: plain ternary Qwen3.5-4B starts at KL 8.0, QAD brings it to 0.46.
• BF16 recovery: trains the model's own weights against a teacher (our Gemma-4 agentic SFTs).
📐 K-FAC rounding: llama-quantize weighs rounding error by the imatrix, a diagonal input-only view. We collect each expert's curvature H ≈ G ⊗ A and re-round the MLP tensors with GPTQ-style error feedback through the real llama.cpp encoders. Same layout, types, size and metadata: only MLP payload bytes change.
⚙️ CUDA encoders ported from ggml-quants.c, IQ2/IQ3/IQ4 + Q8_0 and now Q2_K–Q6_K + Q4_0/Q4_1/Q5_0/Q5_1, byte-identical to libggml.
🔁 Pipeline: stock llama-quantize tier + imatrix (20B: AtomicChat corpus; 26B: its training corpus; both combined: −4% KL at IQ3_XXS) → K-FAC re-rounds it → at IQ2_XXS the K-FAC rounding seeds the QAD instead of round-to-nearest.
📊 Gemma-4-26B-A4B-agentic, top-256 KL / top-1, same file size, stock → K-FAC:
Q6_K 0.00280/98.81% → 0.00259/98.87% (−7.5%)
Q4_K_M 0.00798/97.96% → 0.00660/98.15% (−17%)
IQ4_XS 0.0153/97.15% → 0.0116/97.51% (−24%)
Q3_K_M 0.0366/95.64% → 0.0217/96.64% (−41%)
IQ2_XXS 0.0675/93.92% RTN → 0.0485/94.96% seeded QAD (−28%); unseeded QAD stalls at 0.062
20B v9-agentic: −6% (Q6_K) to −37% (Q3_K_M).
🔗 K-FAC write-up, both ladders: https://github.com/mann1x/omk-model-optimizer/blob/omk-main/omk/docs/kfac-rounding.md
🔗 https://github.com/mann1x/omk-model-optimizer
🔗 ManniX-ITA/gemma-4-26B-A4B-agentic-GGUF