<< All versions
Skill v1.0.0
currentAutomated scan100/100alizainx/intelligence-systems-skills/awq-gptq-fp8-int4-quantization
──Details
PublishedNovember 5, 2026 at 02:31 AM
Content Hashsha256:8677e34aa3143275...
Git SHA4446b059cc96
──Files
Files (1 file, 2.0 KB)
SKILL.md2.0 KBactive
SKILL.md · 27 lines · 2.0 KB
name: awq-gptq-fp8-int4-quantization id: ISS-113 token_budget: 700 chain_with: [triton-cutlass-fused-gpu-kernels, paged-attention-kv-cache-engine, lora-qlora-dora-peft-finetuning] description: "LLM weight & activation quantization (FP8 E4M3, INT8 SmoothQuant, INT4 AWQ/GPTQ group-wise asymmetric/symmetric), calibration, and Marlin dequant GEMM." metadata: version: "1.0.0"
awq-gptq-fp8-int4-quantization (ISS-113)
1. First-Principles Invariant
- Lin/Frantar Salient-Channel Preservation Law: Because
< 1%of activation channels exhibit large outlier magnitudes that dominate quantization error, scale salient weight channels by per-channel activation magnitudes ($s_j = (\bar{|X_j|})^\alpha$,AWQ) or compensate quantization residuals via inverse Hessian updates (GPTQ: $\delta_F = -\frac{w_q - quant(w_q)}{[H^{-1}]_{qq}} H_{:, q}^{-1}$) usinggroup_size = 128.
2. Fast-Pass Low-Token Protocol (Web & Coding Agents)
- Keep embedding layers, final
lm_head, RMSNorm weights, and MoE router gates inBF16/FP16while quantizing linear projection blocks (q, k, v, o, gate, up, down).
3. Zero-Bug & Zero-Vulnerability Guards
- Check for zero-range constant tensors (
w_max == w_min): setscale = 1.0andzero_point = 0so division by(w_max - w_min)never producesNaNorInf. - Clamp quantized integers strictly to $[q_{\min}, q_{\max}]$ (
[-128, 127]for signed INT8,[0, 15]or[-8, 7]for INT4) afterround(x / scale) + zp. - Pack 8
INT4weights into a singleuint32word with Tensor-Core-interleaved bit ordering (Marlin/LUTlayout) for single-instruction lop3 register unpacking. - Calibrate activation/Hessian statistics on
128-512diverse, domain-representative sequences without any test-set contamination. - Gate quantized checkpoints on WikiText-2 / domain perplexity degradation (
Delta PPL < 0.15for INT4,< 0.03for FP8/INT8) and KL-divergence bounds.
4. Verification Gate
python3 -c 'import numpy as np; ...'