Concrete v2.9: Enhanced TFHE-rs Interoperability, Python 3.12 Support and Backend Updates

January 14, 2025
Quentin Bourgerie

The Concrete team is continuing its efforts to make the interoperability between TFHE-rs and Concrete more robust and feature-rich, and this effort can be seen on both the frontend and backend.

We are happy to announce that we have added support for Python 3.12, which can be used both in development and production environments.

You can find all the details, performance improvements, and bug fixes in the full release note.

Enhanced TFHE-rs interoperability

Concrete v2.8 introduced a tooling that enables the import of TFHE-rs ciphertexts into Concrete, allowing computations using the Concrete compiler and runtime, followed by exporting results back to the TFHE-rs ecosystem. However, this initial support was limited to signed integers and offered only partial support for tensors.

With Concrete v2.9, the support for signed integers has been expanded, as demonstrated in the example snippets below. Additionally, the bridge tool now fully supports the serialization and deserialization of tensors, enabling more complex use cases, such as running a linear machine learning model.

import concrete.fhe as fhe
from concrete.fhe import tfhers

# The tfhers signed integer type
tfhers_type = tfhers.int8_2_2(
   tfhers.CryptoParams(
       909,
       1,
       4096,
       15,
       2,
       0,
       2.168404344971009e-19,
       tfhers.EncryptionKeyChoice.BIG,
   )
)

# The concrete function with conversion from tfhers integers to concrete
@fhe.compiler({"x": "encrypted", "y": "encrypted"})
def add(x, y):
   x = tfhers.to_native(x)
   y = tfhers.to_native(y)
   return tfhers.from_native(x + y, tfhers_type)

# Define the inpuset with signed integers
inputset = [
   (tfhers.TFHERSInteger(tfhers_type, -128), tfhers.TFHERSInteger(tfhers_type, 127)),
   (tfhers.TFHERSInteger(tfhers_type, 0), tfhers.TFHERSInteger(tfhers_type, -128))
]
circuit = add.compile(inputset, verbose=True)

# Run the fhe evaluation by encoding/decodinhg arguments/result from/to tfhers signed integer type
print(
   tfhers_type.decode(
       circuit.encrypt_run_decrypt(tfhers_type.encode(1), tfhers_type.encode(-1))
   )
)

Python 3.12 support

Concrete is released on both the public zama pypi and the official pypi.org repository  for Python 3.8 to 3.12 from Linux and Mac OS platform, including CPU and GPU wheels.

Additional improvements

Concrete v2.9 includes various optimizations and bug fixes. Notably, the GPU kernels, now developed under the TFHE-rs GitHub repository, have been updated. In our experiments, these updates resulted in a slight performance improvement for large FHE evaluations.

These improvements require no changes to the API, allowing you to take advantage of the enhancements without extra effort. Give them a try and share your feedback with us! For more details, refer to the full release notes.

Thank you for your continued support and feedback. We remain committed to making FHE more accessible and efficient for everyone.

Additional links

Read more related posts

No items found.