I am trying to implement a neural net, which determines handwritten integers. It requires a multiplicative depth of nine, due to two activation functions, which are approximated with third degree Chebychev approximations. It does work, but it runs slowly. Therefore I was trying to get the ring dimension down to 8192. This works, but only if I do not set the security level. I do however need a security level of 128 bits. When I try to set FirstModSize and ScalingModSize to lower values in order to get \log(q) below 220, i get the error message
Modulus size 64 is too large. NativeVectorT supports only modulus size <= 60 bits
which I do not get, since I did set a modulus size below 64. Can somebody help me?
Can you share the portion of your code used to initialize the crypto context including CCParams<CryptoContextCKKSRNS> parameters?
Also, did you specify the NATIVE_SIZE when you built OpenFHE?
Adding to what @Caesar wrote. The main parameters are FirstModSize and ScalingModSize. FirstModSize should typically be larger than ScalModSize (to support messages larger in norm than unity). For NATIVE_SIZE=64 (default), FirstModSize cannot be larger than 60. ScaleModSize cannot be larger than 59 (because of the alternating logic of choosing the moduli above and below 2^{ScaleModSize}).
I would not recommend such low values as the approximation error in CKKS is more than 10 bits. So you cannot achieve even 1 bit of precision. Try something like 40 and 50 instead of 10 and 20, respectively. I also suggest watching Homomorphic Encryption for OpenFHE Users – OpenFHE.org to get more familiar with CKKS and its configuration parameters.
Thanks a lot. I realize these are unrealistic parameters, but I do not understand why the error message states that My modulus size is 64 and too large for smaller parameters.