-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Replicated Sharing Tensor (RST): secret sharing, reconstruction, and linear operations #3856
Conversation
syft/frameworks/torch/tensors/interpreters/replicative_shared.py
Outdated
Show resolved
Hide resolved
syft/frameworks/torch/tensors/interpreters/replicative_shared.py
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
@abogaziah I removed some points from this task and created other issues for each one individually. |
syft/frameworks/torch/tensors/interpreters/replicative_shared.py
Outdated
Show resolved
Hide resolved
syft/frameworks/torch/tensors/interpreters/replicative_shared.py
Outdated
Show resolved
Hide resolved
syft/frameworks/torch/tensors/interpreters/replicative_shared.py
Outdated
Show resolved
Hide resolved
syft/frameworks/torch/tensors/interpreters/replicative_shared.py
Outdated
Show resolved
Hide resolved
syft/frameworks/torch/tensors/interpreters/replicative_shared.py
Outdated
Show resolved
Hide resolved
syft/frameworks/torch/tensors/interpreters/replicative_shared.py
Outdated
Show resolved
Hide resolved
syft/frameworks/torch/tensors/interpreters/replicative_shared.py
Outdated
Show resolved
Hide resolved
syft/frameworks/torch/tensors/interpreters/replicative_shared.py
Outdated
Show resolved
Hide resolved
@@ -909,6 +909,11 @@ def share( | |||
requires_grad (bool): Should we add AutogradTensor to allow gradient computation, | |||
default is False. | |||
""" | |||
if protocol == "falcon": | |||
shared_tensor = syft.ReplicatedSharingTensor(owner=self.owner).share_secret( |
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.
Q: I am thinking if we can keep a dict
for those.
Like:
"falcon": syft.ReplicatedSharingTensor,
"snn" : syft.AdditiveSharingTensor
}
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.
what would be the use-case of that dict? I don't get it
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.
Dict are better to dynamically add options if needed, and are faster to access instead of if / else-ing on all optiosn
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.
@abogaziah are you making the changes in this PR or we can create a subsequent ticket to do the changes in another issue (we can also mark it as good first issue :D)
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.
I think it needs to be done later, because sharing doesn't work the same way in both cases for now, (AST is more complex) maybe we should do that after refactoring AST
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.
Sounds good! There is also some refacto going on in the AST file in #3924 :)
workers = [syft.hook.local_worker] + workers | ||
return workers | ||
|
||
def generate_shares(self, plain_text, number_of_shares=3): |
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.
I recommend taking example on
def generate_shares(self, secret, n_workers, random_type): |
i.e. remove the noise you've added to the next share instead of removing the sum of all on the last share
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.
@LaRiffle What is the difference? in other words, why would you choose this over that?
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.
ping @LaRiffle
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.
I did, I'm looking at how crypten handles it
I think it looks great as a first PR that enables us to use RSS. |
@gmuraru done :) |
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.
It looks good for me! Probably we will end up iterating over this code, but I think that is perfect!
Description
This PR will implement the basic operations of the replicative secret sharing scheme in order to be able to implement falcon protocol
for more details: #3852
Checklist
Milestones: