Skip to content

Commit

Permalink
fix: disable overflow protection in rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-stoian-zama authored Apr 5, 2024
1 parent 4ebf5c6 commit 4db0157
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/concrete/ml/quantization/base_quantized_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,10 +1012,7 @@ def cnp_round(
if lsbs_value > 0:
# Rounding to low bit-width with approximate can cause issues with overflow protection
# FIXME: https://github.com/zama-ai/concrete-ml-internal/issues/4345
if exactness == fhe.Exactness.APPROXIMATE:
x = fhe.round_bit_pattern(
x, lsbs_to_remove=lsbs_value, exactness=exactness, overflow_protection=False
)
else:
x = fhe.round_bit_pattern(x, lsbs_to_remove=lsbs_value, exactness=exactness)
x = fhe.round_bit_pattern(
x, lsbs_to_remove=lsbs_value, exactness=exactness, overflow_protection=False
)
return x

0 comments on commit 4db0157

Please sign in to comment.