Commit Graph

3428 Commits

Author SHA1 Message Date
Andi Drebes
ee03a48447 feat(compiler): Add option --split-input-file
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.
2021-07-16 18:03:49 +02:00
Andi Drebes
74671794e3 refactor(compiler): Use idiomatic approach for I/O management
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.
2021-07-16 18:03:49 +02:00
Arthur Meyre
e0c838b230 chore(tools): a less annoying pylint
- allow 1 letter names
- no minimum on class public methods
2021-07-16 12:26:52 +02:00
Arthur Meyre
ef78e66241 build(coverage): add comment to PR with diff-cover output
- add script to help format the coverage comment
- manage steps logic

refs #15
2021-07-16 12:25:10 +02:00
Arthur Meyre
7dccfa649c build(tests): add tests and coverage to CI workflow
#refs 15
2021-07-16 12:25:10 +02:00
Arthur Meyre
a2185af578 tests: add test structure and dependencies
- add unique ID generator to hdk and unit test it

refs #15
2021-07-16 12:25:10 +02:00
aquint-zama
ae992e4cdc docs: move to sphinx
relates #15
2021-07-15 16:56:53 +02:00
Arthur Meyre
e45cd6cc86 build: add github actions workflow for PR checks
refs #15
2021-07-15 15:31:53 +02:00
Arthur Meyre
58e35136f5 chore(tools): add Makefile, formatting script, pylintrc and dependencies
refs #15
2021-07-15 11:46:19 +02:00
Arthur Meyre
8c61a12581 chore(tools): setup poetry and bare hdk package
refs #15
2021-07-15 11:09:17 +02:00
Arthur Meyre
68a6244593 docs(dev): add ARCHITECTURE.md and initial frontend flow 2021-07-15 11:00:42 +02:00
Arthur Meyre
2365a34b2a chore(tooling): add .editorconfig 2021-07-15 10:55:55 +02:00
Arthur Meyre
ae2041202f chore: add github issue templates 2021-07-15 10:55:22 +02:00
Arthur Meyre
d8a8565f16 Initial commit 2021-07-12 16:36:22 +02:00
Andi Drebes
cef0e569d4 fix(compiler): Generate and include autogenerated dialect definitions (#52)
* 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>
2021-07-08 15:54:10 +01:00
Andi Drebes
3bfda58eb8 feat(compiler): Make HLFHE.EncryptedInteger usable as memref element type
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`.
2021-06-23 10:15:35 +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
c783d85a84 doc(compiler): comments on MidLFHE verifiers 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
Quentin Bourgerie
d489f91f7d chore(compiler/ci): Update mlir image 2021-06-23 10:07:16 +02:00
Ben
4eca16bf95 update code add results 2021-06-21 16:44:34 +01:00
Ben
72f0af5cf4 update scripts 2021-06-17 13:33:52 +01:00
Quentin Bourgerie
af23854480 fix(compiler): Fixing some step to speedup the build of the container of the mlir-env 2021-06-16 14:31:21 +02:00
Quentin Bourgerie
b948c5c6a5 chore(compiler): Actions for build and test compiler 2021-06-16 14:31:21 +02:00
Andi Drebes
428ba24807 style(compiler): Use header guards conforming to style from .clang-tidy 2021-06-11 10:46:03 +02:00
Andi Drebes
5167781e44 ci(compiler): Add option --fix to lint_cpp.sh
Add an option `--fix` to `lint_cpp.sh` advising `clang-tidy` to apply
suggested fixes.
2021-06-11 10:45:00 +02:00
Andi Drebes
bf101e5147 ci(compiler): Add script for C++ linting
Add script `.github/workflows/scripts/lint_cpp.sh` that runs
`clang-tidy` with the right parameters to limit checks to source files
not generated automatically.

The script must be run from within the build directory as it relies on
`compiler_commands.json` and `CMakeFiles/CMakeDirectoryInformation.cmake`.
2021-06-08 14:26:42 +02:00
Andi Drebes
5ef78f37f3 ci(compiler): Add clang-tidy configuration file
Add configuration file for `clang-tidy` with the same settings as
MLIR.
2021-06-08 14:26:42 +02:00
Andi Drebes
2c4748b414 refactor(compiler): Use LLVM command line parser instead of tclap
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.
2021-06-08 14:05:15 +02:00
Ayoub Benaissa
eef82a4713 style(compiler): c++ formatting with github action (#22)
* style(compiler): c++ formatting with github action

* style(compiler): update format script
2021-06-04 09:18:14 +02:00
Andi Drebes
5164126447 style: Add .clang-format 2021-06-04 09:18:14 +02:00
Ben
8650a0969a organise params 2021-06-03 10:09:12 +01:00
Ben
00e23fd5b8 organise figs 2021-06-03 10:07:56 +01:00
Ben
9b2e791de0 add figs 2021-06-03 10:04:17 +01:00
Ben
2bebecd72f add plot 2021-06-03 09:36:12 +01:00
Ben
0f8c705825 update plot 2021-05-31 10:02:48 +01:00
Ben
58a9f6c5a7 second figure to compare with other sd 2021-05-31 09:58:04 +01:00
Ben
b815bde0fd using torus_sd instead 2021-05-31 09:54:32 +01:00
youben11
4e663df5af enhance(compiler): Add a region to the HLFHE.apply_univariate for the expression of the univariate closure 2021-05-28 12:08:42 +02:00
youben11
183fe7f6fa chore: gitignore 2021-05-28 12:08:42 +02:00
Quentin Bourgerie
f0615da12a fix(compiler): segfault on parse error 2021-05-28 12:08:42 +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