Commit Graph

25 Commits

Author SHA1 Message Date
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
Andi Drebes
27ca5122bc enhance(compiler): Use named constant for the default pattern rewriting benefit
This introduces a new header file `zamalang/Support/Constants.h` for
constants, currently only populated with a constant for the default
pattern rewriting benefit of 1.
2021-12-17 15:28:21 +01:00
rudy
d34792c977 fix(compiler): remove 1 warning (usgined vs signed) 2021-12-13 16:43:35 +01:00
Mayeul@Zama
f193fd71a2 fix(compiler): fix mixed-up (g)lwe dimension/size
add dimension -> size conversion
rename k -> glweDimension, polynomialSize -> logPolynomialSize
remove (in/out)putLweSize from KeySwitchLweOp
remove GlweSizeType from LowLFHE
2021-12-07 12:11:56 +01:00
Andi Drebes
6fb907295d feat(compiler): Add lowering for HLFHELinalg.zero to linalg.generate
Add a rewrite pattern that transforms an instance of
`HLFHELinalg.zero` into an instance of `linalg.generate` with an
appropriate region yielding a zero value.

Example:

  %out = "HLFHELinalg.zero"() : () -> tensor<MxNx!HLFHE.eint<p>>

becomes:

  %0 = tensor.generate   {
    ^bb0(%arg2: index, %arg3: index):
       %zero = "HLFHE.zero"() : () -> !HLFHE.eint<p>
       tensor.yield %zero : !HLFHE.eint<p>
  } : tensor<MxNx!HLFHE.eint<p>>
2021-12-01 11:24:27 +01:00
Quentin Bourgerie
ddbafd713d feat(compiler): Add the HLFHELinalg.matmul_int_eint operator 2021-11-24 09:19:25 +01:00
youben11
c5e3d9add8 fix(compiler): reserve the right amount of memory 2021-11-15 11:25:44 +01:00
youben11
36413235c5 feat(compiler): lower HLFHELinalg.apply_multi_lut
Support broadcasting
2021-11-15 11:25:44 +01:00
Quentin Bourgerie
f2b5d3316f fix(compiler): don't try to broadcast when dims are equals with value 1 (7c8399)
Removed due of miss conflict resolution
2021-11-15 09:59:52 +01:00
Quentin Bourgerie
3fad9870a8 cleanup(compiler): Fix warning about comparison of expressions with different signedness in TensorOpsToLinalg 2021-11-12 16:50:29 +01:00
Quentin Bourgerie
af0819c403 feat(compiler): Lower HLFHELinalg.matmul_eint_int to linalg.generic (close #177) 2021-11-12 16:50:29 +01:00
youben11
7c83994c7f fix(compiler): don't try to broadcast when dims are equals with value 1 2021-11-12 15:07:08 +01:00
youben11
6df9f09e48 feat(compiler): lower HLFHELinalg.neg_eint 2021-11-10 15:24:31 +01:00
rudy
97389a3b06 Move HLFHE.dot_eint_int to HLFHELinalg.
Resolves #183
2021-11-09 11:39:08 +01:00
youben11
03c1588db4 chore: update to LLVM 8b7cc93e
major changes:
- https://llvm.discourse.group/t/psa-removed-arithmetic-ops-from-standard/4455
- use add_mlir_public_c_api_library helper to correctly add a CAPI library
2021-10-29 16:08:41 +01:00
Quentin Bourgerie
ccaf1bff15 feat(compiler): Lower HLFHELinalg.apply_lookup_table (close #174) 2021-10-29 13:47:38 +02:00
Quentin Bourgerie
a135d05e4d feat(compiler): Lowering of HLFHELinalg.mul_eint_int 2021-10-29 12:18:30 +02:00
Quentin Bourgerie
0b5ee3497a feat(compiler): Lowering of HLFHELinalg.sub_int_eint 2021-10-29 12:18:22 +02:00
Quentin Bourgerie
b81cb978d0 feat(compiler): Lowering of HLFHELinalg.add_eint_int 2021-10-29 12:17:38 +02:00
Quentin Bourgerie
ba54560680 feat(compiler): Lower HLFHELinalg binary operators 2021-10-29 12:17:38 +02:00
Quentin Bourgerie
1077c9167c enhance(compiler): Full lowering of hlfhe.zero, make dot_eint_int fully lowerable 2021-09-08 11:44:51 +02:00
Andi Drebes
8b9c9f2da1 refactor(compiler): HLFHE.dot_eint_int: Switch from reference to value semantics
This changes the semantics of `HLFHE.dot_eint_int` from memref-based
reference semantics to tensor-based value semantics. The former:

  "HLFHE.dot_eint_int"(%arg0, %arg1, %arg2) :
     (memref<Nx!HLFHE.eint<0>>, memref<Nxi32>, memref<!HLFHE.eint<0>>) -> ()

becomes:

  "HLFHE.dot_eint_int"(%arg0, %arg1) :
     (tensor<Nx!HLFHE.eint<0>>, tensor<Nxi32>) -> !HLFHE.eint<0>

As a side effect, data-flow analyses become much easier. With the
previous memref type of the plaintext argument it is difficult to
check whether the plaintext values are statically defined constants or
originate from a memory region changed at execution time (e.g., for
analyses evaluating the impact on noise). Changing the plaintext type
from `memref` to `vector` makes such analyses significantly easier.
2021-08-17 16:53:32 +02:00
Quentin Bourgerie
b4e57984b1 feat(compiler): Add passes to lower mlir to mlir llvm ir and run jit and emit llvm code (#63) 2021-08-05 13:43:08 +01: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