From b8a91cac62f06be8dbd08bd717ae58d20825b979 Mon Sep 17 00:00:00 2001 From: Umut Date: Thu, 8 Sep 2022 10:56:46 +0300 Subject: [PATCH] chore: ease signed integer restriction on high bit-widths --- concrete/numpy/mlir/graph_converter.py | 6 ------ tests/mlir/test_graph_converter.py | 17 ----------------- 2 files changed, 23 deletions(-) diff --git a/concrete/numpy/mlir/graph_converter.py b/concrete/numpy/mlir/graph_converter.py index ca6ce5d71..50adbf0dd 100644 --- a/concrete/numpy/mlir/graph_converter.py +++ b/concrete/numpy/mlir/graph_converter.py @@ -246,12 +246,6 @@ class GraphConverter: f"up to {MAXIMUM_TLU_BIT_WIDTH}-bit integers" ] - if first_signed_node is not None and max_bit_width > MAXIMUM_TLU_BIT_WIDTH: - offending_nodes[first_signed_node] = [ - f"signed values are only supported on circuits with " - f"up to {MAXIMUM_TLU_BIT_WIDTH}-bit integers" - ] - if len(offending_nodes) != 0: raise RuntimeError( "Function you are trying to compile cannot be converted to MLIR:\n\n" diff --git a/tests/mlir/test_graph_converter.py b/tests/mlir/test_graph_converter.py index e63c1c03b..289fd62bb 100644 --- a/tests/mlir/test_graph_converter.py +++ b/tests/mlir/test_graph_converter.py @@ -426,23 +426,6 @@ Subgraphs: %5 = astype(%4, dtype=int_) # EncryptedScalar return %5 - """, # noqa: E501 - ), - pytest.param( - lambda x: x - 300, - {"x": "encrypted"}, - range(200), - RuntimeError, - """ - -Function you are trying to compile cannot be converted to MLIR: - -%0 = x # EncryptedScalar -%1 = 300 # ClearScalar -%2 = subtract(%0, %1) # EncryptedScalar -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ signed values are only supported on circuits with up to 8-bit integers -return %2 - """, # noqa: E501 ), ],