Skip to content

Commit

Permalink
Fix real_quant zp bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gushiqiao authored and llmc-reviewer committed Aug 26, 2024
1 parent ab39329 commit 71b6a58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llmc/compression/quantization/quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def real_quant_weight_static(self, weight, args):
else:
dtype = torch.int32
weight = weight.to(dtype)
if zeros != torch.tensor(0.0) and self.round_zp:
if (zeros != torch.tensor(0.0)).all() and self.round_zp:
zeros = zeros.to(dtype)
else:
zeros = None
Expand All @@ -454,7 +454,7 @@ def real_quant_weight_dynamic(self, weight, args={}):
else:
dtype = torch.int32
weight = weight.to(dtype)
if zeros != torch.tensor(0.0) and self.round_zp:
if (zeros != torch.tensor(0.0)).all() and self.round_zp:
zeros = zeros.to(dtype)
else:
zeros = None
Expand Down

0 comments on commit 71b6a58

Please sign in to comment.