Introduction
This is a super brief summary of SVDQUant. Please refer to the original paper if interested.
QX=round(X/sX)sX=max(∣X∣)/qmax and qmax=possible max value in repr
Q(X)=dequantization of X=sXQXXW can be approximated by
XW=Q(X)Q(W)=SXSWQXQWSVDQuant introduces two-path quantization.
Let's introduce a smoothing factor λ:
X^=Xdiag(λ)−1
Then,
XW=X^Wdiag(λ)=X^W^Use SVD to decompose W^ as
W^=L1L2+R,where L1=SΣ and L2=V
Thus,
XW=X^W^=X^L1L2+X^R
- L1 and L2 are low-rank (32 in actual implementations), preserved in 16 bits.
- Quantize X^ and R using W4A4 quantization.
This is open-sourced in Nunchaku. I'm also a maintainer of the project, responsible for Python engine–related tasks such as caching and adding new modules. In my last post, I mentioned my interest in contributing—and the chance has arrived.
Comments