-
-
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
Serde is potentially simplifying information twice, creating a bad nested structure #2424
Comments
Hi, I would like to work on this issue to try and resolve it |
Go for it @kakirastern ! |
Yeah, I see the same phenomenon too, with my output of the Python version being:
Am actively checking the code base to see where things went wrong... |
Setting
And if I turn the verbose option back on by changing to
where a few lines correspond with the some of the extra output which may not be needed and could cause some overheads issues during transmission. So from the context of the output as cited previously #2424 (comment) probably will need to add some truly global |
That sounds good to me @kakirastern. Feel free to submit a PR when you've got something. @iamtrask - any thoughts here? |
Let me not wait on @iamtrask for feedback and start look into it deeper. Sorry about the delay. |
It is indeed a bug I have come to realise, since in the line https://github.com/OpenMined/PySyft/blob/dev/syft/serde/serde.py#L289 one is supposed to be able to turn off If I attempt to set the
So I guess I will need to work on perfecting the |
Describe the bug
I'll attempt to explain this one as best as I can. Forgive me, there may be a few places where I'm not entirely familiar with the Python language or Serde/PySyft.
I've noticed while writing the Serde parser in Javascript a few strange places where Serde in PySyft appears to unnecessarily nest information. I think it would be in the best interest if PySyft cleaned up the Serde simplify functions to get a cleaner, shorter, more consistent exported value. I know that myself and @mccorby would greatly benefit from some de-duplication in the data structure being produced, and it would cause information being sent over the wire to be significantly smaller.
I want to be clear: I'm not familiar with all of the places where Serde is duplicating information... this issue is merely my initial understanding of where duplication may be taking place. Grain of salt. 😉
To Reproduce
The above will produce the following output:
To reproduce this exact object in Javascript I must write the following code:
Expected behavior
You'll see in the above Javascript code that the majority of the duplication comes in the
operations
variable.PointerTensor
:firstPointerTensor
, the second of which is contained within aTuple
for some reason. The second operation, for whatever reason, does not have the duplicate reference.PointerTensor
has an emptyMap
(a Dictionary in Python) as the final argument. This may serve a purpose, but I'm not aware of one.These are the duplications that I've been able to suss out. Either way, this issue, combined with my other two issues on Serde referenced below, are crucial to having a common language between Python and Javascript (and Kotlin and other languages that will be ported in the future).
Desktop
Additional context
I've written about the addition of unnecessary commas in another issue (#2423) as well as the use of parens over square brackets in another issue (#2422)
The text was updated successfully, but these errors were encountered: