Commit Graph

70 Commits

Author SHA1 Message Date
Umut
ade83d5335 feat(compiler): add more detailed statistics 2023-08-01 18:40:08 +02:00
youben11
f6599a91c6 refactor(compiler): add func to populate RTOps type conversion 2023-07-31 16:57:53 +01:00
Umut
79b38a72ec feat(compiler): provide circuit statistics 2023-07-26 11:08:15 +02:00
youben11
022b1879a1 feat(compiler): support compiling in-memory module 2023-07-21 14:14:55 +01:00
aquint-zama
502fcfdbe6 chore(compiler): fix typos 2023-07-13 14:33:54 +02:00
aquint-zama
9928c0dbd9 docs(compiler): Generate dialect docs for the Tracing Dialect 2023-07-13 14:33:54 +02:00
aquint-zama
60817835db chore(compiler): typos 2023-07-13 14:33:54 +02:00
Andi Drebes
cc6f86957c docs(compiler): Generate dialect docs for the RT Dialect 2023-07-13 14:33:54 +02:00
youben11
27e1835f23 feat(compiler/python): expose simulation to python-bindings 2023-06-27 14:21:42 +01:00
youben11
eb116058e0 feat(compiler): support invoke on simulated circuits 2023-06-27 14:21:42 +01:00
youben11
32ad46f7c5 feat(compiler): disable runtimeCtx pass in simulation 2023-06-27 14:21:42 +01:00
youben11
5e848a6971 feat(compiler/clientlib): support simulation in enc-args 2023-06-27 14:21:42 +01:00
youben11
09b84e0373 refactor(compiler/clientlib): add ValueDecrypter Interface 2023-06-27 14:21:42 +01:00
youben11
ad13602bf3 refactor(compiler/clientlib): add ValueExporter Interface 2023-06-27 14:21:42 +01:00
youben11
7b594c5ecd feat(compiler): add simulation runtime 2023-06-27 14:21:42 +01:00
youben11
b8e462c1cc feat(compiler): add option to compile in simulation mode 2023-06-27 14:21:42 +01:00
youben11
e58b46d86d feat(compiler): add a pass to simulate TFHE ops
lowering is done to CAPI calls that implement simulation as well as
standard MLIR ops
2023-06-27 14:21:42 +01:00
Bourgerie Quentin
5147ac8418 feat(compiler): Add canonicalization of FHE/FHELinalg to_signed to_unsigned ops 2023-06-23 14:34:23 +02:00
Bourgerie Quentin
5a80e22cf3 fix(compiler): Annotate FHELinalg as Pure for canonicalization 2023-06-23 14:34:23 +02:00
Antoniu Pop
9363c40753 fix(compiler): fix key serialization for distributed computing in DFR.
Key serialization for transfers between nodes in clusters was broken
since the changes introduced to separate keys from key parameters and
introduction of support for multi-key (ref
cacffadbd2).

This commit restores functionality for distributing keys to non-shared
memory nodes.
2023-06-19 09:54:21 +01:00
Mayeul@Zama
97b13e871c feat(optimizer): introduce fft precision 2023-06-15 10:48:07 +02:00
Mayeul@Zama
5659195dbc feat(optimizer): accept any ciphertext_modulus_log 2023-06-15 10:48:07 +02:00
Andi Drebes
549d2ded86 feat(compiler): Batching: Favor batching of all operands for binary TFHE ops
This changes the order of batching variants for binary TFHE
operations, such that batching of both operands is favored over
batching of a single operand.
2023-06-12 22:51:30 +01:00
Antoniu Pop
81eaaa7560 feat(compiler): add multi-gpu scheduler for batched ops. Scheduler splits op batches in chunks to fit GPU memory and balance load across GPUs. 2023-06-12 22:51:30 +01:00
Andi Drebes
3516ae7682 feat(compiler): Add option for maximum batch size to batching pass
This adds a new compilation option `maxBatchSize` and a command line
option `--max-batch-size` to `concretecompiler`.
2023-06-12 22:51:30 +01:00
Andi Drebes
38a5b5e928 feat(compiler): Add support for batching with multiple batchable operands
The current batching pass only supports batching of operations that
have a single batchable operand, that can only be batched in one way
and that operate on scalar values. However, this does not allow for
efficient batching of all arithmetic operations in TFHE, since these
are often applied to pairs of scalar values from tensors, to tensors
and scalars or to tensors that can be grouped in higher-order tensors.

This commit introduces three new features for batching:

  1. Support of multiple batchable operands

     The operation interface for batching now allows for the
     specification of multiple batchable operands. This set can be
     composed of any subset of an operation's operands, i.e., it is
     not limited to sets of operands with contiguous operand indexes.

  2. Support for multiple batching variants

     To account for multiple kinds of batching, the batching operation
     interface `BatchableOpInterface` now supports variants. The
     batching pass attempts to batch an operation by trying the
     batching variants expressed via the interface in order until it
     succeeds.

  3. Support for batching of tensor values

     Some operations that could be batched already operate on tensor
     values. The new batching pass detects those patterns and groups
     the batchable tensors' values into higher-dimensional tensors.
2023-06-12 22:51:30 +01:00
Antoniu Pop
20394368bf feat(compiler): add lowering of batched mapped bootstrap operations to wrappers and SDFG, with support in the runtime. 2023-06-12 22:51:30 +01:00
Antoniu Pop
3a679a6f0a feat(compiler): add mapped version of batched bootstrap wrappers for CPU and GPU. 2023-06-12 22:51:30 +01:00
Antoniu Pop
7407948b18 test(compiler): add SDFG as default to GPU backend options and batched SDFG GPU test. 2023-06-12 22:51:30 +01:00
Antoniu Pop
3f9f228a23 feat(compiler): add runtime support for batched operations in SDFG/GPU. 2023-06-12 22:51:30 +01:00
Antoniu Pop
60412f7f61 feat(compiler): add SDFG op generation for batched operations. 2023-06-12 22:51:30 +01:00
Antoniu Pop
3f230957cb feat(compiler): add batched operations for all levelled ops. 2023-06-12 22:51:30 +01:00
Antoniu Pop
799e64e8ab feat(compiler): add task creation using vectors of futures as inputs and outputs. 2023-06-12 22:51:30 +01:00
youben11
9c077852bb feat(compiler): load lib compilation result from directory 2023-06-09 14:30:46 +01:00
Umut
27d081e255 feat(compiler/bindings): create bindings for value management 2023-06-09 13:01:27 +02:00
Bourgerie Quentin
f7f94a1663 feat(compiler/client-lib): Implement ValueExporter to allows partial encryption 2023-06-09 13:01:27 +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
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
Andrei Stoian
817ee6b637 feat(compiler): add matmul eint eint op 2023-05-15 11:36:47 +02:00
Quentin Bourgerie
462a23b622 fix(compiler/fhe): Allows noop FHE.round operators and fold it 2023-05-11 12:52:38 +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
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
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
Umut
673b02473f feat(frontend/python): explicit key management 2023-04-11 14:55:57 +02:00
aPere3
e50013b75c fix(compiler): allow FHELinalg.apply_lookup_table on esint 2023-04-05 10:35:00 +02:00