Commit Graph

113 Commits

Author SHA1 Message Date
Umut
41c9f86803 feat: create encrypted signed integer type 2022-09-09 17:38:21 +03:00
Quentin Bourgerie
5492ed01eb feat: plug the compiler pipeline with the optimizer for 16 bits eint 2022-08-16 08:40:14 +02:00
Quentin Bourgerie
8cd3a3a599 feat(compiler): First draft to support FHE.eint up to 16bits
For now what it works are only levelled ops with user parameters. (take a look to the tests)

Done:
- Add parameters to the fhe parameters to support CRT-based large integers
- Add command line options and tests options to allows the user to give those new parameters
- Update the dialects and pipeline to handle new fhe parameters for CRT-based large integers
- Update the client parameters and the client library to handle the CRT-based large integers

Todo:
- Plug the optimizer to compute the CRT-based large interger parameters
- Plug the pbs for the CRT-based large integer
2022-08-12 16:35:11 +02:00
rudy
bd3d462384 feat(multiprecision): enable real multiple precision computation 2022-08-11 10:10:27 +02:00
Quentin Bourgerie
534e683055 fix: Lowering from ConcreteToBConcrete of from_elements on ND tensor of Concrete.lwe_ciphertext 2022-08-09 10:26:32 +02:00
Antoniu Pop
2cc8c69ff3 fix(compiler): make the insertForwardDeclaration utility function accept any OpBuilder for more generality. 2022-08-04 17:06:09 +01:00
youben11
ce9393070c fix: avoid tensor slices in conv operation
when lowering the linalg conv operation into scf, then bufferized, there
is a cast operation on an allocated buffer to the type of a
memref with different strides (casued by the slice). This incompatible
cast makes the lowering fails.
2022-08-04 11:19:18 +01:00
youben11
e52ccfc1a9 feat: support grouped conv2d 2022-08-04 11:19:18 +01:00
youben11
f1f1db923d refactor: lower our conv2d to custom linalg named op
we can now generate linalg named op with custom operation for add/mul to
handle our types
2022-08-04 11:19:18 +01:00
Andi Drebes
85ebc0cb7a Rebase onto llvm-project 3f81841474fe with patch for arbitrary types in linalg named ops
Rebase to llvm-project at 3f81841474fe with a pending upstream patch
for arbitrary element types in linalg named operations.

Co-authored-by: Ayoub Benaissa <ayoub.benaissa@zama.ai>
2022-07-27 22:45:38 +02:00
Umut
e24dbec249 feat: create FHELinalg.from_element operation
This commit is introduced because python bindings for `tensor.from_elements` are not generated automatically. Previously, we overcame this with string manipulation, but with the latest version of the compiler, it became a problem. This commit should be reverted eventually. See https://discourse.llvm.org/t/cannot-create-tensor-from-elements-operation-from-python-bindings/4768 for the discussion in LLVM forums.
2022-07-08 14:43:46 +03:00
youben11
f4166a4973 docs: use consistent style for comment blocks
prefix comment blocks with ///
2022-07-07 16:11:19 +01:00
Umut
b3a2671dc7 feat: implement all kinds of subtractions 2022-06-28 11:13:03 +03:00
Quentin Bourgerie
2de76e9c4e fix(compiler): Fix tfhe global parametrization to handle k>1
Co-authored-by: Mayeul@Zama <mayeul.debellabre@zama.ai>
2022-06-24 15:35:51 +02:00
Quentin Bourgerie
9baee39351 cleanup(compiler): Cleanup comments on ConcreteToBConcrete 2022-06-24 11:00:08 +02:00
Quentin Bourgerie
9dd776533a cleanup(compiler): Remove useless concrete types, simplify print and parse, and remove BConcreteToBConcreteCAPI pass 2022-06-24 11:00:08 +02:00
Mayeul@Zama
928a44d243 chore(ci): enforce ending files with a newline 2022-06-16 17:04:25 +02:00
Andi Drebes
3b8ea630a1 refactor(compiler): Rename SubIntGLWEOp to SubGLWEIntOp
Rename `SubIntGLWEOp` to `SubGLWEIntOp` for a consistent naming scheme
of all TFHE ops.
2022-06-14 14:36:28 +02:00
Andi Drebes
45577fb79e Rebase onto llvm-project f69328049e9e with local changes
This commit rebases the compiler onto commit f69328049e9e from
llvm-project.

Changes:

* Use of the one-shot bufferizer for improved memory management

* A new pass `OneShotBufferizeDPSWrapper` that converts functions
  returning tensors to destination-passing-style as required by the
  one-shot bufferizer

* A new pass `LinalgGenericOpWithTensorsToLoopsPass` that converts
  `linalg.generic` operations with value semantics to loop nests

* Rebase onto a fork of llvm-project at f69328049e9e with local
  modifications to enable bufferization of `linalg.generic` operations
  with value semantics

* Workaround for the absence of type propagation after type conversion
  via extra patterns in all dialect conversion passes

* Printer, parser and verifier definitions moved from inline
  declarations in ODS to the respective source files as required by
  upstream changes

* New tests for functions with a large number of inputs

* Increase the number of allowed task inputs as required by new tests

* Use upstream function `mlir_configure_python_dev_packages()` to
  locate Python development files for compatibility with various CMake
  versions

