-
Notifications
You must be signed in to change notification settings - Fork 170
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
Optimized BFV/BFV operations involving plaintexts #730
Conversation
// ilVector coefficients are packed and resulting ilVector is in | ||
// COEFFICIENT form. | ||
this->Pack(&this->GetElement<NativePoly>(), this->encodingParams->GetPlaintextModulus()); | ||
// Calls the inverse NTT mod plaintext modulus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the code below (lines 90, 92-95) be executed first in this block? Also 2 brackets around OPENFHE_THROW should improve readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The branches are quite different and work with different data members (encodedNativeVector vs encodedVectorDCRT). I do not think it is a good idea to merge them. The code will be hard to read and follow.
Sure, feel free to add the extra brackets around OPENFHE_THROW
} | ||
else { | ||
// Calls the inverse NTT mod plaintext modulus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the code below (lines 102-107) be executed first in this block? Also 2 brackets around OPENFHE_THROW should improve readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, please add extra parentheses around OPENFHE_THROW
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
The runtime of ctxt/ptxt is now 1.5-3x faster than before (depending on the machine used for measurements). The packing now takes more time because it calls NTTs at the end rather than during subsequent ctxt/ptxt operations.