Skip to content

feat: implement advanced calibration algorithms (SmoothQuant, AWQ, GPTQ) - #4

Merged
Prajwal7-2002 merged 1 commit into
mainfrom
feature/calibration-algorithms
Oct 26, 2026
Merged

Prajwal7-2002 merged 1 commit into
mainfrom
feature/calibration-algorithms

Conversation

@Prajwal7-2002

Copy link
Copy Markdown
Owner

Summary

  • Introduces \quantbench.quant.algorithms\ with from-scratch implementations of standard post-training calibration algorithms:
    • SmoothQuant: Profiles activation outlier channels ($) and migrates dynamic range to weights via = (X \cdot \text{diag}(s)^{-1}) \cdot (\text{diag}(s) \cdot W)$ with balanced scale factor $\alpha=0.5$.
    • AWQ: Computes per-channel mean absolute activation magnitude and performs grid search over protection scale = s_X^\alpha$ to minimize Frobenius reconstruction error $| W X - \hat{W} X |_F^2$ without requiring slow FP16 outlier storage.
    • GPTQ: Second-order Taylor/Hessian error compensation ( = 2 X X^T$) with diagonal damping regularization, Cholesky decomposition inversion (^{-1} = L^{-T} L^{-1}$), Optimal Brain Surgeon (OBS) coordinate updates, and vectorized block GEMM updates.
  • Adds 8 comprehensive test suites in \ ests/test_algorithms.py\ verifying continuous mathematical invariance, AWQ reconstruction error reduction, Hessian positive semi-definiteness, and OBS error compensation.
  • Maintains 93% line test coverage across 39 unit tests.

Add SmoothQuant activation outlier migration, AWQ salient channel protection grid search, and GPTQ second-order Hessian error compensation with Cholesky inversion and block updates.
@Prajwal7-2002
Prajwal7-2002 merged commit 4710be2 into main Oct 26, 2026
7 checks passed
@Prajwal7-2002
Prajwal7-2002 deleted the feature/calibration-algorithms branch October 26, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant