feat(compiler): First draft to support FHE.eint up to 16bits

For now what it works are only levelled ops with user parameters. (take a look to the tests)

Done:
- Add parameters to the fhe parameters to support CRT-based large integers
- Add command line options and tests options to allows the user to give those new parameters
- Update the dialects and pipeline to handle new fhe parameters for CRT-based large integers
- Update the client parameters and the client library to handle the CRT-based large integers

Todo:
- Plug the optimizer to compute the CRT-based large interger parameters
- Plug the pbs for the CRT-based large integer
This commit is contained in:
Quentin Bourgerie
2022-06-20 11:01:06 +02:00
parent 58527a44c3
commit 8cd3a3a599
82 changed files with 3192 additions and 1037 deletions

View File

@@ -234,6 +234,9 @@ llvm::json::Value toJSON(const Encoding &v) {
llvm::json::Object object{
{"precision", v.precision},
};
if (!v.crt.empty()) {
object.insert({"crt", v.crt});
}
return object;
}
bool fromJSON(const llvm::json::Value j, Encoding &v, llvm::json::Path p) {
@@ -248,6 +251,18 @@ bool fromJSON(const llvm::json::Value j, Encoding &v, llvm::json::Path p) {
return false;
}
v.precision = precision.getValue();
auto crt = obj->getArray("crt");
if (crt != nullptr) {
for (auto dim : *crt) {
auto iDim = dim.getAsInteger();
if (!iDim.hasValue()) {
p.report("dimensions must be integer");
return false;
}
v.crt.push_back(iDim.getValue());
}
}
return true;
}