Commit Graph

858 Commits

Author SHA1 Message Date
Andi Drebes
c367a4b6fd feat(compiler): Add batching pass
This adds a new pass that is able to hoist operations implementing the
`BatchableOpInterface` out of a loop nest that applies the operation
to the elements of a tensor indexed by the loop induction variables.

Example:

  scf.for %i = c0 to %cN step %c1 {
    scf.for %j = c0 to %cM step %c1 {
      scf.for %k = c0 to %cK step %c1 {
        %s = tensor.extract %T[%i, %j, %k]
        %res = batchable_op %s
        ...
      }
    }
  }

is replaced with:

  %batchedSlice = tensor.extract_slice
       %T[%c0, %c0, %c0] [%cN, %cM, %cK] [%c1, %c1, %c1]
  %flatSlice = tensor.collapse_shape %batchedSlice
  %resTFlat = batchedOp %flatSlice
  %resT = tensor.expand_shape %resTFlat

  scf.for %i = c0 to %cN step %c1 {
    scf.for %j = c0 to %cM step %c1 {
      scf.for %k = c0 to %cK step %c1 {
        %res = tensor.extract %resT[%i, %j, %k]
        ...
      }
    }
  }

Every index of the tensor with the input values may be a quasi-affine
expression on a single loop induction variable, as long as the
difference between the results of the expression for any two
consecutive values of the referenced loop induction variable is
constant.
2022-11-18 12:06:07 +01:00
Andi Drebes
3ce7c96f3f feat(compiler): Add operation interface for batchable operations
This adds a new operation interface that allows an operation to
specify that a batched version of the operation exists that applies it
on the elements of a flat tensor in parallel.
2022-11-18 12:06:07 +01:00
Antoniu Pop
c5ceccaeee tests: disable dataflow tests when compiler not built with dataflow support. 2022-11-17 16:37:44 +00:00
youben11
52d5d908bb test(rust): complete tests of rust bindings
updated also the API to make it easier to use by:
- creating MLIR components from native rust types instead of require
  MLIR components in the API
- adding helpers around the creation of standard dialects
2022-11-17 09:54:51 +01:00
youben11
5b46a74b7f feat(CAPI): API to get the width of an eint/esint 2022-11-17 09:54:51 +01:00
youben11
5576d1d176 feat(CAPI): expose encrypted signed int in CAPI 2022-11-17 09:54:51 +01:00
youben11
0a57af37af feat(rust): add API for FHEDialect's op creation 2022-11-17 09:54:51 +01:00
youben11
ff3f1afd59 refactor(rust): separate API into modules
- mlir module contains the MLIR API and generic helper functions
- fhe module contains helper functions for the FHE dialect
2022-11-17 09:54:51 +01:00
youben11
5e1a6f0069 feat(rust): complete FHE dialect API
helper functions to create all operations of the FHE dialect
2022-11-17 09:54:51 +01:00
Luis Montero
aad2a42634 chore(ffi): support ARM64 chips 2022-11-17 01:04:36 +01:00
rudy
76c58c6305 fix: optimizer AST update 2022-11-16 11:44:46 +01:00
Samuel Tap
8a231974f7 chore(ffi): update to concrete-ffi without fftw 2022-11-16 11:44:46 +01:00
David Testé
77729514e0 chore(ci): parse benchmark results to send to postgres instance
Previousely, we were sending parsed benchmark results to a
Prometheus instance. Do to its time-series nature, Prometheus would
downsample database content to avoid having to much data points
for a given range of time. While this behavior is good for a
continuous stream of data, like monitoring CPU load, it's not suited
for benchmarks. Indeed benchmarks are discrete events that would
occurr once in a while (i.e once a day). Downsampling would, at
some point, simply omit some of benchmarks results.
Using a regular SQL database like PostgreSQL solves this issue.
2022-11-15 16:18:25 +01:00
Mayeul@Zama
e99d8d6e2c chore: activate Wall Werror on Mac 2022-11-14 14:04:46 +01:00
Mayeul@Zama
f26abad001 chore(compiler): fix return-type-c-linkage 2022-11-14 14:04:46 +01:00
Mayeul@Zama
28594db536 chore(compiler): fix c++11-narrowing 2022-11-14 14:04:46 +01:00
Mayeul@Zama
aaad84ee63 chore(compiler): fix string-conversion 2022-11-14 14:04:46 +01:00
Mayeul@Zama
ddbf4cf8e4 chore(compiler): disable dollar-in-identifier-extension 2022-11-14 14:04:46 +01:00
Mayeul@Zama
2a6d1958fd chore(compiler): remove unused loopParallelize 2022-11-14 14:04:46 +01:00
Mayeul@Zama
dd62896bc8 chore(compiler): fix pessimizing-move 2022-11-14 14:04:46 +01:00
Mayeul@Zama
39c5d46a50 style(compiler): format CMakeLists.txt 2022-11-14 14:04:46 +01:00
rudy
1abea50ff8 chore(ci): only cancel continuous-integration.yml on PR update 2022-11-14 11:09:03 +01:00
rudy
1bce0f3c01 fix: error rate test, no p_error overriding global_p_error 2022-11-14 11:08:18 +01:00
rudy
5db1b7a27c chore(benchmark): compile then download 2022-11-14 11:06:47 +01:00
rudy
5b92ed151c chore(ci): build before download test cache 2022-11-09 16:14:29 +01:00
youben11
472e762fbf feat(rust): enhance API to create func with FHE dialect 2022-11-09 12:53:25 +01:00
youben11
eabd8b959d fix(CAPI): remove Cpp code from CAPI
this required to have a CAPI that when asked for types, returns a
structure that can report if an error was faced during type creation.
This is required since a failure at that stage in the compiler would
lead to a segfault in the python bindings for example, and we want to be
able to handle this scenario gracefully.
2022-11-09 12:53:25 +01:00
Quentin Bourgerie
84041557ab enhance(bench): Add benchmark generator for leveled operators 2022-11-08 14:27:30 +01:00
Antoniu Pop
dfe2e5e076 fix(runtime): remove logging the thread to HW bind map for dataflow workers. 2022-11-07 09:22:21 +00:00
Antoniu Pop
94d68515d4 fix(runtime): remove logs for dataflow task execution. 2022-11-07 09:22:21 +00:00
Quentin Bourgerie
0787eeb7e9 fix(bench): Fix linalg apply_lookup table generator that didn't well print separator 2022-11-04 15:42:46 +01:00
Quentin Bourgerie
ec0f49431b chore(bench): Rename default options to cpu 2022-11-04 11:03:19 +01:00
Quentin Bourgerie
46ec919abf fix(bench): Compiler options was badly set 2022-11-04 11:03:19 +01:00
rudy
018684fe2a chore: activate Wall Werror 2022-11-04 10:44:46 +01:00
tmontaigu
6b0f6e9f10 feat(rust): print mlir string repr directly into a String
Instead of overriding the process stderr to get
the string representation from mlir we can can
directly capture in into a string using mlir's
printOperation.

