Commit Graph

112 Commits

Author SHA1 Message Date
Ayoub Benaissa
a689dba8d7 fix(compiler/rust): fix const declaration of target-specific static libs
for aarch64
2023-06-07 12:42:50 +01:00
youben11
c0e9f94810 fix(compiler): fix linking of the rust bindings 2023-06-05 17:48:01 +01:00
youben11
aae05e60c6 feat(compiler): copy cpp optim lib into output lib dir
this makes sure it will be installed as part of the compiler, as needed
currently by the rust bindings
2023-06-05 17:48:01 +01:00
Andi Drebes
83c1654768 fix(compiler): Move operations in scf.for reinstantiation pattern before replacement
The reinstantianting rewrite pattern for `scf.for` operations,
`TypeConvertingReinstantiationPattern<scf::ForOp, false>`, calls
`mlir::ConversionPatternRewriter::replaceOpWithNewOp()` before moving
the operations of the original loop to the newly created loop. Since
`replaceOpWithNewOp()` indirectly marks all operations of the old loop
as ignored for dialect conversion, the dialect converter never
descends recursively into the newly created loop.

This causes operations that are illegal to be preserved, which results
in illegal IR after dialect conversion.

This commit splits the replacement into three steps:

  1. Creation of the new loop via
     mlir::ConversionPatternRewriter::create()`
  2. Moving operations from the old loop to the newly created one
  3. Replacement of the original loop with the results of the new one
     via `mlir::ConversionPatternRewriter::replaceOp()`

This causes the operations of the loops not to be ignored and fixes
dialect conversion.
2023-05-30 16:56:39 +02:00
rudy
07d97f266d feat(frontend-python): display progress during fhe execution 2023-05-26 15:56:23 +02:00
Bourgerie Quentin
f487432207 fix(compiler): fold mul and matmul by zero to zero
That will close https://github.com/zama-ai/concrete-internal/issues/297 also for dag-multi optimization
2023-05-25 03:48:33 -04:00
Antoniu Pop
900018c44e fix(compiler): increase the maximum number of DFR task inputs to 50. Split generated switches in separate files. 2023-05-24 09:56:34 +02:00
Quentin Bourgerie
caee0bae66 fix(compiler): Workaround fallback to Strategy::V0 when solving with Strategy::DAG_MONO
close https://github.com/zama-ai/concrete-internal/issues/297
2023-05-23 04:00:56 -04:00
Quentin Bourgerie
0bdb85b67d refactor(compiler/clientlib): Remove the building of the calling convention in the EncryptedArguments and test serialization in end_to_end_tests 2023-05-22 16:21:33 -04:00
Quentin Bourgerie
5df44ad6f8 chore(compiler/build): Remove script to get BUILD_DIR 2023-05-17 13:57:37 +02:00
Andrei Stoian
817ee6b637 feat(compiler): add matmul eint eint op 2023-05-15 11:36:47 +02:00
Quentin Bourgerie
d973f068f6 fix(compiler): Fixing extra conversion fixup when producer is not directly a TFHE operator 2023-05-12 09:47:35 +02:00
Quentin Bourgerie
0fa1b4ba1d refactor(compiler): Cleanup TFHECircuitSolutionParametrization and make it less verbose in verbose mode 2023-05-12 09:47:35 +02:00
Quentin Bourgerie
462a23b622 fix(compiler/fhe): Allows noop FHE.round operators and fold it 2023-05-11 12:52:38 +02:00
Quentin Bourgerie
eff442438b fix(compiler): Do not create dealloc on the bufferization pass as that place all dealloc at the end of the program 2023-05-10 09:18:47 +02:00
aPere3
0d2416fe80 chore(compiler): add code doc on encrypted mul 2023-05-05 12:43:41 +02:00
youben11
f6c70ac18e chore(compiler): clean dialect licenses
set dialect licenses to apache 2.0 and keeps the rest following the main
license
2023-05-04 10:28:50 +01:00
Mayeul@Zama
3558ba5586 feat(backend-cpu): choose fastest aes implementation at runtime 2023-04-24 15:02:22 +02:00
Umut
41bf801ce1 feat(frontend-python): introduce parameter selection strategy configuration 2023-04-21 17:38:05 +02:00
Mayeul@Zama
2800f74fb8 chore(compiler): clean up .gitignore 2023-04-20 15:11:38 +02:00
Mayeul@Zama
8033c934f3 chore(compiler): remove old makefile targets 2023-04-20 15:11:38 +02:00
Quentin Bourgerie
dfa0c8b202 feat(compiler): Add dag-multi benchmark to the run-cpu-benchmark target 2023-04-20 09:46:24 +02:00
Quentin Bourgerie
ef6fa86603 fix(compiler/bench): Fixing round end to end yaml description generation with shapes arguments 2023-04-20 09:46:24 +02:00
Quentin Bourgerie
af79774ae0 fix(compiler/tests/bench): Add optimizer strategy to the name of benchs and tests 2023-04-20 09:46:24 +02:00
aPere3
50255cc908 fix(compiler): propagates oid when simplifying fhelinalg zero sums 2023-04-18 13:36:15 +02:00
aPere3
85c29c2e39 chore(compiler): move end-to-end linalg tests to fixtures 2023-04-18 13:36:15 +02:00
Quentin Bourgerie
065e4d7b40 test(compiler): Temporary remove batching check-test as it to invasive 2023-04-14 15:01:18 +02:00
aPere3
141efc8db2 bench(compiler): Add e2e benchmark for rounded PBS 2023-04-14 15:01:18 +02:00
Quentin Bourgerie
0e59f66a64 fix(compiler): FHE.to_bool and FHE.from_bool is a no op and not reduce the noise to the base 2023-04-14 15:01:18 +02:00
Quentin Bourgerie
edbdcdd7ec fix(compiler/test): Fixing naming in end_to_end tests 2023-04-14 15:01:18 +02:00
Quentin Bourgerie
3ada182c22 test(compiler): Enable dag-multi tests on all yaml tests 2023-04-14 15:01:18 +02:00
rudy
311ac8ce99 feat(compiler,ci): parallel tests 2023-04-14 15:01:18 +02:00
Quentin Bourgerie
944f9f6fc2 fix(compiler/benchmark): Remove always optimizer display 2023-04-14 15:01:18 +02:00
aPere3
0ba154fca8 test(compiler): add multi precision tests 2023-04-14 15:01:18 +02:00
Quentin Bourgerie
955dea6fcd feat(compiler/tests): Add verbose options to end_to_end_test 2023-04-14 15:01:18 +02:00
Quentin Bourgerie
d388f08cc5 test(compiler): Fix check test 2023-04-14 15:01:18 +02:00
rudy
06b724ab50 feat(compiler/tests): rounded tests, add rounded tlu + tensorized 2023-04-14 15:01:18 +02:00
Quentin Bourgerie
142e0ed77e feat(compiler): Integrate circuit solution optimization 2023-04-14 15:01:18 +02:00
Quentin Bourgerie
953c202fe1 refactor(compiler): Propagate optimizer dag node identifier along the compilation pipeline 2023-04-14 15:01:18 +02:00
Quentin Bourgerie
7d1c43bc47 feat(compiler/multi-parameters): Create a pass to apply the multi-parameter circuit solution of the optimize 2023-04-14 15:01:18 +02:00
aPere3
cacffadbd2 feat(compiler): add support for multikey
This commit brings support for multiple secret keys in the TFHE
dialect. In particular, a parameterized `TFHE` circuit can now be
given as input, with any combination of (semantically valid) of
ks/bs/woppbs mixing different secret keys, and compiled down to a
valid executable function, with server keys properly looked up.

Secret keys are now stateful objects which can be:
-> none/unparameterized (syntax `sk?`): The keys are in state after
   the lowering from the `FHE` dialect.
-> parameterized (syntax `sk<identifier, polysize, dimension>`): The
   keys were parameterized, either by user or by the optimizer. The
   `identifier` field can be used to disambiguate two keys with same
   `polysize` and `dimension`.
-> normalized (syntax `sk[index]<polysize, dimension>`): The keys were
   attached to their index in the list of keys in the runtime context.

The _normalization_ of key indices also acts on the ksk, bsk and pksk,
which are given indices in the same spirit now.

Finally, in order to allow parameterized `TFHE` circuit to be given
as input and compiled down to executable functions, we added a way to
pass the encodings that are used to encode/decode the circuit
inputs/outputs. In the case of a compilation from the `FHE` dialect,
those informations are automatically extracted from the higher level
informations available in this dialect.
2023-04-14 15:01:18 +02:00
Mayeul@Zama
56d2d3e40d chore(tools): add Makefile generated tests to .gitignore 2023-04-13 11:10:48 +02:00
Umut
14aa92c511 fix(compiler): correctly determine dimensions during (de)serialization of public args 2023-04-12 07:55:33 +02:00
Umut
673b02473f feat(frontend/python): explicit key management 2023-04-11 14:55:57 +02:00
Umut
b73d465f1d fix(compiler): implement MANP calculation for FHELinalg.to_(un)signed 2023-04-07 19:42:57 +02:00
Antoniu Pop
990df766bb test(compiler): disable testing of StreamEmulator. 2023-04-06 16:23:20 +02:00
aPere3
e50013b75c fix(compiler): allow FHELinalg.apply_lookup_table on esint 2023-04-05 10:35:00 +02:00
rudy
9cacd4adff fix(compiler): accept signed & tensorized tlu 2023-04-03 13:23:20 +02:00
Umut
8f90074958 feat(compiler): implement FHELinalg.round operation 2023-03-31 10:12:21 +02:00
rudy
f596afb607 fix(compiler): more robust high global_p_error optimization 2023-03-30 09:31:08 +02:00