Is Concrete the shared compiler backend?

Hey,

I have been experimenting with all the various libraries, building simple applications and reading their differences. I understand TFHE-rs and Concrete broke off as two distinct libraries. Concrete ML is built on top of Concrete for ML applications. Do TFHE-rs and Concrete share the same compiler backend, or do they have separate compilers? Which one should I use if I care about optimization and speed?

Hello @chacha_connell,

Concrete is a TFHE compiler that uses TFHE-rs for FHE operations. Your input program (in python) will be turned in a binary working on ciphered inputs, ciphered operations being computed by TFHE-rs library (as a Concrete Compiler backend).

TFHE-rs is a Rust library, it could be used standalone, giving you an API for FHE operations on ciphered inputs. Here the compiler is the classical Rust compiler, there is no FHE-aware transformation.

About optimizations and speed, it highly depend on your use case, while for simple arithmetics, you could have faster results with TFHE-rs as it is optimized for latency, in more complex use cases you could have better results with Concrete, that will re-arrange your program and find the most suited crypto parameters for speed and correctness (that’s why it’s used for ML applications at the moment).