-
Notifications
You must be signed in to change notification settings - Fork 23.3k
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
[ONNX] Support optional type #68793
[ONNX] Support optional type #68793
Conversation
CI Flow Status⚛️ CI FlowRuleset - Version:
You can add a comment to the PR and tag @pytorchbot with the following commands: # ciflow rerun, "ciflow/default" will always be added automatically
@pytorchbot ciflow rerun
# ciflow rerun with additional labels "-l <ciflow/label_name>", which is equivalent to adding these labels manually and trigger the rerun
@pytorchbot ciflow rerun -l ciflow/scheduled -l ciflow/slow For more information, please take a look at the CI Flow Wiki. |
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 5df8a58 (more details on the Dr. CI page):
🕵️ 9 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages: linux-xenial-py3.7-gcc7 / test (default, 2, 2, linux.2xlarge) (1/9)Step: "Test" (full log | diagnosis details | 🔁 rerun)
|
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.
Thank you @garymm for updating this pull request! I'm leaving some comments and thoughts as looking through the code.
@@ -508,7 +624,13 @@ void FixupONNXControlflowNodeOutputs(Node* n) { | |||
for (auto i : c10::irange(n->outputs().size())) { | |||
auto type = n->blocks().at(0)->outputs().at(i + 1)->type(); | |||
if (i < loop_carried_output_size) { | |||
n->output(i)->setType(type); | |||
if (auto none_type = n->output(i)->type()->cast<NoneType>()) { | |||
n->output(i)->setType( |
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.
Do we know why propagating shape from block output doesn't work for optional type values?
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.
@BowenBao I think this is ready for review. The check failures seem unrelated.
LMK if you'd like to do this in real time together.
Thanks @garymm, I will try to read through the code changes first. |
Conflicting files due to out of sync, @garymm could you please do another rebase with latest onnx_ms_1 branch? |
@BowenBao rebased |
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.
Thank you for taking over this PR. Still reading through changes, leaving questions/comments along the way
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: BowenBao <bowbaomicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> ghstack-source-id: ebe004cc165e65ab6fd78ac66aff4783f9f34933 Pull Request resolved: #73284
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: BowenBao <bowbaomicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> ghstack-source-id: 2c44c9be98317e47a2429dfe4acda2e7743eff40 Pull Request resolved: #73284
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: BowenBao <bowbaomicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> ghstack-source-id: c76dcce0a33e716cf1b4b4e62f99d236d8c581d4 Pull Request resolved: #73284
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: BowenBao <bowbaomicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> ghstack-source-id: d84eef104432adaa1160571590adf9531f3c977e Pull Request resolved: #73284
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: BowenBao <bowbaomicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> ghstack-source-id: 48155ca020dd22a932da9263d9e616678251c6af Pull Request resolved: #73284
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: BowenBao <bowbaomicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> ghstack-source-id: c56814f56de2cc66ea6ed17042c60d454f33b455 Pull Request resolved: #73284
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: garymm <garymiguelmicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> Differential Revision: [D34625646](https://our.internmc.facebook.com/intern/diff/D34625646) [ghstack-poisoned]
Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Co-authored-by: BowenBao <bowbaomicrosoft.com> Co-authored-by: neginraoof <neginmrutexas.edu> ghstack-source-id: 9ef86bbec6336e5533d6cc7c960160e695fa88d6 Pull Request resolved: #73284
Summary: Pull Request resolved: #73284 Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Test Plan: Imported from OSS Reviewed By: albanD Differential Revision: D34625646 Pulled By: malfet fbshipit-source-id: 537fcbc1e9d87686cc61f5bd66a997e99cec287b Co-authored-by: BowenBao <bowbao@microsoft.com> Co-authored-by: neginraoof <neginmr@utexas.edu> Co-authored-by: Nikita Shulga <nshulga@fb.com>
Summary: Pull Request resolved: #73284 Some important ops won't support optional type until opset 16, so we can't fully test things end-to-end, but I believe this should be all that's needed. Once ONNX Runtime supports opset 16, we can do more testing and fix any remaining bugs. Test Plan: Imported from OSS Reviewed By: albanD Differential Revision: D34625646 Pulled By: malfet fbshipit-source-id: 537fcbc1e9d87686cc61f5bd66a997e99cec287b Co-authored-by: BowenBao <bowbao@microsoft.com> Co-authored-by: neginraoof <neginmr@utexas.edu> Co-authored-by: Nikita Shulga <nshulga@fb.com> (cherry picked from commit 822e79f)
This reverts commit 679fc90.
Based on #61938