Co-authored-by: Quentin Bourgerie <quentin.bourgerie@zama.ai>
Co-authored-by: Ayoub Benaissa <ayoub.benaissa@zama.ai>
Co-authored-by: Antoniu Pop <antoniu.pop@zama.ai>
2022-06-14 14:35:25 +02:00
youben11
1354759884 chore: rename refs to main branch 2022-06-09 09:19:06 +01:00
Quentin Bourgerie
dd28a7f132 fix(compiler): Concrete.ZeroOp is a 0 value tensor in BConcrete Dialect 2022-05-30 14:22:32 +01:00
Quentin Bourgerie
247d60503d fix(compiler): Custom copy op from 1D tensor to avoir stack allocation from mlir memref to llvm lowering 2022-04-13 10:16:53 +02:00
Quentin Bourgerie
35d8489b9c fix(compiler/TFHE): Introduce bootstrap and keyswitch at the TFHE level 2022-04-12 09:37:56 +02:00
Mayeul@Zama
9ccced7d93 fix(cmake): unify tablegen headers generation dependencies 2022-03-30 17:20:20 +02:00
Quentin Bourgerie
fc51b1d2ab fix(compiler): Activate the loop parallelism in ConcreteToBConcrete when the option is set 2022-03-28 09:41:27 +02:00
youben11
77356fa374 feat: lower FHELinalg.transpose to linalg.generic 2022-03-24 16:04:57 +01:00
Mayeul@Zama
73bb1c03d8 enhance(compiler): fix warnings
remove unused signature, functions, variable
remove pessimizing-moves
add cast before comparison
2022-03-15 18:14:35 +01:00
Mayeul@Zama
ca8d4fb110 feat(compiler): use engine concrete C API
remove ConcreteToConcreteCAPI and ConcreteUnparametrize passes
2022-03-15 18:14:35 +01:00
Umut
a1e4329ca8 fix: use proper broadcasting condition during matmul to linalg generic 2022-03-08 16:04:32 +03:00
youben11
65e2e2f600 fix: correct reassociation in expand and collapse ops 2022-03-02 09:55:54 +01:00
Umut
d06e0c0a59 feat: enhance matmul operation to support 1-D and N-D inputs 2022-03-01 18:06:40 +03:00
youben11
86379096df feat: lower FHELinalg.conv2d to linalg
This is currently lowering to our custom linalg conv operation, since
linalg ops doesn't support custom types. But as linalg will support
custom types in the future, we may want to lower to the native linalg op
instead
2022-02-24 09:44:26 +01:00
Quentin Bourgerie
61fefde35a fix(compiler): Compilation gcc7 2022-02-17 15:53:23 +01:00
Quentin Bourgerie
a068a728d3 chore(compiler): Fix missing dependencies in the build system 2022-02-17 15:53:23 +01:00
Quentin Bourgerie
4e8a9d1077 enhance(runtime): Fix the runtime tools to handle the ciphertext bufferization and the new compiler concrete bufferized API 2022-02-17 15:53:23 +01:00
Quentin Bourgerie
626493dda7 enhance(compiler): Lower from Concrete to BConcrete and BConcrete to C API call 2022-02-17 15:53:23 +01:00
Quentin Bourgerie
b3368027d0 refactor(compiler): Move FHELinalg.zero to FHE.zero_tensor and add zero and sero_tensor in TFHE and Concrete dialects 2022-02-17 15:53:23 +01:00
Umut
20a89b7b42 feat: implement concat operation 2022-02-15 16:52:07 +03:00
Umut
a1818a3fd9 feat: implement advanced sum operation 2022-02-08 17:49:58 +03:00
Quentin Bourgerie
f52965e22f enhance(compiler): Lower linalg to parallel loops and instantiare parallel loops with openmp 2022-02-03 10:59:12 +00:00
Umut
4203e86998 feat: implement basic sum operation 2022-02-01 12:18:56 +03:00
Andi Drebes
39b80bd5b2 fix(compiler): Remove unused variables in TFHEGlobalParametrization.cpp 2022-01-07 12:03:13 +01:00
youben11
2009ee1c94 chore: changing ref to repo after its renaming
also formatting and update the check_license script to match that
2022-01-06 12:40:10 +01:00
youben11
f1161f7f6d chore: formatting
Quick fix due to ordering of includes, had to add #include
<mlir/Transforms/DialectConversion.h> to include/concretelang/Conversion/Utils/GenericOpTypeConversionPattern.h
2022-01-03 09:29:19 +01:00
youben11
940cb96be4 chore: rename dialects
HLFHE to FHE
MidLFHE to TFHE
LowLFHE to Concrete
2021-12-29 15:13:34 +01:00
youben11
e73291abdc chore: rename compiler to concrete-compiler
zamalang => concretelang
zamacompiler => concretecompiler
2021-12-29 15:13:34 +01:00
youben11
971cb56182 chore: licensing 2021-12-29 15:13:34 +01:00
rudy
d8fee32cea feat(HLFHELinalg): add apply_mapped_table_lookup
Resolves #182
2021-12-27 15:34:33 +01:00
Antoniu Pop
cdca7ca6f7 feat(compiler): add Dataflow/RT dialect and code generation for dataflow auto parallelization. 2021-12-23 15:57:53 +00:00
Andi Drebes
f319ba37d2 feat(compiler): Integrate HLFHELinalg tiling passes into compilation pipeline 2021-12-17 16:09:59 +01:00