HEXL Acceleration in OpenFHE

Hi,

I have a few questions regarding HEXL acceleration in OpenFHE.

Your documentation (openfhe-development/docs/static_docs/Best_Performance.md at main · openfheorg/openfhe-development · GitHub) mentions:

Note that to take advantage of AVX512_IFMA optimizations, the small moduli should be below 50 bits. If they are larger, slower instructions are used.

I wanted to clarify a few points:

  1. Does “small moduli” refer to the ScalingModSize in BGV (or the RNS limbs in BFV)?
  2. If that’s the case, does it imply that in BGV, the only way to fully leverage HEXL is by using the FIXEDMANUAL option? (Since the AUTO options set ScalingModSize to 60 by default and do not allow the user to change this value.)
  3. Out of curiosity: Is there a specific reason why FLEXIBLEMANUAL isn’t supported? FLEXIBLE appears to be superior to FIXED in most respects, and one might expect HE experts to prefer combining FLEXIBLE and MANUAL. Just wondering if I’m missing something.

Thanks!

Both

No. BGV automatically chooses parameters for all modes except for FIXEDMANUAL. In many scenarios these automatically found parameters are smaller than 50 bits (the moduli are proportional to the plaintext modulus).

A control over where rescaling is done is needed to guarantee the FLEXIBLE modes operate correctly (i.e., achieve minimal error/noise). This is why this option is not available.

1 Like