Is it possible to use parallel programming to speed up run time in concrete?


I currently use concrete boolean to implement boolean operations on ciphertexts. Is there any way to speed up the run time using parallel programming in concrete? For instance, can we use threads to run code simultaneously?

Thank you for your time.

Hello @guliz :wave:,

Unfortunately, it is not currently possible to accelerate concrete-boolean with multithreading :frowning: .

The reason is that concrete-core, the low-level library which underlies concrete-boolean does not yet support multithreading itself. It is something we would like to support in the future, but we do not have plans to implement it just now.

Could you tell us more about your use case ?



1 Like

Hello @apere ,

Thank you for your answer. As I said, I use boolean operations of concrete-boolean to process the data that is consisted of ciphertexts. However, the size of the data is not small and it takes a long time to process data. For this reason, I want to accelerate these boolean operations. I just tried to implement Rust multithreading. I guess it will work. I think we can use multithreading that is implemented in Rust although it is not implemented in concrete-core. Am I right?

Thank you for your time.


Hello @guliz ,

Yes, you can safely use rust’s multithreading. As long as your program compiles, you are good to go :wink: .

1 Like

shouldn’t the bootstraping key be read-only, so I can share with multiple threads? Keeping 32 copies on RAM for 32 threads would be bad.

Hello @zama_curious :wave:,

I am not sure I totally understand what you mean by “the bootstrapping key should be read-only”. Can you tell use which library you are currently trying use ?

At some point in the past, we introduced a piece of code which prevented the bootstrap key from being accessed by multiple threads safely, but that was fixed in concrete-core and it should have been propagated to concrete-boolean by now …