Commit Graph

416 Commits

Author SHA1 Message Date
Quentin Bourgerie
a62b3b1d74 refactor: Integrate concrete-cpu and remove concrete-core
Co-authored-by: Mayeul@Zama <mayeul.debellabre@zama.ai>
2023-03-02 09:26:31 +01:00
rudy
00b9ebc60a fix: benchmark use the encoding field 2023-02-27 10:54:57 +01:00
Quentin Bourgerie
4e0f0fa5b0 fix(manp): Fixing computation of negative constant 2023-02-21 18:04:13 +01:00
youben11
2e5f92b6b8 refactor: remove BConcrete dialect
- 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
2023-02-21 16:16:55 +01:00
Umut
bc69c87d62 feat: implement maxpool2d operation 2023-02-21 14:25:26 +01:00
Alexandre Péré
56bdb05be3 feat(concrete-compiler): implement a new round operator in the fhe dialect 2023-02-20 08:57:30 +01:00
Quentin Bourgerie
0307227431 tests: Add cifar_8bits benchmark 2023-02-17 14:46:27 +01:00
Quentin Bourgerie
4a3c33b60a tests: Remove unsigned prefix to have the same reference than before 2023-02-17 14:08:34 +01:00
Alexandre Péré
52ad40c9cf feat(concrete-compiler): adds a tracing op in all dialects. 2023-02-17 09:04:42 +01:00
Andi Drebes
5d3af16617 test(compiler): Add check for omp.parallel after lowering a parallelizable FHELinalg op
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`.
2023-02-14 09:53:02 +01:00
youben11
59d35619a8 feat: lower and exec boolean mux 2023-02-09 09:43:48 +01:00
youben11
d0ae2563fa test: add chunked eint e2e tests 2023-02-07 12:27:01 +01:00
youben11
7e60f87141 refactor: remove chunked_eint
the pass transforming operations on chunked_eint will operate now on
eint
2023-02-07 12:27:01 +01:00
youben11
bb87d29934 feat: support chunked integer during enc/dec/exec 2023-02-07 12:27:01 +01:00
youben11
d41d14dbb8 feat: lower FHE.add on eint64 to ops on smaller chunks
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.
2023-02-07 12:27:01 +01:00
aPere3
fb680340f9 feat(concrete-compiler): add new ciphertext multiplication operator 2023-02-06 11:30:31 +01:00
aPere3
a200ce43bd fix p-error in mul_eint_int test 2023-02-03 16:19:43 +01:00
aPere3
e95c53f2ff feat: support signed execution
Author: aPere3 <alexandre.pere@zama.ai>
Co-authored-by: Umut <umutsahin@protonmail.com>
2023-02-03 16:19:43 +01:00
aPere3
9a6309a079 fix(concrete-compiler): add end-to-end tests for tensor ops 2023-02-03 14:29:17 +01:00
aPere3
002be243be fix(concrete-compiler): fix bug in crt slice ops 2023-02-03 14:29:17 +01:00
aPere3
2fbcd1a792 fix(concrete-compiler): reassociation maps are incorrect in crt mode
See #890.
2023-02-03 14:29:17 +01:00
Quentin Bourgerie
63334e138f fix: Fixing integer extension for plaintext encoding (close #847) 2023-02-02 14:28:23 +01:00
Andi Drebes
73fd6c5fe7 refactor(compiler): FHE to TFHE: Use OpConversionPattern for dialect conversion
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()`.
2023-02-01 14:27:10 +01:00
Quentin Bourgerie
49b8bf484c fix: Do not assert fail with too large weight and fix computation of 2-Norm with negative weigth (close #892) 2023-02-01 10:50:46 +01:00
Quentin Bourgerie
227a0747fa tests: Remove too invasif test 2023-01-30 15:14:53 +01:00
Quentin Bourgerie
d0308dda43 chore: Use parameters curves generated files and expose security level options 2023-01-30 15:14:53 +01:00
youben11
36f51ba0c2 feat: lower and exec boolean ops 2023-01-26 11:22:41 +01:00
rudy
bac3ed38e0 fix: apply_multi_lookup_table, remove costly workaround
Closes #881
2023-01-23 09:53:25 +01:00
Quentin Bourgerie
d1ddd60a23 fix: Fixing the MANP computation for conv2d (close #883) 2023-01-19 13:32:59 +01:00
youben11
95d49f4657 feat: add boolean types/ops in FHE dialect 2023-01-18 09:13:26 +01:00
rudy
456e1952f5 fix: not private side effect in woppbs wrapper
Fix #865
2023-01-12 17:15:26 +01:00
rudy
bea7c6c1f6 fix: force a test to native encoding 2023-01-04 17:41:49 +01:00
Quentin Bourgerie
4e53b83045 test: Report bug 846 introduced by loop coalesce 2023-01-02 12:04:34 +01:00
rudy
ed2adceafa test: tensorized test/bench rely on p-error 2022-12-14 09:21:18 +01:00
rudy
de779b2f6f fix: display compilation error in benchmark
the checking of llvm expected was not correct
2022-12-14 09:21:18 +01:00
Quentin Bourgerie
19fdbf652e fix(compiler): The crt loops are unary and should be init by a alloc_tensor 2022-12-13 17:01:52 +01:00
aPere3
2fd9b6f0e3 refactor(encodings): raise plaintext/lut encodings higher up in the pipeline 2022-12-13 17:01:52 +01:00
rudy
b742ac35ae fix(ci): force crt for 9, 10, 11 for table lookup 2022-12-13 13:21:30 +01:00
Andi Drebes
e2e6df322e feat(compiler): Add support for full unrolling of loops with SDFG-convertible ops
This adds a new option `--unroll-loops-with-sdfg-convertible-ops`,
which causes loops containing SDFG-convertible operations to be fully
unrolled upon the extraction of SDFG-operations using the
`--emit-sdfg-ops` switch. This avoids constant roundtrips between an
SDFG-capable accelerator and the host during execution of a loop.

The option is limited to `scf.for` loops with static bounds and a
static step size. Since full unrolling of loops with large bounds
results in a large number of operations, the option is disabled by
default.
2022-12-13 12:03:51 +01:00
Quentin Bourgerie
607457d34a fix(compiler): CRT multiplication with negative value (close: #834) 2022-12-09 17:28:03 +01:00
Quentin Bourgerie
07aa334d8d chore(benchmarks): Refactor the benchmark tools 2022-12-09 09:51:23 +01:00
Antoniu Pop
fa1b2dc056 test(SDFG): add unit tests for SDFG and stream emulator. 2022-12-08 14:54:14 +01:00
Andi Drebes
9f3615513b feat(compiler): Add new dialect SDFG for static data flow graphs
This adds a new dialect called "SDFG" for data flow graphs. An SDFG
data flow graph is composed of a set of processes, connected through
data streams. Special streams allow for data to be injected into and
to be retrieved from the data flow graph.

The dialect is intended to be lowered to API calls that allow for
offloading of the graph on hardware accelerators.
2022-12-08 14:54:14 +01:00
Quentin Bourgerie
f552fa59e0 format: Cmake 2022-12-07 21:32:01 +01:00
Quentin Bourgerie
9cf506b0aa chore(tests): Add testing for gpu 2022-12-07 21:32:01 +01:00
Quentin Bourgerie
351bab0bc9 chore(tests): Add a make target for testing gpu 2022-12-07 21:32:01 +01:00
Quentin Bourgerie
735e78c141 chore(bench): Use batched concrete operators for gpu benchmarks 2022-12-07 21:32:01 +01:00
Quentin Bourgerie
33a0d1b9e9 chore(bench): Add a first warmup call 2022-12-07 21:32:01 +01:00
David Testé
2c48bdd9fe test(benchmark): execute on-demand benchmarks with gpu backend
When this type of benchmarks is triggered, only the tests that
benefits from GPU acceleration are run on a specific AWS EC2
instance. Note that this instance (p3.2xlarge) is not a bare metal
one, so performance may variate due to hypervisor controlling the
machine.
2022-12-07 21:32:01 +01:00
Quentin Bourgerie
90361f0b95 fix/chore: Remove custom gpu deleted target for tests 2022-12-07 21:32:01 +01:00