IST-DASLab / gptq

Code for the ICLR 2023 paper "GPTQ: Accurate Post-training Quantization of Generative Pretrained Transformers".
https://arxiv.org/abs/2210.17323
Apache License 2.0
1.81k stars 145 forks source link

About the cuda code, I think "tmp2 >> 30" should be " tmp2 >> 31" #43

Closed JachinJiang closed 10 months ago

JachinJiang commented 10 months ago

tmp = (tmp2 >> 30) | ((tmp1 << 1) & 0x6);

to construct a 3-bit number, tmp1 contributes 2bit, why tmp2 also contributes 2bit? I'm confused.

efrantar commented 10 months ago

Hi, tmp2 was already shifted by one before in this line and thus only contributes 1 bit in this expression.

JachinJiang commented 10 months ago

oh, my fault, I'll close this issue, thank you.