Commit Graph

908 Commits

Author SHA1 Message Date
youben11
7d785eebec feat(rust): support serialization 2022-12-05 17:17:53 +01:00
youben11
fbc60097ab refactor(rust): resolve artifacts' path and better stringRef mgmnt 2022-12-05 17:17:53 +01:00
youben11
ad988de9a3 feat(CAPI): add CompilationFeedback API 2022-12-05 17:17:53 +01:00
rudy
75dd26d0ab feat: bench do not keygen on all keys 2022-12-05 13:57:54 +01:00
Quentin Bourgerie
07c1e8347e refactor(tests): Refactor test tools to easiest run tests with description files and different compilation options 2022-12-05 13:57:54 +01:00
rudy
1f7878b961 fix: LICENSE.txt ending newline 2022-12-05 12:35:26 +01:00
Quentin Bourgerie
4bcb21de63 chore(license): Update license to BSD3-clause-clear 2022-12-05 11:44:52 +01:00
Quentin Bourgerie
1f45b9dfa5 fix(compiler): Do not rely on the input type on ConcreteToBConcrete conversion as it could be already rewritten by a previous pattern (close #809) 2022-12-03 04:19:37 +01:00
youben11
f05b1bd1ea feat(rust): support execution with tensor args 2022-12-02 14:03:02 +01:00
youben11
16f3b0bbf6 feat(rust): manage erros coming from compiler
C struct now contains an additonal char* pointer, which can be either
NULL in case there is no error, or a buffer containing the error
message. It's the responsability of destructor function to free that
memory.
2022-12-02 14:03:02 +01:00
youben11
15b4aac0a1 feat(rust): support keygen, encryption, execution 2022-12-02 14:03:02 +01:00
youben11
7f55385ea2 feat(rust): load server lambda for later execution 2022-12-02 14:03:02 +01:00
youben11
b00115f4ae feat(rust): compile mlir into library
CAPI covering a wider API of the Support library.
Better error handling. Could also be improved by returning an error
message back from C to rust (left TODO).
2022-12-02 14:03:02 +01:00
Quentin Bourgerie
8a557368f1 chore(ci): Stay on ubuntu 20.4 for github runners to fix the release process 2022-12-01 23:18:34 +01:00
Quentin Bourgerie
b171bc3c48 chore(ci): Specify the python executable for running tests 2022-11-30 14:41:40 +01:00
Quentin Bourgerie
20b4479d0f chore(builders): Fix a specific tag for our many linux base image 2022-11-30 14:39:09 +01:00
Quentin Bourgerie
0f88dd4bcb fix(ci): Fixing mac os ci 2022-11-30 11:17:48 +01:00
Quentin Bourgerie
50973a39bd refactor(compiler): Remove async offloading of BS/KS 2022-11-30 10:29:19 +01:00
Quentin Bourgerie
9e16f31b87 refactor(bconcrete): Separate bufferization and CAPI call generation 2022-11-30 10:29:19 +01:00
Quentin Bourgerie
fccb6da5b1 fix(check-tests): Just run llvm-lit in check_tests subdirectory 2022-11-30 10:29:19 +01:00
Quentin Bourgerie
3efa8eb2a9 refactor(tests): Use f-strings in linalg_apply_lookup_table generator 2022-11-30 10:02:07 +01:00
Quentin Bourgerie
6eb4cec706 fix(wopbs): Fixing woppbs with tensor operators (close #789)
- Missing offset in woppbs routine
- Better error message for check of tensor result in end to end fixture
- Modify fixture generator for testing purpose
2022-11-30 10:02:07 +01:00
Quentin Bourgerie
292cce04c3 enhance(clientlib): Use the parallel version for generating packing keys 2022-11-30 10:00:37 +01:00
rudy
ddb2b7fa58 fix(ci): more robust keysetcache download 2022-11-29 09:28:57 +01:00
Luis Montero
30be8cf4ae fix: fix MacOS test launching
* Update makefile to use appropriate arguments to find executables on
  macos systems.
* Add `set -e` to make sure that the tests crash if something goes wrong
  in the build or test of the macos job of the CI.

closes #783
2022-11-25 09:48:45 +01:00
Quentin Bourgerie
3bade6603a fix(compiler): Fix lowering of tensor.from_elements with crt 2022-11-24 16:30:37 +01:00
Quentin Bourgerie
5d89ad0f84 enhance(feedback): Add p_error and global_perror to the compiler feedback 2022-11-24 09:59:19 +01:00
Umut
722e4d2eba feat: give crt decomposition feedback 2022-11-24 09:59:19 +01:00
David Testé
1e8c0df381 chore(ci): change benchmark parser input name
The use of "schema" was incorrect since it's meant to be used as
database name when sending data to Slab.
2022-11-23 16:22:17 +01:00
youben11
7f65f4f527 fix(ci): set env var to look for lib in build/lib
LD_LIBRARY_PATH is set to BUILD_DIR/lib during rust tests in order to
find the runtime lib which it depends on
2022-11-23 14:01:25 +01:00
youben11
2877281aa6 chore(ci): re-enable rust tests in the CI
they were mostly removed by a rebase
2022-11-23 14:01:25 +01:00
youben11
96c958bd06 feat(rust): add compiler module with round_trip feature 2022-11-23 14:01:25 +01:00
youben11
5661b758d7 feat(CAPI): add initial API to do round-tripping with CompilerEngine 2022-11-23 14:01:25 +01:00
youben11
824aaaeff5 refactor(rust): separate generated CAPI under ffi module 2022-11-23 14:01:25 +01:00
youben11
c0d007e396 refactor: separate python bindings wrapper from CAPI
current CAPI of CompilerEngine isn't really a CAPI. It's initial need
was for the python bindings to have access to the CompilerEngine through
a convenient API. So we now make a clear separation of CAPI and python
wrappers. So we now have wrappers functions, that can be implemented
using C/C++, and will be exposed to python via pybind11. And we have a
CAPI (still need fixing as it still contains C++ code), that can be used
as is, or to build bindings for other languages (such as Rust).
2022-11-23 14:01:25 +01:00
rudy
454edbb538 fix(ci): KeySetCache pruning was broken 2022-11-22 17:28:40 +01:00
rudy
c20b10194f fix: optimizer display, nan proba and 0 complexity
Resolves zama-ai/concrete-optimizer#201
Resolves zama-ai/concrete-optimizer#202
Resolves zama-ai/concrete-optimizer#204
2022-11-22 11:55:16 +01:00
Andi Drebes
fd362342f5 fix(compiler): Batching: Emit collapse/expand shape operations only for rank > 1
The batching pass passes operands to the batched operation as a flat,
one-dimensional vector produced through a `tensor.collapse_shape`
operation collapsing all dimensions of the original tensor of
operands. Similarly, the shape of the result vector of the batched
operation is expanded to the original shape afterwards using a
`tensor.expand_shape` operation.

The pass emits the `tensor.collapse_shape` and `tensor.expand_shape`
operations unconditionally, even for tensors, which already have only
a single dimension. This causes the verifiers of these operations to
fail in some cases, aborting the entire compilation process.

This patch lets the batching pass emit `tensor.collapse_shape` and
`tensor.expand_shape` for batched operands and batched results only if
the rank of the corresponding tensors is greater than one.
2022-11-21 14:53:43 +01:00
David Testé
3c2a75186f chore(ci): run ml benchmarks in a matrix with slab
This CI "feature" is meant to circumvent the 6 hours hard-limit
for a job in GitHub Action.
The benchmark is done using a matrix which is handled by Slab.
Here's the workflow:

  1. ML benchmarks are started in a fire and forget fashion via
     start_ml_benchmarks.yml
  2. Slab will read ci/slab.toml to get the AWS EC2 configuration
     and the matrix parameters
  3. Slab will launch at most max_parallel_jobs EC2 instances in
     parallel
  4. Each job will trigger ml_benchmark_subset.yml which will run
     only one of the generated YAML file via make generate-mlbench,
     based on the value of the matrix item they were given.
  5. As soon as a job is completed, the next one in the matrix
     will start promptly.

This is done until all the matrix items are exhausted.
2022-11-21 11:25:40 +01:00
Quentin Bourgerie
8e4be10eb9 chore(bench): Better number of ct for benchmarks 2022-11-21 11:18:23 +01:00
rudy
a8e2724b69 fix: use less error prone json parsing for CompilationFeedback
Both the error message and the type were wrong for complexity
2022-11-18 17:27:07 +01:00
Mayeul@Zama
0657767bae style(cmake): run format_cmake.sh 2022-11-18 15:15:41 +01:00
Mayeul@Zama
fa3556e8cc feat(CI): add cmake-format CI job 2022-11-18 15:15:41 +01:00
Andi Drebes
84e0742fbe test(compiler): Add check tests for batching pass 2022-11-18 12:06:07 +01:00
Andi Drebes
ef26c73cb8 test(compiler): Add end-to-end test for batched operations
This adds a new end-to-end test `apply_lookup_table_batched`, which
forces batching of Concrete operations when invoking the compiler
engine, indirectly causing the `concrete.bootstrap_lwe` and
`concrete.keyswitch_lwe` operations generated from the
`FHELinalg.apply_lookup_table` operation of the test to be batched
into `concrete.batched_bootstrap_lwe` and
`concrete.batched_keyswitch_lwe` operations. The batched operations
trigger the generation of calls to batching wrapper functions further
down the pipeline, effectively testing the lowering and implementation
of batched operations altogether.
2022-11-18 12:06:07 +01:00
Andi Drebes
46366eec41 feat(compiler): Add fallback implementations for batched keyswitch and bootstrap
Add default implementations for batched keyswitch and bootstrap, which
simply call the scalar versions of these operations in a loop.
2022-11-18 12:06:07 +01:00
Andi Drebes
9f153d2129 feat(compiler): ConcreteToBConcrete: Add patterns for batched keyswitch and bootstrap 2022-11-18 12:06:07 +01:00
Andi Drebes
d46db1bf69 feat(compiler): BConcrete: Add batched keyswitch and bootstrap 2022-11-18 12:06:07 +01:00
Andi Drebes
c9bb6541e9 feat(compiler): Add option --batch-concrete-ops and action dump-concrete-with-loops
The new option `--batch-concrete-ops` invokes the batching pass after
lowering to the Concrete dialect and after lowering linalg operations
with operations from the Concrete dialect to loops.

The new action `dump-concrete-with-loops` dumps the IR right before
batching.
2022-11-18 12:06:07 +01:00
Andi Drebes
75b70054b2 feat(compiler): Make Concrete.bootstrap_lwe and Concrete.keyswitch_lwe batchable 2022-11-18 12:06:07 +01:00