ETRecord ser/de handling "None" outputs and more #3191
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
For the ease of communication, let me assign nicknames to the files related to this diff:
Recently, we noticed that error
torch._export.serde.serialize.SerializeError: Unable to deserialize output node Argument(as_none=[])
(P1210590561) was thrown from File B when deserializing ETRecord. It's possible that the error has been there since the beginning, but we've just never tested that logic path.In this diff, I made a fix on File B to resolve this particular issue. Also adding handling for "None" output case in sdk logic. Keep on reading if you don't think the code changes make sense:
I explored the history of file changes. In chronological order:
deserialize_graph_output()
was copied from File A to File B, with some modifications made. Thedeserialize_graph_output()
in File B overrides that in File A due to polymorphism.deserialize_graph_output()
in File B now overrides that in File C.deserialize_graph_output()
in File A had some significant changes; File C got the new version ofdeserialize_graph_output()
. But this diff didn't update thedeserialize_graph_output()
in File B.This diff brings (parts of) File C up-to-date with File A, and make
deserialize_graph_output()
in File B properly overrides that in File A.In the future, we should figure out how to keep File C and File A in sync. Recently, File C was broken because it didn't stay in sync with File A in D54855251 and had to be fixed by D55776877.
Differential Revision: D56091104