Measuring size of bootstrapping keys

Hi,

I am trying to measure the size of the bootstrapping keys for different parameter sets using the python wrapper.

Currently, I am measuring them as follows:

auto_ser = SerializeEvalAutomorphismKeyString(BINARY, “”)

auto_size = len(auto_ser)

The problem is that with larger batchsize/ringdimension, the keys get really large. I have a lot of ram, but with the serialization the program essentially then consumes twice the RAM as before, which is too much for my system. I happen to also not have much disk space at the moment, so I’d like to avoid serializing to file.

Is there a way to serialize the automorphism keys for bootstrapping one after the other, or to determine the size of one of them and the number of keys to multiply with?

Thanks!

In C++, you can serialize each them individually if you access the map using GetEvalAutomorphismKeyMap. Then you can iterate through the STL map (for the desired key tag) using the standard C++ API for STL maps. You can also check the size of the map.

This is not directly exposed in openfhe-python, but such bindings could be added.