Commit Graph

237 Commits

Author SHA1 Message Date
Quentin Bourgerie
3330b2f855 fix(compiler): Take care of program with no input when creating client parameters 2022-02-17 15:53:23 +01:00
Quentin Bourgerie
1f3944047f feature(compiler): Introduce the BConcrete Dialect 2022-02-17 15:53:23 +01:00
Umut
20a89b7b42 feat: implement concat operation 2022-02-15 16:52:07 +03:00
Umut
a1818a3fd9 feat: implement advanced sum operation 2022-02-08 17:49:58 +03:00
Antoniu Pop
dddad849c7 enhance(compiler): add --parallelize-loops and --parallelize-dataflow compile flags in addition to --parallelize which enables both. 2022-02-03 10:59:12 +00:00
Antoniu Pop
35e6966f95 enhance(dfr/runtime): throttle the number of HPX worker threads when using OpenMP for loop parallelism within tasks. 2022-02-03 10:59:12 +00:00
Antoniu Pop
ec633d57f6 fix(compiler): predicate OpenMP loop parallelization of Linalg on the --parallelize flag. 2022-02-03 10:59:12 +00:00
Quentin Bourgerie
f52965e22f enhance(compiler): Lower linalg to parallel loops and instantiare parallel loops with openmp 2022-02-03 10:59:12 +00:00
Antoniu Pop
260768e9af enhance(dfr): use linker wrapping of main in addition to start/stop; enable DFR+OpenMP. 2022-02-03 10:59:12 +00:00
Umut
4203e86998 feat: implement basic sum operation 2022-02-01 12:18:56 +03:00
youben11
71cccc6a89 fix(mac): add options for required libraries 2022-01-24 17:02:25 +00:00
youben11
faa0abea3e fix: use appropriate cmd for dynamic lib generation
macos and linux require a different cmd
2022-01-24 17:02:25 +00:00
youben11
2926ea6a5e fix: use appropriate type for optimizingTransformer func
the call does return an `std::function` and was being referenced using
an `llvm::function_ref`, which apparently with some optim on Mac was
referncing bad memory location
2022-01-24 17:02:25 +00:00
Umut
8198a79deb feat: introduce maximum bit width constant, use it where appropriate, export it in python bindings 2022-01-24 17:26:37 +03:00
Andi Drebes
39b80bd5b2 fix(compiler): Remove unused variables in TFHEGlobalParametrization.cpp 2022-01-07 12:03:13 +01:00
Andi Drebes
7062052ca6 fix(compiler): Remove unused variables in lib/Dialect/TFHE/IR/TFHEOps.cpp 2022-01-07 12:03:13 +01:00
Andi Drebes
ce9d86014d fix(compiler): Force same signedness of integers in _verifyGLWEIntegerOperator 2022-01-07 12:03:13 +01:00
Andi Drebes
d83a462e20 fix(compiler): Fix initialization order in constructor of MaxMANPPass 2022-01-07 12:03:13 +01:00
Andi Drebes
0b73586178 fix(compiler): Fix initialization order in constructor of MANPAnalysis 2022-01-07 12:03:13 +01:00
Andi Drebes
258480dab6 fix(compiler): Remove unused variable in lib/Dialect/FHE/Analysis/MANP.cpp 2022-01-07 12:03:13 +01:00
Andi Drebes
94f160eef1 fix(compiler): Remove unused variables in lib/Dialect/FHE/IR/FHEOps.cpp 2022-01-07 12:03:13 +01:00
Andi Drebes
498505c2f8 fix(compiler): Remove unused variable err in lib/ClientLib/KeySet.cpp 2022-01-07 12:03:13 +01:00
Andi Drebes
0284e06016 fix(compiler): Remove unused variable err in lib/Runtime/context.cpp 2022-01-07 12:03:13 +01:00
Quentin Bourgerie
4ecae140ca doc(compiler): Enhance FHE Dialect documentation 2022-01-06 18:07:19 +01:00
youben11
2009ee1c94 chore: changing ref to repo after its renaming
also formatting and update the check_license script to match that
2022-01-06 12:40:10 +01:00
rudy
58e02fd035 feat(Testlib): lib for testing libs generated by concretecompiler
Closes #201
2022-01-05 09:29:57 +01:00
Antoniu Pop
8f71c331d4 fix(runtime): formatting. 2022-01-04 12:43:33 +01:00
Antoniu Pop
93835e0106 fix(runtime): move deallocation of key clones in context destructor. 2022-01-04 12:43:33 +01:00
Antoniu Pop
066a3d4e17 fix(runtime): remove strucutred binding as incompatible with C++ standard version. 2022-01-04 12:43:33 +01:00
Antoniu Pop
9deaa1400e chore: add missing license header. 2022-01-04 12:43:33 +01:00
Antoniu Pop
84f01f78d6 fix(runtime/DFR): create only one BSK clone per thread and deallocate. 2022-01-04 12:43:33 +01:00
youben11
492ce3309a chore(python): change version file
we don't want the version file to be included in the package to not
clash with version files of other subpackages, as it should be part of
the bigger concrete namespace package
2022-01-04 09:28:42 +01:00
youben11
0bbacdbb17 chore(python): rename package to concrete-compiler 2022-01-04 09:24:49 +01:00
rudy
b8bd38dd6c feat(compiler): Output client parameters when compile to a library
close #198
2022-01-03 17:57:16 +01:00
youben11
c276e13d97 chore(python): add namespace init file 2022-01-03 15:27:24 +01:00
youben11
f1161f7f6d chore: formatting
Quick fix due to ordering of includes, had to add #include
<mlir/Transforms/DialectConversion.h> to include/concretelang/Conversion/Utils/GenericOpTypeConversionPattern.h
2022-01-03 09:29:19 +01:00
youben11
940cb96be4 chore: rename dialects
HLFHE to FHE
MidLFHE to TFHE
LowLFHE to Concrete
2021-12-29 15:13:34 +01:00
youben11
47ef595a2a chore: use namespace concrete for the py package
Compiler tools such as CompilerEngine would now be imported from
concrete.compiler
Dialects would now be imported from concrete.lang.dialects
And anything related to concretelang can be imported directly from
concrete.lang
2021-12-29 15:13:34 +01:00
youben11
e73291abdc chore: rename compiler to concrete-compiler
zamalang => concretelang
zamacompiler => concretecompiler
2021-12-29 15:13:34 +01:00
youben11
971cb56182 chore: licensing 2021-12-29 15:13:34 +01:00
rudy
d8fee32cea feat(HLFHELinalg): add apply_mapped_table_lookup
Resolves #182
2021-12-27 15:34:33 +01:00
Antoniu Pop
cdca7ca6f7 feat(compiler): add Dataflow/RT dialect and code generation for dataflow auto parallelization. 2021-12-23 15:57:53 +00:00
Quentin Bourgerie
db683f4a0e feat(compiler/runtime): Introduce a RT dialect 2021-12-23 15:57:53 +00:00
Antoniu Pop
bc3d647453 fix(dfr): make HPX runtime environment persistent and deallocate temporaries. 2021-12-23 15:57:53 +00:00
Antoniu Pop
2cba686c66 fix(runtime): enable concurrent key usage by cloning it on get operation. 2021-12-23 15:57:53 +00:00
rudy
5ed2dcb3c1 fix(compiler): MANP segfault bug in case of missing MANP value 2021-12-20 10:40:58 +01:00
rudy
7a286ba9f9 fix(KeySetCache): handle concurrent generation
Resolves #305
2021-12-20 10:07:48 +01:00
Andi Drebes
f319ba37d2 feat(compiler): Integrate HLFHELinalg tiling passes into compilation pipeline 2021-12-17 16:09:59 +01:00
Andi Drebes
bc75831c86 feat(compiler): Add passes for tiling of HLFHELinalg.matmul_eint_int
Add two passes related to the tiling of `HLFHELinalg.matmul_eint_int`
operations.

