facebookresearch / facebookresearch/SpinQuant

A question regarding the rotation matching pairs

Open
#7 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
428
Forks
93
PR merge metrics
No merged PRs in 30d

Description

SpinQuant is a subsequent work to QuaRot. However, we have noticed that the definitions of the rotation matrix pairing details differ between the two papers. In QuaRot, first, there is an online Hadamard operation (with a dimension of head_dim) before o_proj. Secondly, o_weight is fused with a Hadamard matrix ( H ) of the entire tensor dimension, as highlighted in the red box in the figure below.

![image](https://github.com/user-attachments/assets/74fcbecd-bcf2-40c0-b647-af8ab3187fda)

In SpinQuant, the online Hadamard operation before o_proj is removed. Additionally, o_weight is fused with a Hadamard matrix ( H, now i.e., ![image](https://github.com/user-attachments/assets/3305d1a7-b85a-4c61-92fa-a81b283af70b)) of head_dim dimension.

![image](https://github.com/user-attachments/assets/dfceb603-a8bd-4568-be65-519ab9c4617d)

Why is this the case? Are the rotation matrix pairings in the two papers equivalent?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.