Conversation
|
Check out this pull request on You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB. |
e223ba8 to
ea46f10
Compare
| return location._recv_msg(message) | ||
|
|
||
| def _recv_msg(self, message: bin) -> bin: | ||
| """receive message""" |
There was a problem hiding this comment.
@LaRiffle this one and the one below are the fixes for the issues you observed
ea46f10 to
03403e5
Compare
03403e5 to
bb784d7
Compare
20b39ac to
40baab0
Compare
syft/frameworks/crypten/__init__.py
Outdated
|
|
||
|
|
||
| def load(tag: str, src: int, id_worker: int): | ||
| def load(tag: str, src: int, id_worker: int, size: tuple): |
There was a problem hiding this comment.
We may not know the size of loaded tensors so we shouldn't have size as a required parameter, instead, it should be optional, and we either exchange messages in case size is not provided, or doesn't exchange messages at all if it's not.
syft/execution/plan.py
Outdated
| response = eval(cmd)(*args, **kwargs) # nosec | ||
| else: | ||
| if isinstance(_self.child, crypten.mpc.MPCTensor): | ||
| if isinstance(_self.child, crypten.mpc.MPCTensor): |
syft/execution/plan.py
Outdated
| response = getattr(_self, cmd)(*args, **kwargs) | ||
| return_placeholder.instantiate(response.child) | ||
|
|
||
| if "child" in dir(response): |
There was a problem hiding this comment.
maybe use hasattr instead?
syft/frameworks/crypten/hook/hook.py
Outdated
| try: | ||
| response = func(*args, **kwargs) | ||
| except Exception as e: | ||
| response = th.rand(kwargs["size"]) |
There was a problem hiding this comment.
Why do you need to run the function? I mean is it required or it could just be always a random response ?
syft/frameworks/torch/hook/hook.py
Outdated
| try: | ||
| import crypten | ||
| except e: | ||
| print("CrypTen not found") |
There was a problem hiding this comment.
I think you can use the same strategy than for the imports or PT & TF (but this is not important)
syft/frameworks/torch/hook/hook.py
Outdated
|
|
||
| native_func = getattr(crypten, "load") | ||
| setattr(crypten, "native_load", native_func) | ||
| setattr(crypten, "load", crypten_load) |
There was a problem hiding this comment.
This line can be removed I guess
| """ | ||
| Operates as a router for functions. A function call always starts | ||
| by being handled here and 3 scenarii must be considered: | ||
| by being handled here and 3 scenarios must be considered: |
There was a problem hiding this comment.
scenarii is ok - it's when you want to look as a star, you put the italian plural for works that have italian origins
syft/workers/base.py
Outdated
| return_value = run_party(toy_func, rank, world_size, master_addr, master_port, (), {}) | ||
|
|
||
| plan = None | ||
| for key, val in self._objects.items(): |
There was a problem hiding this comment.
Why not using tags to retrieve the plan?
| if isinstance(response, crypten.mpc.MPCTensor): | ||
| return response | ||
|
|
||
| response.parents = (self.id, new_self.id) |
There was a problem hiding this comment.
Not sure I understand the role of those 3 lines for the moment!
21046f3 to
222e39f
Compare
Signed-off-by: George Muraru <murarugeorgec@gmail.com>
222e39f to
f241ba9
Compare
fc74061 to
82971ef
Compare
|
Moved here #3254 so will close this one. |
No description provided.