The `HLFHELinalgTilingMarker` pass takes a vector of tile sizes and
adds an integer array attribute "tile-sizes" to each instance of
`HLFHELinalg.matmul_eint_int`, e.g.,

  "HLFHELinalg.matmul_eint_int"(%arg0, %arg1) {"tile-sizes" = [2, 2, 2]} :
    (tensor<4x2x!HLFHE.eint<6>>, tensor<2x2xi7>) -> tensor<4x2x!HLFHE.eint<6>>

The `HLFHELinalgTiling` performs the actual tiling of each
`HLFHELinalg.matmul_eint_int` operation marked with a "tile-sizes"
attribute. The tiling preserves the level of abstraction of
HLFHELinalg and is implemented as a perfect loop nest of SCF for loops
with a `HLFHELinalg.matmul_eint_int` in the body.

For example,

  func @main(%arg0: tensor<4x2x!HLFHE.eint<6>>, %arg1: tensor<2x2xi7>)
    -> tensor<4x2x!HLFHE.eint<6>>
  {
    %0 = "HLFHELinalg.matmul_eint_int"(%arg0, %arg1) {"tile-sizes" = [2, 2, 2]} :
           (tensor<4x2x!HLFHE.eint<6>>, tensor<2x2xi7>) -> tensor<4x2x!HLFHE.eint<6>>
    return %0 : tensor<4x2x!HLFHE.eint<6>>
  }

