This guide teaches how to improve the execution time of Concrete circuits by using some special operations that reduce the bit width of the input of the table lookup.
There are two extensions which can reduce the bit width of the table lookup input, and , which can improve performance by sacrificing exactness.
For example the following code:
import numpy as np
from concrete import fhe
inputset = fhe.inputset(fhe.uint10)
for lsbs_to_remove in range(0, 10):
def f(x):
return fhe.round_bit_pattern(x, lsbs_to_remove) // 2
compiler = fhe.Compiler(f, {"x": "encrypted"})
circuit = compiler.compile(inputset)
print(f"{lsbs_to_remove=} -> {int(circuit.complexity):>13_} complexity")