Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does the pyfhel library run dozens of times faster than the seal library? #252

Open
Lionhehao opened this issue Oct 10, 2024 · 2 comments
Labels
Functionality Wether this library supports a certain operation or not

Comments

@Lionhehao
Copy link

I first wrote a code for dense state matrix multiplication based on the seal library. After transplanting it to the pyfhel library, I found that the speed was much faster. So I tested the ciphertext multiplication of ckks locally.

Without performing re-linearization, the time consumption of 1000 multiplications was:
seal 48s c++
pyfhel 1s python

This makes me feel unbelievable. My cpu is i3-10100f. Does pyfhel use gpu acceleration?

@Lionhehao Lionhehao added the Functionality Wether this library supports a certain operation or not label Oct 10, 2024
@ShokofehVS
Copy link

Based on previous questions and answers regarding the GPU support in Pyfhel, you can refer to these issues: #205, #171. All in all, Pyfhel depends on the underlying backend FHE libs, which have not yet been ported to GPU.

@ibarrond
Copy link
Owner

@Lionhehao I suspect two things migth be in play:

  • The multiplication in Pyfhel might be using parallelisation across several CPUs.
  • The multiplication happens in-place in Pyfhel, if you are running many multiplications in SEAL creating new objects every time you might be paying some extra computational cost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality Wether this library supports a certain operation or not
Projects
None yet
Development

No branches or pull requests

3 participants