Cornell-RelaxML/QuIP

error computing is not correct of covariant of pre and post process

Opened this issue · 1 comments

ozzzp commented

If I understand correctly, The pre and post process should be covariant, ie, the norm $tr(W H W^\top)$ should be invariance if we ignore the quantization error. but it seens that the error_compute method is not corrent to match this property:

https://github.com/jerry-chee/QuIP/blob/361ff4941d508d34b7631b88161315a51e9b5091/bal.py#L44-L48

Here, w is pre-processed but not post-processed, but quant_w and $H$ in the norm $tr(W H W^\top)$ seens that it is both pre-processed and post-processed therefore breaks the covariant.

Yes thanks for pointing that out. We'll post a correction in the next update, but one fix could be to save w before any processing, and then compute (w - quant_w) H (w - quant_w).

Please let me know if that answers your question.