Support bootstrap in Mgmt/CKKS dialect and correctly determine MgmtAttr / RNS level
Mainly from #1195, where a low-level openfhe.bootstrap is added but higher level of the compiler is not aware of how to manage it.
-
mulDepth is now interwined with bootstrap, hence all the RNS instantiation need to change. and #1176 way could not handle this. Should introduce a
mgmt.bootstrapop and implement a bootstrap management pass (possibly related to #289, #1166).- I think the naive one is to greedily insert it when all level consumed, to get the pipeline running, then we will take time to optimize it instead of starting from complex solutions.
-
ckks does not have a bootstrap op for now.
I think the naive one is to greedily insert it when all level consumed, to get the pipeline running, then we will take time to optimize it instead of starting from complex solutions.
+1, get something working first.
This issue has 5 outstanding TODOs:
- lib/Analysis/LevelAnalysis/LevelAnalysis.cpp:61: reset level to currentLevel - bootstrapDepth
- lib/Dialect/LWE/Conversions/LWEToOpenfhe/LWEToOpenfhe.cpp:290: Persist the number of consumed levels from bootstrapping
- lib/Dialect/Openfhe/Transforms/ConfigureCryptoContext.cpp:279: determine mulDepth earlier in mgmt level
- lib/Transforms/SecretInsertMgmt/Passes.td:94: handle it here so parameter selection can depend on it.
- lib/Transforms/SecretInsertMgmt/Passes.td:95: with this info we can encrypt at max level (with bootstrap consumed level).
This comment was autogenerated by todo-backlinks