mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-10 04:35:03 -05:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user