<< All versions

Skill v1.0.0

currentAutomated scan100/100
alizainx/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}$) using group_size = 128.

2. Fast-Pass Low-Token Protocol (Web & Coding Agents)

  • Keep embedding layers, final lm_head, RMSNorm weights, and MoE router gates in BF16/FP16 while quantizing linear projection blocks (q, k, v, o, gate, up, down).

3. Zero-Bug & Zero-Vulnerability Guards

  1. Check for zero-range constant tensors (w_max == w_min): set scale = 1.0 and zero_point = 0 so division by (w_max - w_min) never produces NaN or Inf.
  2. Clamp quantized integers strictly to $[q_{\min}, q_{\max}]$ ([-128, 127] for signed INT8, [0, 15] or [-8, 7] for INT4) after round(x / scale) + zp.
  3. Pack 8 INT4 weights into a single uint32 word with Tensor-Core-interleaved bit ordering (Marlin / LUT layout) for single-instruction lop3 register unpacking.
  4. Calibrate activation/Hessian statistics on 128-512 diverse, domain-representative sequences without any test-set contamination.
  5. Gate quantized checkpoints on WikiText-2 / domain perplexity degradation (Delta PPL < 0.15 for INT4, < 0.03 for FP8/INT8) and KL-divergence bounds.

4. Verification Gate

  • python3 -c 'import numpy as np; ...'
All versions