Skip to content

ETRecord ser/de handling "None" outputs and more #3039

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

Closed
wants to merge 1 commit into from

Conversation

Olivia-liu
Copy link
Contributor

Summary:
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.

Differential Revision: D56091104

Copy link

pytorch-bot bot commented Apr 14, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/3039

Note: Links to docs will display an error until the docs builds have been completed.

❌ 5 New Failures

As of commit 6c13922 with merge base 3b31eff (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 14, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56091104

Olivia-liu added a commit to Olivia-liu/executorch-1 that referenced this pull request Apr 15, 2024
Summary:

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.

Differential Revision: D56091104
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56091104

Olivia-liu added a commit to Olivia-liu/executorch-1 that referenced this pull request Apr 15, 2024
Summary:

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
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56091104

Olivia-liu added a commit to Olivia-liu/executorch-1 that referenced this pull request Apr 15, 2024
Summary:

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
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56091104

Olivia-liu added a commit to Olivia-liu/executorch-1 that referenced this pull request Apr 15, 2024
Summary:

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
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56091104

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56091104

Olivia-liu added a commit to Olivia-liu/executorch-1 that referenced this pull request Apr 16, 2024
Summary:

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
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56091104

Summary:

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
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56091104

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 89cfa73.

@Olivia-liu
Copy link
Contributor Author

@pytorchbot cherry-pick --onto release/0.2 -c critical

pytorchbot pushed a commit that referenced this pull request Apr 21, 2024
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)
@pytorchbot
Copy link
Collaborator

Cherry picking #3039

The cherry pick PR is at #3191 and it is recommended to link a critical cherry pick PR with an issue

Details for Dev Infra team Raised by workflow job

guangy10 pushed a commit that referenced this pull request Apr 22, 2024
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)

Co-authored-by: Olivia Liu <[email protected]>
This was referenced Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants