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

feat(deployment): Make serialization optional in FHEModelServer.run #1006

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DeVikingMark
Copy link

Add force_serialization parameter to FHEModelServer.run method to make
serialization/deserialization optional. This allows for better performance
in cases where serialization is not needed.

  • Add force_serialization parameter with default value False
  • Update method documentation
  • Modify serialization logic to consider both input state and force_serialization flag
  • Remove TODO comment as the functionality is now implemented

@DeVikingMark DeVikingMark requested a review from a team as a code owner January 25, 2025 04:29
Copy link

cla-bot bot commented Jan 25, 2025

Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @DeVikingMark on file. In order for us to review and merge your code, please sign:

  • For individual contribution: our CLA
  • for Bounty submission, if you are an individual: our T&C
  • for Bounty submission, if you are a company: our T&C
    to get yourself added.

If you already signed one of this document, just wait to be added to the bot config.

@andrei-stoian-zama
Copy link
Collaborator

Thank you for the PR!

Could you elaborate in which cases the serialization would not be needed? Would it be in the case when Client / Server run on the same machine ?

@DeVikingMark
Copy link
Author

Thank you for the PR!

Could you elaborate in which cases the serialization would not be needed? Would it be in the case when Client / Server run on the same machine ?

@andrei-stoian-zama

Yes, serialization isn't needed when Client and Server run on the same machine. I noticed that in local scenarios, the code was performing unnecessary serialization/deserialization operations that could be optimized.

In such cases, we can just pass fhe.Value objects directly, which is noticeably faster. This is especially useful during:

  • local development and testing
  • debugging
  • running all components in a single process

That's why I added the force_serialization parameter - it helps optimize performance in these scenarios while maintaining backwards compatibility for distributed systems. Thanks for asking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants