IBM / fhe-toolkit-linux

IBM Fully Homomorphic Encryption Toolkit For Linux. This toolkit is a Linux based Docker container that demonstrates computing on encrypted data without decrypting it! The toolkit ships with two demos including a fully encrypted Machine Learning inference with a Neural Network and a Privacy-Preserving key-value search.
MIT License
1.43k stars 158 forks source link

Some detailed bootstrapping parameter settings #192

Closed Garmin-Qian closed 1 year ago

Garmin-Qian commented 1 year ago

Hello, I'm here again! I successfully installed pyhelayers offline using “docker save ” and “docker load”.

I noticed that heaan's library was used in Tutorial 05, and I assume that HEAAN is the only backend library that supports bootstrapping? `)_JK7SYY~@W~) NXC{O@SG

When I use SqueezeNet model, the automatic optimizer gets the following parameter settings. GK1UO0T`~IAQ G15VMY`B}0

The optimizer displays the required number of bootstrapping. Further, can I know some detailed bootstrapping parameter settings such as the maximum modulus logQ and bootstrapping level?

boland25 commented 1 year ago

Good to hear! glad you got it running. So answer your question as far as I know right now, SEAL doesn't do bootstrapping as of yet, and Helib only does bootstrapping on BGV schemes. So HEaaN is the way to go. As far as the detailed bootstrapping settings, I'm not as familiar with this one compared to the others, but I think these are the best settings. I would try to maximize the number of slots, and then up your system memory. I can tell you that the more memory you have on the machine, the better off you will be. I don't think you can really run this one, unless you have something around 100GB of memory as a minimum.

aehud commented 1 year ago

Regarding your other questions: After you initialize the context with the profile that resulted from the optimizer, you can query it for various details about its configuration.

For example, you can ask for the entire modulus chain get_modulus_chain, or just query the number of levels get_top_chain_index.

We plan to add API for querying the bootstrapping levels, but for now you can experiment with a test ciphertext, and query its level using get_chain_index.

Garmin-Qian commented 1 year ago

Thanks! I wil have a try.