- no more Concrete ciphertext/plaintext types: they are represented using standard MLIR types (int/tensor)
- Technically BConcrete was renamed to Concrete, and old Concrete was
removed
- TFHE -> Concrete now takes into account the conversion of tensor of
ciphertext into tensors of an additional dimension (LWE dim)
- Bufferization now works in Concrete
- Old Concrete optimization were moved to TFHE
- Concrete is now the dialect that lowers to CAPI calls
- TFHE -> Concrete now uses OpConversionPattern and is much cleaner in
terms of type conversion
- Disabled tests for batching, as there was something weird about it:
batchable operations implemented in Concrete but pass run in FHELinalg
This test ensures that at least one parallel region is generated for
an FHELinalg operation that is guaranteed to result in a parallel loop
when `concretecompiler` is invoked with `--parallelize`.
The switch to reinstantiating conversion patterns for the conversion
from FHE to TFHE in commit 73fd6c5fe7
caused all attributes of `scf.for` operations to be dropped during the
conversion. This included the custom attribute `parallel`, which is
exploited further down the compilation pipeline to generate parallel
code. As a result, the performance of end-to-end benchmarks dropped
significantly.
This patch copies all attributes of `scf.for` operations upon
reinstantiation, which solves the performance regression.
this is a first commit to support operations on U64 by decomposing them
into smaller chunks (32 chunks of 2 bits). This commit introduce the
lowering pass that will be later populated to support other operations.
Use `OpConversionPattern` instead of `OpRewritePattern` for operation
conversion during dialect conversion. This makes explicit and in-place
type conversions unnecessary, since `OpConversionPattern` already
properly converts operand types and provides them to the rewrite rule
through an operation adaptor.
The main contributions of this commit are the two class templates
`TypeConvertingReinstantiationPattern` and
`GenericOneToOneOpConversionPattern`.
The former allows for the definition of a simple replacement rule that
re-instantiates an operation after the types of its operands have been
converted. This is especially useful for type-polymorphic operations
during dialect conversion.
The latter allows for the definition of patterns, where one operation
needs to be replaced with a different operation after conversion of
its operands.
The default implementations for the class templates provide
conversions rules for operations that have a generic builder method
that takes the desired return type(s), the operands and (optionally) a
set of attributes. How attributes are discarded during a conversion
(either by omitting the builder argument or by passing an empty set of
attributes) can be defined through specialization of
`ReinstantiationAttributeDismissalStrategy`.
Custom replacement rules that deviate from the scheme above should be
implemented by specializing
`TypeConvertingReinstantiationPattern::matchAndRewrite()` and
`GenericOneToOneOpConversionPattern::matchAndRewrite()`.