-
Notifications
You must be signed in to change notification settings - Fork 268
Description
Wrong calculation will occur for simple-ckks-bootstrapping when using HEXL but disabling OPENMP.
I understand it is related to openfhe-hexl but I think this place is more relevant for development/bug report.
Way to reproduce it
- Compile the v1.4.0 or v1.3.0 hexl-enabled openfhe from openfhe-configurator
- Using this flag for cmake:
CC=clang CXX=clang++ cmake -DWITH_INTEL_HEXL=ON -DWITH_OPENMP=OFF -DMATHBACKEND=6 -DWITH_NTL=ON -DWITH_TCM=ON -DCMAKE_INSTALL_PREFIX=$PWD/install ..
- run simple-ckks-bootstrapping, and decryption will fail saying too high noise. The actual behavior is that the calculation result is wrong.
Potential cause
The buggy lines might be https://github.com/openfheorg/openfhe-hexl/blob/0ccdd1e9852a083bdf5625e5d7710cf43d415f41/src/core/include/lattice/hal/hexl/hexldcrtpoly-impl.h#L956-L967
The call to MultAccEqNoCheck might have wrong result causing incorrect approximate mod switch. I've tried the above flag using WITH_REDUCED_NOISE=ON and the result is correct, and I've also tried WITH_INTEL_HEXL=OFF and the result is correct, so I think the bug might be in the HEXL implementation of MultAccEqNoCheck.
Also, manual git bisect shows that the bug was introduced in v1.3.0, whereas in v1.2.0 it is still correct, and MultAccEqNoCheck was introduced in v1.3.0