mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 12:15:09 -05:00
9d1cdc6a0ce9574509347a44ba65b7639467ad89
This pass transforms any instance of `HLFHE.dot_eint_int` to an
instance of `linalg.generic` with an appropriate region using
`HLFHE.mul_eint_int` and `HLFHE.add_eint` operations and an
appropriate specification for the iteration dimensions.
Example:
"HLFHE.dot_eint_int"(%arg0, %arg1, %arg2) :
(memref<?x!HLFHE.eint<0>>, memref<?xi32>, memref<!HLFHE.eint<0>>) -> ()
becomes:
linalg.generic {
indexing_maps = [affine_map<(d0) -> (d0)>,
affine_map<(d0) -> (d0)>,
affine_map<(d0) -> ()>],
iterator_types = ["reduction"]
} ins(%arg0, %arg1 : memref<?x!HLFHE.eint<0>>, memref<?xi32>) outs(%arg2 : memref<!HLFHE.eint<0>>) {
^bb0(%arg3: !HLFHE.eint<0>, %arg4: i32, %arg5: !HLFHE.eint<0>): // no predecessors
%0 = "HLFHE.mul_eint_int"(%arg3, %arg4) : (!HLFHE.eint<0>, i32) -> !HLFHE.eint<0>
%1 = "HLFHE.add_eint"(%0, %arg5) : (!HLFHE.eint<0>, !HLFHE.eint<0>) -> !HLFHE.eint<0>
linalg.yield %1 : !HLFHE.eint<0>
}
Homomorphizer
The homomorphizer is a compiler that takes a high level computation model and produces a programs that evaluate the model in an homomorphic way.
Description
Languages
C++
34.3%
Python
23.1%
MLIR
22.9%
Rust
14.6%
C
2.2%
Other
2.8%