diff --git a/compiler/include/concretelang/Support/Constants.h b/compiler/include/concretelang/Support/Constants.h index e1f24c2f9..24eb4d624 100644 --- a/compiler/include/concretelang/Support/Constants.h +++ b/compiler/include/concretelang/Support/Constants.h @@ -9,7 +9,6 @@ namespace mlir { namespace concretelang { constexpr unsigned DEFAULT_PATTERN_BENEFIT = 1; -constexpr unsigned MAXIMUM_BIT_WIDTH = 7; } // namespace concretelang } // namespace mlir diff --git a/compiler/lib/Bindings/Python/ConcretelangModule.cpp b/compiler/lib/Bindings/Python/ConcretelangModule.cpp index 3a194d1f2..681fa5f9e 100644 --- a/compiler/lib/Bindings/Python/ConcretelangModule.cpp +++ b/compiler/lib/Bindings/Python/ConcretelangModule.cpp @@ -24,9 +24,6 @@ PYBIND11_MODULE(_concretelang, m) { llvm::sys::PrintStackTraceOnErrorSignal(/*argv=*/""); LLVMEnablePrettyStackTrace(); - m.attr("MAXIMUM_BIT_WIDTH") = - pybind11::int_(mlir::concretelang::MAXIMUM_BIT_WIDTH); - m.def( "register_dialects", [](py::object capsule) { diff --git a/compiler/lib/Dialect/FHE/IR/FHEDialect.cpp b/compiler/lib/Dialect/FHE/IR/FHEDialect.cpp index ca8efa73f..dfbddfbd6 100644 --- a/compiler/lib/Dialect/FHE/IR/FHEDialect.cpp +++ b/compiler/lib/Dialect/FHE/IR/FHEDialect.cpp @@ -53,9 +53,8 @@ void FHEDialect::printType(::mlir::Type type, mlir::LogicalResult EncryptedIntegerType::verify( llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, unsigned p) { - if (p == 0 || p > mlir::concretelang::MAXIMUM_BIT_WIDTH) { - emitError() << "FHE.eint support only precision in ]0;" - << mlir::concretelang::MAXIMUM_BIT_WIDTH << "]"; + if (p == 0) { + emitError() << "FHE.eint didn't support precision equals to 0"; return mlir::failure(); } return mlir::success(); diff --git a/compiler/lib/Dialect/TFHE/IR/TFHEDialect.cpp b/compiler/lib/Dialect/TFHE/IR/TFHEDialect.cpp index 53a7ad74e..9f13ebb0e 100644 --- a/compiler/lib/Dialect/TFHE/IR/TFHEDialect.cpp +++ b/compiler/lib/Dialect/TFHE/IR/TFHEDialect.cpp @@ -49,7 +49,6 @@ void TFHEDialect::printType(::mlir::Type type, /// Verify that GLWE parameter are consistant /// - The bits parameter is 64 (we support only this for v0) -/// - The p parameter is ]0;MAXIMUM_BIT_WIDTH] ::mlir::LogicalResult GLWECipherTextType::verify( ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, signed dimension, signed polynomialSize, signed bits, signed p) { @@ -57,9 +56,8 @@ void TFHEDialect::printType(::mlir::Type type, emitError() << "GLWE bits parameter can only be 64"; return ::mlir::failure(); } - if (p == 0 || p > (signed)mlir::concretelang::MAXIMUM_BIT_WIDTH) { - emitError() << "GLWE p parameter can only be in ]0;" - << mlir::concretelang::MAXIMUM_BIT_WIDTH << "]"; + if (p == 0) { + emitError() << "GLWE p parameter must be positive"; return mlir::failure(); } return ::mlir::success(); diff --git a/compiler/tests/Dialect/FHE/FHE/eint_error_p_too_big.mlir b/compiler/tests/Dialect/FHE/FHE/eint_error_p_too_big.mlir index c5002b90f..4470c33c4 100644 --- a/compiler/tests/Dialect/FHE/FHE/eint_error_p_too_big.mlir +++ b/compiler/tests/Dialect/FHE/FHE/eint_error_p_too_big.mlir @@ -1,6 +1,6 @@ -// RUN: not concretecompiler --action=roundtrip %s 2>&1| FileCheck %s +// RUN: not concretecompiler --action=dump-llvm-ir %s 2>&1| FileCheck %s -// CHECK-LABEL: eint support only precision in ]0;7] -func @test(%arg0: !FHE.eint<8>) { +// CHECK-LABEL: Could not determine V0 parameters +func @test(%arg0: !FHE.eint<9>) { return } diff --git a/compiler/tests/Dialect/FHE/FHE/eint_error_p_too_small.mlir b/compiler/tests/Dialect/FHE/FHE/eint_error_p_too_small.mlir index fd694ed5e..1089ac274 100644 --- a/compiler/tests/Dialect/FHE/FHE/eint_error_p_too_small.mlir +++ b/compiler/tests/Dialect/FHE/FHE/eint_error_p_too_small.mlir @@ -1,6 +1,6 @@ // RUN: not concretecompiler --action=roundtrip %s 2>&1| FileCheck %s -// CHECK-LABEL: eint support only precision in ]0;7] +// CHECK-LABEL: FHE.eint didn't support precision equals to 0 func @test(%arg0: !FHE.eint<0>) { return } diff --git a/compiler/tests/python/test_fhe_dialect.py b/compiler/tests/python/test_fhe_dialect.py index 2f2c6e829..5d1b97f37 100644 --- a/compiler/tests/python/test_fhe_dialect.py +++ b/compiler/tests/python/test_fhe_dialect.py @@ -1,13 +1,9 @@ import pytest from mlir.ir import Context, RankedTensorType, Location -from concrete.lang import register_dialects, MAXIMUM_BIT_WIDTH +from concrete.lang import register_dialects from concrete.lang.dialects import fhe -def test_constants(): - assert MAXIMUM_BIT_WIDTH == 7 - - @pytest.mark.parametrize("width", list(range(1, 8))) def test_eint(width): ctx = Context() @@ -27,7 +23,7 @@ def test_eint_tensor(shape): ) -@pytest.mark.parametrize("width", [0, 8, 10, 12]) +@pytest.mark.parametrize("width", [0]) def test_invalid_eint(width): ctx = Context() register_dialects(ctx)