HPU acceleration
Last updated
Was this helpful?
Last updated
Was this helpful?
This guide explains how to update your existing program to leverage HPU acceleration, or to start a new program using HPU.
TFHE-rs now supports a HPU backend based on FPGA implementation, enabling integer arithmetic operations on encrypted data.
An installed on a server running Linux with kernel 5.15.0-*
A HPU bitstream that you can find (or build) in and load in V80 flash and FPGA using its
AMI linux device driver version from this
QDMA linux device driver version from this
Rust version - check this
To use the TFHE-rs HPU backend in your project, add the following dependency in your Cargo.toml
.
For optimal performance when using TFHE-rs, run your code in release mode with the --release
flag.
TFHE-rs HPU backend is supported on Linux (x86, aarch64).
Linux
Supported
Unsupported
macOS
Unsupported
Unsupported
Windows
Unsupported
Unsupported
Here is a full example (combining the client and server parts):
An HPU device is built for a given parameter set. At this point, because HPU is still a prototype, the software provided is retrieving this parameter set from an instantiated HpuDevice. Once retrieved, reading some HPU registers, this parameter set is used by the example applications to generate both client and compressed server keys. Server key has then to be decompressed by the server to be converted into the right format and uploaded to the device. Once decompressed, the operations between CPU and HPU are identical.
On the client-side, the method to encrypt the data is exactly the same than the CPU one, as shown in the following example:
The server first needs to set up its keys with set_server_key((hpu_device, compressed_server_key))
.
Finally, the client decrypts the result using:
The HPU backend includes the following operations for unsigned encrypted integers:
name
symbol
Enc
/Enc
Enc
/ Int
Add
+
Sub
-
Mul
*
BitAnd
&
BitOr
|
BitXor
^
Greater than
gt
Greater or equal than
ge
Lower than
lt
Lower or equal than
le
Equal
eq
Ternary operator
select
Comparing to the , HPU set up differs in the key creation and device registration, as detailed
Then, homomorphic computations are performed using the same approach as the .
All operations follow the same syntax than the one described in .