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

RNS variant multiplication operation for FV scheme. #3893

Merged
merged 3 commits into from
Aug 3, 2020

Conversation

rav1kantsingh
Copy link
Member

@rav1kantsingh rav1kantsingh commented Jul 23, 2020

Description

Multiplication operation for FV scheme using RNS variant. The current implementation of a multiplication operation is not performing well during relinearization operation. So updating the operation with the RNS variant.

Affected Dependencies

None

How has this been tested?

Tests already present for multiplication operation but added tests for internal methods.

Checklist

@rav1kantsingh rav1kantsingh added the Type: Improvement 📈 Minor improvements not introducing a new feature or requiring a major refactor label Jul 23, 2020
@rav1kantsingh rav1kantsingh added this to the BFV Tensor in Python milestone Jul 23, 2020
@rav1kantsingh
Copy link
Member Author

I have completed the required code for the operation but the result is not correct yet😭. I have added some deepcopy's till debugging. so will remove the redundant deepcopy's after everything starts working properly...

@rav1kantsingh rav1kantsingh changed the title [WIP] RNS variant multiplication operation for FV scheme. RNS variant multiplication operation for FV scheme. Jul 26, 2020
@rav1kantsingh
Copy link
Member Author

@youben11 @bcebere PR is ready for review, the operation is working now 🥳

@codecov
Copy link

codecov bot commented Jul 26, 2020

Codecov Report

Merging #3893 into master will decrease coverage by 0.13%.
The diff coverage is 98.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3893      +/-   ##
==========================================
- Coverage   95.07%   94.94%   -0.14%     
==========================================
  Files         186      199      +13     
  Lines       18868    20247    +1379     
==========================================
+ Hits        17939    19223    +1284     
- Misses        929     1024      +95     
Impacted Files Coverage Δ
syft/frameworks/torch/he/fv/util/operations.py 94.48% <ø> (+3.51%) ⬆️
syft/frameworks/torch/he/fv/evaluator.py 95.07% <96.66%> (+1.36%) ⬆️
syft/frameworks/torch/he/fv/util/rns_tool.py 98.38% <98.21%> (-1.62%) ⬇️
syft/frameworks/torch/he/fv/util/base_converter.py 100.00% <100.00%> (ø)
test/torch/tensors/test_fv.py 100.00% <100.00%> (ø)
syft/frameworks/torch/nn/conv.py 28.57% <0.00%> (-71.43%) ⬇️
syft/frameworks/torch/he/fv/context.py 80.55% <0.00%> (-19.45%) ⬇️
syft/frameworks/torch/he/fv/modulus.py 80.95% <0.00%> (-15.83%) ⬇️
syft/frameworks/torch/nn/functional.py 89.83% <0.00%> (-7.17%) ⬇️
syft/generic/pointers/object_pointer.py 78.35% <0.00%> (-3.87%) ⬇️
... and 40 more

Copy link
Member

@youben11 youben11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work Ravikant!

@@ -252,55 +250,100 @@ def _mul_cipher_cipher(self, ct1, ct2):
A Ciphertext object with a value equivalent to the result of the product of two
operands.
"""
ct1, ct2 = ct1.data, ct2.data
ct1, ct2 = copy.deepcopy(ct1.data), copy.deepcopy(ct2.data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this deepcopy still needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it 👍

@youben11 youben11 merged commit 8e2c6bb into OpenMined:master Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Improvement 📈 Minor improvements not introducing a new feature or requiring a major refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants