Commit Graph

55 Commits

Author SHA1 Message Date
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
youben11
36f51ba0c2 feat: lower and exec boolean ops 2023-01-26 11:22:41 +01:00
Antoniu Pop
aa2e0479b3 feat(compiler): add a parallel loop coalescing pass. 2023-01-02 12:04:34 +01:00
aPere3
2fd9b6f0e3 refactor(encodings): raise plaintext/lut encodings higher up in the pipeline 2022-12-13 17:01:52 +01:00
Antoniu Pop
7226c89cf1 enhance(compiler): coalesce loop nests before parallelization. 2022-12-13 15:23:29 +00: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
Antoniu Pop
0dbb86bb36 feat(compiler): add lowering and bufferization for SDFG dialect, generate code to Stream Emulator API. 2022-12-08 14:54:14 +01:00
Andi Drebes
3da32560b7 feat(compiler): Add pass converting operations into SDFG processes
This adds a new pass `ExtractSDGOps`, which scans a function for
operations that implement `SDFGConvertibleOpInterface`, replaces them
with SDFG processes and constructs an SDFG graph around the processes.

Initialization and teardown of the SDFG graph are embedded into the
function and take place at the beginning of the function and before
the function's terminator, respectively.

The pass can be invoked using concretecompiler by specifying the new
compilation option `--emit-sdfg-ops` or programmatically on a
`CompilerEngine` using the new compilation option `extractSDFGOps`.
2022-12-08 14:54:14 +01:00
Quentin Bourgerie
50973a39bd refactor(compiler): Remove async offloading of BS/KS 2022-11-30 10:29:19 +01:00
Quentin Bourgerie
9e16f31b87 refactor(bconcrete): Separate bufferization and CAPI call generation 2022-11-30 10:29:19 +01:00
Andi Drebes
c9bb6541e9 feat(compiler): Add option --batch-concrete-ops and action dump-concrete-with-loops
The new option `--batch-concrete-ops` invokes the batching pass after
lowering to the Concrete dialect and after lowering linalg operations
with operations from the Concrete dialect to loops.

The new action `dump-concrete-with-loops` dumps the IR right before
batching.
2022-11-18 12:06:07 +01:00
Mayeul@Zama
2a6d1958fd chore(compiler): remove unused loopParallelize 2022-11-14 14:04:46 +01:00
youben11
ef778ac75b refactor: replace some operands by attrs in bs/ks 2022-10-20 10:36:32 +01:00
youben11
7cd45d1514 test: add GPU end2end tests 2022-10-20 10:36:32 +01:00
youben11
a7a65025ff refactor: redesign GPU support
- unify CPU and GPU bootstrapping operations
- remove operations to build GLWE from table: this is now done in
  wrapper functions
- remove GPU memory management operations: done in wrappers now, but we
  will have to think about how to deal with it later in MLIR
2022-10-20 10:36:32 +01:00
youben11
d169a27fc0 feat: support GPU (bootstrapping) 2022-10-20 10:36:32 +01:00
Antoniu Pop
4fbb05e18c feat(compiler): add an asynchronous interface for bootstrap and keyswitch using std::promise/future. 2022-09-19 13:02:20 +01:00
Antoniu Pop
2cf80e76eb feat(compiler): move the lowering of dataflow tasks to RT dialect before bufferization. 2022-09-15 11:55:37 +01: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
cc6c2576ec feat(optimizer): create optimizer dag and use it 2022-08-11 10:10:27 +02:00
Antoniu Pop
fbca52f4a0 feat(dfr): add memory management for futures and associated data. 2022-08-04 17:06:09 +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
Quentin Bourgerie
511bcd99e7 Revert "feat(optimizer): create optimizer dag and use it"
This reverts commit 0b99f6d278.
2022-07-27 18:35:47 +02:00
rudy
0b99f6d278 feat(optimizer): create optimizer dag and use it 2022-07-25 21:06:14 +02:00
Quentin Bourgerie
ab64532b7b cleanup(compiler): Remove old bufferization passes 2022-06-24 11:00:08 +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
youben11
8d0f20390c feat: optimize concrete mul with constant values 2022-06-01 14:35:12 +01:00
Quentin Bourgerie
6532c8f449 fix(compiler): Canonicalize before MANP analysis 2022-05-24 14:12:28 +02:00
Quentin Bourgerie
254b4dc530 enhance(compiler): Enable deallocation pass to free temporary buffers 2022-03-28 09:41:54 +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
Mayeul@Zama
ca8d4fb110 feat(compiler): use engine concrete C API
remove ConcreteToConcreteCAPI and ConcreteUnparametrize passes
2022-03-15 18:14:35 +01:00
youben11
e82360a9fe feat: support lowering of convolution end to end 2022-02-24 09:44:26 +01:00
Quentin Bourgerie
8a9cce64e3 enhance(compiler): Add custom finalize bufferize pass to handle memref.tensor_load op 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
Antoniu Pop
ec633d57f6 fix(compiler): predicate OpenMP loop parallelization of Linalg on the --parallelize flag. 2022-02-03 10:59:12 +00: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
youben11
2926ea6a5e fix: use appropriate type for optimizingTransformer func
the call does return an `std::function` and was being referenced using
an `llvm::function_ref`, which apparently with some optim on Mac was
referncing bad memory location
2022-01-24 17:02:25 +00: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
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
Quentin Bourgerie
fb58dcc59d enhance(compiler/lowlfhe): Give the runtime context as function argument instead of a global variable (close #195) 2021-12-02 10:56:47 +01:00
Quentin Bourgerie
b598f0ffca refactor(compiler): Move the conversion from scf to std on the pipeline intead of embedded in a pass 2021-11-12 16:50:29 +01:00
Quentin Bourgerie
85d102c9b2 refactor(compiler): Simplify the compiler flow and re enable --passes compiler option
No more need to compute the fhe context at high level
2021-10-29 13:44:34 +02:00
youben11
ab7a208112 fix: store OpPassManager& before call to addPass
weird bug with c++ 6.3 on the manylinux_2_24 image (Debian9) generating
erroneous asm instructions for call to nest on PassManager
2021-10-26 16:31:04 +02:00
youben11
7b29600721 refactor: don't use designated initializers 2021-10-26 16:31:04 +02:00