becomes:

  func @main(%arg0: tensor<4x2x!HLFHE.eint<6>>, %arg1: tensor<2x2xi7>)
    -> tensor<4x2x!HLFHE.eint<6>>
  {
    %c2 = arith.constant 2 : index
    %c0 = arith.constant 0 : index
    %c4 = arith.constant 4 : index

    %0 = "HLFHELinalg.zero"() : () -> tensor<4x2x!HLFHE.eint<6>>
    %1 = scf.for %arg2 = %c0 to %c4 step %c2 iter_args(%arg3 = %0)
           -> (tensor<4x2x!HLFHE.eint<6>>) {
      %2 = scf.for %arg4 = %c0 to %c2 step %c2 iter_args(%arg5 = %arg3)
             -> (tensor<4x2x!HLFHE.eint<6>>) {
        %3 = scf.for %arg6 = %c0 to %c2 step %c2 iter_args(%arg7 = %arg5)
	       -> (tensor<4x2x!HLFHE.eint<6>>) {
          %4 = tensor.extract_slice %arg0[%arg2, %arg4] [2, 2] [1, 1] :
	         tensor<4x2x!HLFHE.eint<6>> to tensor<2x2x!HLFHE.eint<6>>
          %5 = tensor.extract_slice %arg1[%arg4, %arg6] [2, 2] [1, 1] :
	         tensor<2x2xi7> to tensor<2x2xi7>
          %6 = tensor.extract_slice %arg7[%arg2, %arg6] [2, 2] [1, 1] :
	         tensor<4x2x!HLFHE.eint<6>> to tensor<2x2x!HLFHE.eint<6>>

          %7 = "HLFHELinalg.matmul_eint_int"(%4, %5) :
	         (tensor<2x2x!HLFHE.eint<6>>, tensor<2x2xi7>)
		 -> tensor<2x2x!HLFHE.eint<6>>

          %8 = "HLFHELinalg.add_eint"(%6, %7) :
	         (tensor<2x2x!HLFHE.eint<6>>, tensor<2x2x!HLFHE.eint<6>>)
		 -> tensor<2x2x!HLFHE.eint<6>>

          %9 = tensor.insert_slice %8 into %arg7[%arg2, %arg6] [2, 2] [1, 1] :
	         tensor<2x2x!HLFHE.eint<6>> into tensor<4x2x!HLFHE.eint<6>>

          scf.yield %9 : tensor<4x2x!HLFHE.eint<6>>
        }
        scf.yield %3 : tensor<4x2x!HLFHE.eint<6>>
      }
      scf.yield %2 : tensor<4x2x!HLFHE.eint<6>>
    }
    return %1 : tensor<4x2x!HLFHE.eint<6>>
  }

Only full tiles are supported, i.e., the size of the dimensions of the
operands must be a multiple of the respective tile sizes.
2021-12-17 16:09:59 +01:00
Andi Drebes
27ca5122bc enhance(compiler): Use named constant for the default pattern rewriting benefit
This introduces a new header file `zamalang/Support/Constants.h` for
constants, currently only populated with a constant for the default
pattern rewriting benefit of 1.
2021-12-17 15:28:21 +01:00