Commit 4af45b9
committed
fix(qlinear): size GPTQ buffers by bits/pack_dtype_bits instead of pack_factor or 32
The number of packed words is ceil(dim * bits / pack_dtype_bits), not ceil(dim / pack_factor).
- In _register_gptq_buffers, use in_features*bits/pack_dtype_bits and out_features*bits/pack_dtype_bits for qweight/qzeros rows/cols.
- In pack_original, use dim*bits/pack_dtype_bits for both qweight and qzeros.
This is equivalent to the previous pack_factor formula for 2/4/8-bit, and correct for 3-bit and non-32-bit pack dtypes (int8/int16).1 parent 7c3d80c commit 4af45b9
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
750 | 750 | | |
751 | 751 | | |
752 | 752 | | |
753 | | - | |
| 753 | + | |
754 | 754 | | |
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
760 | | - | |
| 760 | + | |
761 | 761 | | |
762 | 762 | | |
763 | 763 | | |
| |||
1395 | 1395 | | |
1396 | 1396 | | |
1397 | 1397 | | |
1398 | | - | |
| 1398 | + | |
1399 | 1399 | | |
1400 | 1400 | | |
1401 | 1401 | | |
| |||
1428 | 1428 | | |
1429 | 1429 | | |
1430 | 1430 | | |
1431 | | - | |
| 1431 | + | |
1432 | 1432 | | |
1433 | 1433 | | |
1434 | 1434 | | |
| |||
0 commit comments