Skip to content

Commit 18bdbdd

Browse files
gushiqiaogushiqiao
andauthored
Dev fix (#282)
* Fix omniq clip bugs * Fix omniq clip bugs * Fix awq trans_v1 gqa bug --------- Co-authored-by: gushiqiao <[email protected]>
1 parent 79117ec commit 18bdbdd

File tree

1 file changed

+2
-2
lines changed
  • llmc/compression/quantization

1 file changed

+2
-2
lines changed

llmc/compression/quantization/awq.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ def get_scales(self, prev_op, x, w_max, is_gqa, ratio):
8080

8181
x_tmp = self.get_act_scale(x_tmp)
8282

83-
if self.trans_version == 'v1':
83+
if self.trans_version == 'v1' and not is_gqa:
8484
scales = (
8585
(x_tmp.pow(ratio) / w_tmp.pow(1 - ratio))
8686
.clamp(min=1e-4)
8787
.view(-1)
8888
)
89-
elif self.trans_version == 'v2':
89+
elif self.trans_version == 'v2' or is_gqa:
9090
scales = x_tmp.pow(ratio).clamp(min=1e-4).view(-1)
9191

9292
scales = scales / (scales.max() * scales.min()).sqrt()

0 commit comments

Comments
 (0)