Skip to content

Commit e9a81f4

Browse files
revert clamp to 1e-5
Signed-off-by: Brian Dellabetta <bdellabe@redhat.com>
1 parent 047748a commit e9a81f4

File tree

1 file changed

+1
-1
lines changed
  • src/compressed_tensors/quantization/utils

1 file changed

+1
-1
lines changed

src/compressed_tensors/quantization/utils/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def calculate_qparams(
8080
zero_points = torch.zeros(scales.shape, device=device, dtype=min_vals.dtype)
8181
else:
8282
scales = (max_vals - min_vals) / float(bit_range)
83-
scales = torch.clamp(scales, min=1e-5)
83+
scales = torch.clamp(scales, min=torch.finfo(torch.float32).eps)
8484
zero_points = bit_min - (min_vals / scales)
8585
zero_points = torch.clamp(torch.round(zero_points), bit_min, bit_max)
8686

0 commit comments

Comments
 (0)