ETRecord ser/de handling "None" outputs and more#3191
Merged
guangy10 merged 1 commit intorelease/0.2from Apr 22, 2024
Merged
Conversation
Summary: Pull Request resolved: #3039 For the ease of communication, let me assign nicknames to the files related to this diff: * File A: *caffe2/torch/_export/serde/serialize.py* * File B: *executorch/exir/serde/serialize.py* * File C: *executorch/exir/serde/export_serialize.py* 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: 1. D48258552, `deserialize_graph_output()` was copied from File A to File B, with some modifications made. The `deserialize_graph_output()` in File B overrides that in File A due to polymorphism. 2. D52446586, File C was created by ***copying*** File A. As a result of this diff, the `deserialize_graph_output()` in File B now overrides that in File C. 3. Also in D52446586, the `deserialize_graph_output()` in File A had some significant changes; File C got the new version of `deserialize_graph_output()`. But this diff didn't update the `deserialize_graph_output()` in File B. 4. D55391674 added the handling for "None" outputs to File A. 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. There will be a design review session this Friday to discuss consolidating the serialization code for edge and export. Reviewed By: tarun292 Differential Revision: D56091104 fbshipit-source-id: 20c75ddc610c3be7ab2bb62943419d3b8b2be079 (cherry picked from commit 89cfa73)
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/3191
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 25b05c2 with merge base d3326a2 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
guangy10
approved these changes
Apr 22, 2024
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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