How do we extract circuit keys from MLIR?
Oh I was observing the compilation flow and was faced with a doubt that how are we actually generating the keys once we have mlir ,any way to observe each steps?
Key generation has the following stack in Python bindings:
- https://github.com/zama-ai/concrete/blob/9139101cc367c7c11752ca8afa9b396dbe9a9c73/compilers/concrete-compiler/compiler/lib/Bindings/Python/CompilerAPIModule.cpp#L352
- https://github.com/zama-ai/concrete/blob/9139101cc367c7c11752ca8afa9b396dbe9a9c73/compilers/concrete-compiler/compiler/lib/Bindings/Python/CompilerEngine.cpp#L170
- https://github.com/zama-ai/concrete/blob/9139101cc367c7c11752ca8afa9b396dbe9a9c73/compilers/concrete-compiler/compiler/include/concretelang/Support/LambdaSupport.h#L399
- https://github.com/zama-ai/concrete/blob/9139101cc367c7c11752ca8afa9b396dbe9a9c73/compilers/concrete-compiler/compiler/lib/ClientLib/KeySetCache.cpp#L265
- https://github.com/zama-ai/concrete/blob/9139101cc367c7c11752ca8afa9b396dbe9a9c73/compilers/concrete-compiler/compiler/lib/ClientLib/KeySet.cpp#L18
- https://github.com/zama-ai/concrete/blob/9139101cc367c7c11752ca8afa9b396dbe9a9c73/compilers/concrete-compiler/compiler/lib/ClientLib/KeySet.cpp#L71
You can go deeper from there, here is the example for secret keys:
- https://github.com/zama-ai/concrete/blob/9139101cc367c7c11752ca8afa9b396dbe9a9c73/compilers/concrete-compiler/compiler/lib/ClientLib/KeySet.cpp#L93
- https://github.com/zama-ai/concrete/blob/9139101cc367c7c11752ca8afa9b396dbe9a9c73/compilers/concrete-compiler/compiler/lib/ClientLib/EvaluationKeys.cpp#L62
- https://github.com/zama-ai/concrete/blob/9139101cc367c7c11752ca8afa9b396dbe9a9c73/backends/concrete-cpu/implementation/src/c_api/secret_key.rs#L15
- https://github.com/zama-ai/concrete/blob/9139101cc367c7c11752ca8afa9b396dbe9a9c73/backends/concrete-cpu/implementation/src/implementation/types/lwe_secret_key.rs#L57
…
Hope this answers your question!
1 Like