-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Add Parsing of tensor constants #75119
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
[ghstack-poisoned]
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 409350d (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
ZolotukhinM
left a comment
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.
This is supernice, thanks! A couple of remarks below:
torch/csrc/jit/ir/irparser.cpp
Outdated
| std::unordered_map<std::string, Value*>& vmap; | ||
| SchemaTypeParser type_parser; | ||
| bool parse_tensor_constants_; | ||
| std::unordered_set<Node*> deferred_tensor_value_initializations_; |
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.
Using unordered_set here would result in non-determinism. Would it be possible to somehow fix it? We might also want to have some control knob over the random values we use for initialization for the same reason.
Add support for parsing Tensor constants like Double(4, 4) ... by initializing random tensors. This makes saving IR and then parsing it lossy, so I have it toggled as default not on, but is useful in cases like repro-ing Fusions with tensor constants post-freezing. cc @Krovatkin [ghstack-poisoned]
|
@eellison has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Add support for parsing Tensor constants like Double(4, 4) ... by initializing random tensors. This makes saving IR and then parsing it lossy, so I have it toggled as default not on, but is useful in cases like repro-ing Fusions with tensor constants post-freezing. cc @Krovatkin Differential Revision: [D35373999](https://our.internmc.facebook.com/intern/diff/D35373999) [ghstack-poisoned]
|
@eellison has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: Pull Request resolved: #75119 Add support for parsing Tensor constants like Double(4, 4) ... by initializing random tensors. This makes saving IR and then parsing it lossy, so I have it toggled as default not on, but is useful in cases like repro-ing Fusions with tensor constants post-freezing. cc Krovatkin Test Plan: Imported from OSS Reviewed By: ejguan Differential Revision: D35373999 Pulled By: eellison fbshipit-source-id: a5c8d9f93f23a7442258fc745ed6b6def330dca8
Stack from ghstack:
Add support for parsing Tensor constants like Double(4, 4) ... by initializing random tensors. This makes saving IR and then parsing it lossy, so I have it toggled as default not on, but is useful in cases like repro-ing Fusions with tensor constants post-freezing.
cc @Krovatkin
Differential Revision: D35373999