Cheb_analysis not working

I am trying to run the cheb_analsysis but I cannot due to “Moduli size is not sufficient! Must be increased.” . When I increase, I get “FirstPrime math exception”. I am using NATIVEINT 68 and multiplicative depth 10. scalingModSize was set to 59 (I think this is what was supposed to be changed ). Could you suggest a ScalingModSize that works?

Thank you

Could you include the full code sample? I am not sure what NATIVESIZE 68 means. Typically we have 32, 64, and 128.

Sorry for the mistake, I confused myself with 64 and 128 and ended up mixing both when writing, I actually used 64

Could you include the code used to generated the crypto context? What parameters are you passing? It sounds like the scalingModSize or firstModSize is set to something small. Should be easy to detect when you include the code.

Hello, here is the code snippet of the variables:

double LOWER_BOUND = -16;
long double STEP = 0.001;
uint32_t POLY_DEGREE = 59;

int main() {
uint32_t multDepth = 10;

uint32_t ringDimension = 1 << 18;
std::cout << "Batch size: " << ringDimension / 2 << std::endl;
parameters.SetBatchSize(ringDimension / 2);
#if NATIVEINT == 128
usint scalingModSize = 85;
usint firstModSize = 89;
usint scalingModSize = 59;
usint firstModSize = 60;
lbcrypto::CryptoContextlbcrypto::DCRTPoly cc = GenCryptoContext(parameters);
// We need to enable Advanced SHE to use the Chebyshev approximation.

Thanks. I was able to recreate the problem. The ring dimension is very large (256K; we typically do not use values larger than 128K), and this causes an issue when using the FLEXIBLEAUTOEXT scaling technique (it cannot find a small modulus). I’ve created an issue for it: FLEXIBLEAUTOEXT does not work for the ring dimension of 256K and higher · Issue #595 · openfheorg/openfhe-development · GitHub

In the meantime, you can fix your code by adding the following line to the code (before calling GenCryptoContext):

1 Like

Thank you very much, it worked