Commit Graph

24 Commits

Author SHA1 Message Date
Quentin Bourgerie
966160bc2c fix(compiler): apply_lookup_table operators take tensor of i64
We decide to make this choice as they are issue to crate tensor of custom integer type in python.
+ we don't do the integer extension before convert to the concrete CAPI that requires i64
2021-10-13 10:28:35 +02:00
Andi Drebes
30374ebb2c refactor(compiler): Introduce compilation pipeline with multiple entries / exits
This refactoring commit restructures the compilation pipeline of
`zamacompiler`, such that it is possible to enter and exit the
pipeline at different points, effectively defining the level of
abstraction at the input and the required level of abstraction for the
output.

The entry point is specified using the `--entry-dialect`
argument. Valid choices are:

  `--entry-dialect=hlfhe`:   Source contains HLFHE operations
  `--entry-dialect=midlfhe`: Source contains MidLFHE operations
  `--entry-dialect=lowlfhe`: Source contains LowLFHE operations
  `--entry-dialect=std`:     Source does not contain any FHE Operations
  `--entry-dialect=llvm`:    Source is in LLVM dialect

The exit point is defined by an action, specified using --action.

  `--action=roundtrip`:
     Parse the source file to in-memory representation and immediately
     dump as text without any processing

  `--action=dump-midlfhe`:
     Lower source to MidLFHE and dump result as text

  `--action=dump-lowlfhe`:
     Lower source to LowLFHE and dump result as text

  `--action=dump-std`:
     Lower source to only standard MLIR dialects (i.e., all FHE
     operations have already been lowered)

  `--action=dump-llvm-dialect`:
     Lower source to MLIR's LLVM dialect (i.e., the LLVM dialect, not
     LLVM IR)

  `--action=dump-llvm-ir`:
     Lower source to plain LLVM IR (i.e., not the LLVM dialect, but
     actual LLVM IR)

  `--action=dump-optimized-llvm-ir`:
     Lower source to plain LLVM IR (i.e., not the LLVM dialect, but
     actual LLVM IR), pass the result through the LLVM optimizer and
     print the result.

  `--action=dump-jit-invoke`:
     Execute the full lowering pipeline to optimized LLVM IR, JIT
     compile the result, invoke the function specified in
     `--jit-funcname` with the parameters from `--jit-args` and print
     the functions return value.
2021-09-28 11:35:58 +02:00
youben11
1e07733257 fix(lower-LUT): keep output size of KS during lowering
output size of keyswiting wasn't set properly. As this information must
come from the selected parameters, it should goes down from the MidLFHE
to the appropriate call to ciphertext allocation
2021-09-09 20:35:28 +02:00
youben11
50d2ff82af chore(compiler): disable bitwidth check for table lookup 2021-09-09 20:35:28 +02:00
Quentin Bourgerie
70fb5fcd8e fix(compiler/midlfhe): Change constraint on operators with integers (just too large integers are forbidden) 2021-08-24 16:21:31 +02:00
Quentin Bourgerie
fa62e1f0e5 refactor(compiler): Move memref HLFHE and MidLFHE operators to tensor 2021-08-18 11:15:30 +02:00
Quentin Bourgerie
4e6579e019 feat/refactor(compiler): Add --passes options to activate only a subset of passes (#57) 2021-08-04 14:03:05 +02:00
Quentin Bourgerie
be62755401 fix(compiler): Fixing MidLFHE Dialect for the compiler v0 2021-07-29 09:53:45 +02:00
Quentin Bourgerie
3aa5457b84 fix(compiler): Fixing some typos 2021-06-23 10:10:31 +02:00
Quentin Bourgerie
a760ade545 enhance(compiler): Better error message for glwe error 2021-06-23 10:10:31 +02:00
Quentin Bourgerie
8f73863e00 fix(compiler): Fixing MidLFHE.h_add verifier and adding tests 2021-06-23 10:10:31 +02:00
Quentin Bourgerie
4e41969f3e test(compiler): Add another test for mul_plain padding verification 2021-06-23 10:10:31 +02:00
Quentin Bourgerie
aafc9e44e9 fix(compiler): Fixing test ref 2021-06-23 10:10:31 +02:00
Quentin Bourgerie
bdcf7ece05 enhance(compiler): Add verifier of MidLFHE.GLWE parameters 2021-06-23 10:10:31 +02:00
Quentin Bourgerie
efedf23e8d enhance(compiler): MidLFHE.add_plain introduce paddingBits verification 2021-06-23 10:10:31 +02:00
Quentin Bourgerie
38105b5f1c enhance(compiler): MidLFHE has now only one GLWE type that take all cryptographic parameters 2021-06-23 10:10:31 +02:00
youben11
efae2a79d7 feat(compiler): h_add and h_mul 2021-05-28 12:08:42 +02:00
youben11
8edf4a358e feat(compiler): keyswitching types and ops 2021-05-28 12:08:42 +02:00
youben11
7104e2600c feat(compiler): parameterize pbs ops via attr 2021-05-28 12:08:42 +02:00
youben11
55043c24f1 feat(compiler): introduce mul_plain 2021-05-28 12:08:41 +02:00
Quentin Bourgerie
ccae801e5a feat(compiler): Introduce MidLFHE.add_plain and MidLFHE.pbs 2021-05-28 12:08:41 +02:00
Quentin Bourgerie
0b41018ade feat(compiler): Add !HLFHE.ciphertext 2021-05-28 12:08:41 +02:00
Quentin Bourgerie
ce69aab756 feat(compiler): Add !MidLFHE.ggsw<size,N,level,base_log> 2021-05-28 12:08:41 +02:00
Quentin Bourgerie
122759eabf feat(compiler): Introduce MidLFHEDialect (!MidLFHE.lwe<size>, !MidLFHE.glwe<size,n>) 2021-05-28 12:08:41 +02:00