Another problem with overriding stderr is that
each `#[test]` runs as a different thread meaning that
as soon as we have 2+ tests the tests could panic
due to conflicts/races between the different overrides.

This also moves the expected string directly into the test
as a literal.
2022-11-03 22:16:24 +01:00
David Testé
d1db4a5e45 tests(benchmarks): reduce number of test cases to speed-up execution
Bench just one compilation option for automatic benchmarks. Only 'loop'
option is tested to take advantage of hardware with a lot of available
CPUs. Running benchmarks with 'default' option is suboptimal for this
kind of hardware since it uses only one CPU.

This also remove time consuming MNIST test, as it should be in ML benchmarks.

Moreover Makefile is fixed to use provided Python executable instead of
relying on system one to generate MLIR Yaml files.
2022-11-03 19:07:39 +01:00
youben11
078a82c1a4 fix(ci): use specific python binary
setup-python seems to choose a binary that lead to issues while trying
to install the wheeled package
2022-11-03 13:29:11 +01:00
Ayoub Benaissa
1c954dd85c fix(ci): install libtinfo required later in the linking 2022-11-03 10:29:31 +01:00
Ayoub Benaissa
f128982756 fix(docker): use bash as a shell
also uses directly the root home folder
2022-11-02 19:16:44 +01:00
Ayoub Benaissa
5269250908 fix(docker): add rust binary dir to PATH 2022-11-02 16:43:13 +01:00
youben11
e3e1602fe8 fix(ci): set python to 3.10 in macos test runner
default is now 3.11 which we don't support yet, mainly due to our
version of pybind11. 2.10.1 is the first pybind11 version to supports it
2022-11-02 14:46:38 +01:00
youben11
e40c6392cb ci: build and test rust bindings 2022-11-02 14:46:38 +01:00
youben11
0ac21fd037 feat: add rust bindings
The rust bindings are intented to access both LLVM/MLIR CAPI as well as
the concrete-compiler one. This initial commit provide the API for
LLVM/MLIR only. Tests should be used as an example to how to generate a
valid DAG of operations in MLIR.
2022-11-02 14:46:38 +01:00
rudy
0493030033 fix: typo DEFAULT_STRATEGY_V0 2022-11-02 09:33:37 +01:00
Antoniu Pop
746b7c2641 fix(dataflow build): fix HPX installation path when built and installed locally. 2022-10-25 09:50:51 +01:00
rudy
9156502a5a fix(ci): bump actions versions
to remove reprecation warning about nodejs 12
2022-10-24 15:08:54 +02:00
rudy
c684d658dc fix: use global p error for error rate test 2022-10-21 09:24:59 +02:00
Quentin Bourgerie
d934553950 feat(compiler/gpu): Integrate gpu crypto optimization 2022-10-20 10:36:32 +01:00
Quentin Bourgerie
a5047586f4 test(benchmark): Add more micro benchmarks on parallel lookup table 2022-10-20 10:36:32 +01:00
Quentin Bourgerie
f91514e7ff refactor(tests): Quick refactor of the test instantiation and include the gpu options for all e2e tests 2022-10-20 10:36:32 +01:00