-Encoding Cleartext to Plaintext Op
-Encoding Int to Plaintext Op
-Cleartext/Plaintext should add a bits field as `p`
-Op to create a constant Cleartext
-IntToCleartextOp: kind of casting an int to be later encoded, I'm not
sure if there is a better mechanism for this (e.g. auto casting in Ops),
but we currently need a way to encode int into plaintext, and we need to
go through cleartexts
also fixes an issue regarding populateWithGenerated, which can be
duplicated across different pattern files. So I redefined a different
function that is more unique to the pass that should be ran, and hide
the populateWithGenerated from the global namespace
* feat(compiler): low level fhe dialect
* feat(compiler): using generated printer/parser in LowLFHE
* feat(compiler): new types and ops for LowLFHE
* tests(compiler): LowLFHE types and ops
* feat(compiler): fill ops
* cleanup
* summary + description
* tests(compiler): use new CLI args
* formatting
- feat(compiler): python bindings
- build: update docker image for python bindings
- pin pybind11 to 2.6.2, 2.7 is not having correct include_dirs set (still
a question why?)
- using generated parser/printer
This adds a new command line option
`--convert-hlfhe-tensor-ops-to-linalg` that invokes a conversion pass
replacing any HLFHE tensor operation with an appropriate instance of
`linalg.generic`.
Add a simple dot product between a vector of encrypted integers and a
vector of plaintext integers to the HLFHE dialect.
The operation takes two input operands and one output operand, all
modeled as memrefs. Example:
"HLFHE.dot_eint_int"(%lhs, %rhs, %out) :
(memref<?x!HLFHE.eint<0>>, memref<?xi32>, memref<!HLFHE.eint<0>>) -> ()
The option `--verify-diagnostics` allows the user to interleave
invalid source code with diagnostic messages that should be produced
during parsing and checks if these messages are actually produced. The
expected diagnostic messages are specified using `// expected-error`
markers.
The new option `--split-input-file` allows the user to add `// -----`
markers to a source file, causing the file to be split into multiple
chunks that are treated as if they were specified in different files.
Use a more idiomatic approach for I/O using `llvm::SourceManager` to
manage input files and `mlir::openOutputFile` to write to the
output. This commit prepares management of diagnostics in subsequent
changes.
* fix(compiler): Generate and include autogenerated dialect definitions
Since commit 485cc55edfb875628e19bb6d9de4706af2865d3e in llvm-project,
dialects are now required to include a file with autogenerated
definitions. This commit generates the definition files and includes
them in appropriate dialect source files for MidLFHE and HLFHE.
* CI: update docker image ref
Co-authored-by: Andi Drebes <andi.drebes@zama.ai>
Co-authored-by: Ayoub Benaissa <ayoub.benaissa@zama.ai>
Make `HLFHE.EncryptedInteger` implement the
`MemRefElementTypeInterface` trait to allow the type to be used for
elements of memrefs.
The invocation of the `add_mlir_dialect` macro in
`include/zamalang/Dialect/HLFHE/IR/CMakeLists.txt` had to be broken
into its parts in order to pass `-typedefs-dialect=HLFHE` to
`mlir-tablegen`. This is required due to the inclusion of
`mlir/IR/BuiltinTypes.td` in
`include/zamalang/Dialect/HLFHE/IR/HLFHETypes.td`, resulting in
definitions from multiple dialects.
Add a small test actually using `HLFE.EncryptedInteger` in a `memref`.
LLVM already provides a command line parser, covering the use of tclap
in the sources. This patch uses the LLVM command line parser instead
of tclap and thus reduces the number of external dependencies.