Init Crypten Plan + Rebased#3254
Conversation
| if src == comm.get().get_rank(): | ||
| # Means the data is on one of our local workers | ||
|
|
||
| worker = syft.local_worker.get_worker_from_rank(src) |
There was a problem hiding this comment.
@youben11 I changed the load to look after the worker given a rank (the PR I merged into the CrypTen branch for plans did not have those changes and it fails when it looks for the tagged data on the syft.local_worker)
pip-dep/requirements.txt
Outdated
| tornado==4.5.3 | ||
| websocket_client~=0.57.0 | ||
| websockets~=8.1.0 | ||
| git+https://github.com/facebookresearch/CrypTen.git@e39a7aaf65436706321fe4e3fc055308c78b6b92#egg=crypten |
There was a problem hiding this comment.
We should keep with commit '68e0364c66df95ddbb98422fb641382c3f58734c' (or any other that don't break with pysyft) for the moment, as the last version introduces some changes that requires torch nightly as well as other functionalities we doesn't support yet.
There was a problem hiding this comment.
Will try to keep track with the latest version of CrypTen (also removed the Python 3.6 Tests and TutorialTests from this PR) and if there are problems with the Torch, will go back to a more stable version
syft/__init__.py
Outdated
| if dependency_check.crypten_available: | ||
| from syft.frameworks.torch.tensors.crypten.syft_crypten import SyftCrypTensor | ||
|
|
||
| __all__.extend(["SyftCrypTensor"]) |
There was a problem hiding this comment.
I'm not sure about this, but if SyftCrypTensor is a tensor type that its only purpose is for building plans with crypten functionalities, then should we make it available in the API?
33171cb to
fa53d18
Compare
syft/execution/plan.py
Outdated
| arg_ids = [ | ||
| t.id for t in args if isinstance(t, FrameworkTensor) or isinstance(t, AbstractTensor) | ||
| ] | ||
| result_ids = [ |
There was a problem hiding this comment.
This is needed because we return a SyftCrypTensor which is an AbstractTensor
There was a problem hiding this comment.
Why is SyftCrypTensor not a FrameworkTensor? Is Crypten not a framework?
There was a problem hiding this comment.
Interesting point. Maybe it is not because currenly SyftCrypTensor is just a helper to build Plans for Crypten, it doesn't serve other purpose than building plans. But if it proves to be more useful, than it should be definitely a FrameworkTensor
syft/execution/plan.py
Outdated
| else: | ||
| response = getattr(_self, cmd)(*args, **kwargs) | ||
| try: | ||
| response = getattr(_self, cmd)(*args, **kwargs) |
There was a problem hiding this comment.
Q: What is the better method to do it?
The problem is that when running the plan and we reach the get_plain_text instruction, _self is a PlaceHolder and .child is an MPCTensor. The placeholder does not have the get_plain_text method and in the current implementation I try to resolve it by checking the child
There was a problem hiding this comment.
If Placeholder isn't properly forwarding to the child, we should probably fix that in Placeholder.
syft/frameworks/crypten/hook/hook.py
Outdated
| try: | ||
| response = func(*args, **kwargs) | ||
| except RuntimeError: | ||
| response = SyftCrypTensor(tensor=th.zeros([])) |
There was a problem hiding this comment.
Q: Tried with a simple th.zeros([]) (without explicitly specifying the shape). It seems that currently, the shape does not matter.
syft/execution/plan.py
Outdated
| arg_ids = [ | ||
| t.id for t in args if isinstance(t, FrameworkTensor) or isinstance(t, AbstractTensor) | ||
| ] | ||
| result_ids = [ |
There was a problem hiding this comment.
Why is SyftCrypTensor not a FrameworkTensor? Is Crypten not a framework?
syft/execution/plan.py
Outdated
| else: | ||
| response = getattr(_self, cmd)(*args, **kwargs) | ||
| try: | ||
| response = getattr(_self, cmd)(*args, **kwargs) |
There was a problem hiding this comment.
If Placeholder isn't properly forwarding to the child, we should probably fix that in Placeholder.
syft/execution/plan.py
Outdated
| from syft_proto.execution.v1.computation_action_pb2 import ComputationAction as ComputationActionPB | ||
|
|
||
| if dependency_check.crypten_available: | ||
| import crypten |
There was a problem hiding this comment.
Plans shouldn't know anything about specific frameworks, so we should avoid adding Crypten-specific code if we can help it. (@OpenMined/syft-core-team has an open issue to remove the PyTorch-specific code.)
| ) | ||
|
|
||
|
|
||
| class CryptenInit(Message): |
There was a problem hiding this comment.
This seems like the kind of thing PySyft has left to be added on top by other libraries (like Grid.) I'm not opposed to having this functionality in PySyft, but the inconsistency strikes me as pretty weird and a sign that there may be a design issue here.
There was a problem hiding this comment.
Sorry I didn't get the meaning of "This seems like the kind of thing PySyft has left to be added on top by other libraries"
What would you think would be the best way to proceed here?
| from syft.messaging.message import SearchMessage | ||
| from syft.workers.abstract import AbstractWorker | ||
|
|
||
| from syft.frameworks.crypten import run_party |
There was a problem hiding this comment.
BaseWorker intentionally doesn't know anything about frameworks, so would like to find a way to avoid letting that knowledge leak in. One possibility would be to create a CryptenWorker that overrides or adds to the message dispatch table.
There was a problem hiding this comment.
Alternatively, how bad would that be to put the import in the def run_crypten_party ?
I've already seen things like this but I don't know how evil it is
There was a problem hiding this comment.
I think the problem is that we are exposing some methods that are not necessarily needed by the VirtualWorker (@karlhigley this is the reason?)
| max-parallel: 4 | ||
| matrix: | ||
| python-version: [3.6, 3.7] | ||
| python-version: [3.7] |
There was a problem hiding this comment.
This implies we'd be removing support for Python 3.6 entirely. @iamtrask, thoughts on that?
If we want to keep 3.6 support for PySyft (but not Crypten), possible we could split the workflows into one for each Python version and exclude the Crypten tests in the 3.6 workflow.
There was a problem hiding this comment.
Sorry, this should target a separate branch -- the changes are like this because the latest CrypTen master has support for python >= 3.7
There was a problem hiding this comment.
I'd really ❤️ for it to target the main branch. We want Crypten support, it's just a matter of figuring out how to get it integrated without upending the rest of the apple cart. We're squeezed on one side by Tensorflow (<= 3.7) and on the other side by Crypten. We really could narrow PySyft to 3.7 support only, just want to make sure that isn't going to break something else.
There was a problem hiding this comment.
Yes - I agree that we should be targeting the main branch. Having multiple separate version of PySyft is really a last resort nuclear option.
Or put another way - if we're worried about how PySyft master and Crypten changes will "fit together" - the answer is to merge small changes earlier not even bigger changes later (by having even more divergence through working with multiple branches)
There was a problem hiding this comment.
We have currently two blocking issues to merge this into master, the first is this python 3.6 support, the second is that crypten is now using torch nightly, and it will actually breaks badly if ran with torch==1.4.0
There was a problem hiding this comment.
What do you think should be the resolution here?
I am thinking that will be a good idea to test with an older version of Crypten (that had support for pytorch 1.4) and target the Syft master? The downside of this is that we are not up-to-date with the Crypten changes.
There was a problem hiding this comment.
Changed the target to master
There was a problem hiding this comment.
FWIW we've retargeted to a crypten branch after lots of discussion becuse we need torch nightly
We'll make sure this Openmined:crypten branch is updated regularly
syft/execution/placeholder.py
Outdated
| if isinstance(tensor, PlaceHolder): | ||
| self.child = tensor.child | ||
| elif tensor.is_wrapper: | ||
| elif hasattr(tensor, "is_wrapper") and tensor.is_wrapper: |
There was a problem hiding this comment.
This is needed because after we built a plan the tensor (received as a parameter) is a MPCTensor (does not have the attribute is_wrapper.
Another solution can be seen in a previous commit here (I kinda like more this approach)
There was a problem hiding this comment.
Either way is probably fine. Using hasattr protects us against future tensor types that don't have the attribute though.
|
BTW, some of the changes I suggested above are probably things the @OpenMined/syft-core-team should tackle. I'm not trying to push all the PySyft refactoring onto the Crypten team, I just want to make sure we have a good foundation to build on that will support what Crypten needs. Where the foundation is lacking, I want to make sure that we're talking about the gaps and planning for how to resolve them. Some things can probably be addressed in this PR (e.g. |
| self.id = PlaceholderId(self.id) | ||
| self.child = None | ||
|
|
||
| def __getattribute__(self, name): |
There was a problem hiding this comment.
@karlhigley moved the logic here.
We also need tome attributes from Placeholder (like the id, tags, the instantiate method, etc.).
and for the other attributes, we forward them to the child process.
Another solution for this would be to use a list of attributes that we know are called on the placeholder.
This list should be kept with the attributes like: id, tags ... (all the parameters in the constructor) + the methods we define in the Placeholder.
What would look like then:
def __getattribute__(self, name):
if name in ["id", "tags", ....]:
return object.__getattribute__(self, name)
else:
child = object.__getattribute__(self, "child")
return getattr(child, name)
There was a problem hiding this comment.
I think you could maybe use hasattr to check if Placeholder defines name and delegate to the child otherwise.
There was a problem hiding this comment.
The suggestion above doesn't work, because hasattr calls __getattribute__. Oops!
Codecov Report
@@ Coverage Diff @@
## crypten #3254 +/- ##
===========================================
- Coverage 94.65% 94.59% -0.05%
===========================================
Files 151 151
Lines 16240 16218 -22
===========================================
- Hits 15370 15340 -30
- Misses 870 878 +8
|
| self.tensor = new_data.child | ||
| return self | ||
|
|
||
| @tracer(method_name="add") |
There was a problem hiding this comment.
so do we need this one, or is the add call directly forwarded to the child?
There was a problem hiding this comment.
It is forwarded to the child (in our case we do not have a child).
But, if I change in the __init__ method to have this:
self.child = tensor
Then when building the plan, the traces look like this:
-> for log in sy.hook.trace.logs:
(Pdb) p sy.hook.trace.logs
[(('crypten.load', None, ('crypten_data', 1), {}), SyftCrypTensor>tensor(0.)), (('crypten.load', None, ('crypten_data', 2), {}), SyftCrypTensor>tensor(0.)), (('__add__', tensor(0.), (tensor(0.),), {}), tensor(0.)), (('get_plain_text', SyftCrypTensor>tensor(0.), (), {}), SyftCrypTensor>None)]
(Pdb)
And we get an error in the plan with:
ValueError: The following tensor was used but is not known in this plan:
E 0.0
E Possible reasons for this can be:
E - This tensor is external to the plan and should be provided using the state. See more about plan.state to fix this.```
This is because (I think) the values for the add operations are not wrapped in SyftCrypTensor. The solution (there might be another) was to trace the ```add``` operation in the ```SyftCryptensor``` class.
6d62b42 to
b50d282
Compare
pip-dep/requirements.txt
Outdated
| tornado==4.5.3 | ||
| websocket_client~=0.57.0 | ||
| websockets~=8.1.0 | ||
| git+https://github.com/facebookresearch/CrypTen.git@4ad37cb97827b3364d433251d46c75d980bc3cf6#egg=crypten |
There was a problem hiding this comment.
Q: Should we move this to a separate requirement file?
It makes a lot of sense @LaRiffle. Currently I want to have this PR merged and after I can add support for this. If that sounds ok? Or should I push the changes in this PR? (I am thinking that this PR becomes bigger and bigger and it might be hard to track all the changes) |
* Context of computation for crypten (#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com>
* Context of computation for crypten (#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com>
* Context of computation for crypten (#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com>
* Context of computation for crypten (OpenMined#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com>
* Context of computation for crypten (#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com>
* Context of computation for crypten (#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com>
* Context of computation for crypten (OpenMined#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com>
* Context of computation for crypten (#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com>
* Context of computation for crypten (OpenMined#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com>
* Context of computation for crypten (#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com>
* Context of computation for crypten (#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com>
… to crypten (#3411) * Init Crypten Plan + Rebased (#3254) * Context of computation for crypten (#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com> * save pytroch model to onnx and back to crypten * tests * fix test * follow master for crypten Co-authored-by: George-Cristian Muraru <murarugeorgec@gmail.com>
* Init Crypten Plan + Rebased (#3254) * Context of computation for crypten (#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com> * new message CryptenInitJail and CryptenInit -> CryptenInitPlan * choice to run jails or plans by decorating a function or a plan respectively * typos and small changes * reformatting * re-enable mpc hooking * lint * update tests * remove old comments * fix serialization CryptenInitJail and tests * lint * Update pip-dep/requirements.txt * typos Co-authored-by: George-Cristian Muraru <murarugeorgec@gmail.com>
* Context of computation for crypten (OpenMined#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com>
* Context of computation for crypten (OpenMined#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com>
* Context of computation for crypten (OpenMined#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com>
* Context of computation for crypten (OpenMined#2963) * New message type for crypten party initialization * Handle CryptenInit message by running local party * Define a new context of computation for crypten The new context of computation can run parties that are distributed across syft workers. The communication of crypten parties remains the same, however, syft workers handle initialization and the serialization of return values. * updated docs * testing crypten context * fix: was setting the bad env variable DISTRIBUTED_BACKEND should have been set and not BACKEND * test serde of CryptenInit message * add crypten as core deps, this should change to extra * delete useless comment * fix: list CryptenInit in OBJ_SIMPLIFIER_AND_DETAILERS * fix msgpack tests * run black * don't cover empty function * Init Crypten Plan * Remove python 3.6 from github actions * Remove SyftCrypTensor as wrapper from MPCTensor * Remove SyftCrypTensor from export * Check for is_wrapper in placeholder * Add placeholder attribute * Bug Fix Message * Add serde test * Old CrypTen version * Add crypten to execution * wrap our load function around crypten.load * Update syft/frameworks/crypten/__init__.py Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Rework crypten integration for plans * linter fix * Remove duplicate test Co-Authored-By: Ayoub Benaissa <ayouben9@gmail.com> * Crypten track master * Remove SyftCryptensor as a dependency * Remove python 3.6 * Use correct commit * Add MPCTensor as FrameworkTensor and remove SyftCrypTensor * remove duplicated CrypTenInit * Review pass1 Co-authored-by: Ayoub Benaissa <ayouben9@gmail.com>
Attention Those changes are not meant to go into master, I will change the PR to target a different branch.
Rebased with master Crypten using Plans (also integrated with SyftCrypTensor).
run_multiparty_computationand test file) from AyoubSyftCrypTensorwill be a shell for the operations that will be done on the MPCTensor -- Integrated changes from Ajayaddandget_plain_textmethodsHow the tested function looks:
How the plan looks