-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[export] fix unbacked range deserialization #158681
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/158681
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit ff45ba1 with merge base 2a249f1 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This pull request was exported from Phabricator. Differential Revision: D78588406 |
Summary: Rollback Plan: Differential Revision: D78588406
f3e8663 to
81fd85d
Compare
|
This pull request was exported from Phabricator. Differential Revision: D78588406 |
Summary: Pull Request resolved: #158681 Test Plan: Imported from GitHub, without a `Test Plan:` line. Rollback Plan: Differential Revision: D78588406 Pulled By: pianpwk
0756a90 to
1ba6924
Compare
Summary: Pull Request resolved: #158681 Test Plan: Imported from GitHub, without a `Test Plan:` line. Rollback Plan: Differential Revision: D78588406 Pulled By: pianpwk
1ba6924 to
072c365
Compare
Summary: Fixes #151809, by reading shape assertion nodes into ShapeEnv, and deferring instantiation of node example values, to be done node-by-node. Test Plan: Imported from GitHub, without a `Test Plan:` line. Rollback Plan: Differential Revision: D78588406 Pulled By: pianpwk
072c365 to
905a61f
Compare
|
This pull request was exported from Phabricator. Differential Revision: D78588406 |
|
This pull request was exported from Phabricator. Differential Revision: D78588406 |
Summary: Pull Request resolved: #158681 Test Plan: Imported from GitHub, without a `Test Plan:` line. Rollback Plan: Differential Revision: D78588406 Pulled By: pianpwk
905a61f to
014e69d
Compare
|
This pull request was exported from Phabricator. Differential Revision: D78588406 |
Summary: Fixes #151809, by reading shape assertion nodes into ShapeEnv, and deferring instantiation of node example values, to be done node-by-node. Pull Request resolved: #158681 Test Plan: Imported from GitHub, without a `Test Plan:` line. Rollback Plan: Differential Revision: D78588406 Pulled By: pianpwk
014e69d to
c9fb16e
Compare
torch/_export/serde/serialize.py
Outdated
| meta_val = self.deserialize_tensor_meta(tensor_value) | ||
| log.debug("[deserialize_tensor_meta] %s (output): %s", name, meta_val) | ||
| self.serialized_name_to_meta[name] = meta_val | ||
| self.serialized_name_to_meta[name] = lambda v=tensor_value: self.deserialize_tensor_meta(v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked Python semantics re: capture of tensor_value here? Hope it doesn't pick up values assigned later and instead does what you think it does...which is capture the value in this iteration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the default value here is for using the value at definition; doing lambda: self.deserialize_tensor_meta(tensor_value) was using the value at evaluation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Minor nit: could have used functools.partial as well I think for this purpose, the default value trick seems a bit obscure.
Summary: Fixes #151809, by reading shape assertion nodes into ShapeEnv, and deferring instantiation of node example values, to be done node-by-node. Test Plan: Imported from GitHub, without a `Test Plan:` line. Rollback Plan: Reviewed By: avikchaudhuri Differential Revision: D78588406 Pulled By: pianpwk
c9fb16e to
ff45ba1
Compare
|
This pull request was exported from Phabricator. Differential Revision: D78588406 |
|
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Fixes #151809, by reading shape assertion nodes into ShapeEnv, and deferring instantiation of node example values, to be done node-by-node.
Differential Revision: D78588406