Skip to content
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

[Relay][Frontend][Onnx] MaxUnpool Operator #7036

Merged
merged 4 commits into from
Dec 8, 2020

Conversation

jwfromm
Copy link
Contributor

@jwfromm jwfromm commented Dec 4, 2020

I recently encountered a model with that uses the MaxUnpool op, a pretty interesting operator that is designed to reverse a maxpool. I've added support for it in our frontend through some sneaky use of scatter and found that it matches onnx's execution for each special case of the operator.

@jwfromm
Copy link
Contributor Author

jwfromm commented Dec 4, 2020

@masahi @mbrookhart can you guys take a look at this PR?

@jwfromm
Copy link
Contributor Author

jwfromm commented Dec 5, 2020

Whoops, I tested this with a newer version of onnxruntime that can do lenient shape merges. I'll fix the test to specify the expected output shape.

@masahi
Copy link
Member

masahi commented Dec 5, 2020

maybe it is time to upgrade ONNX and ORT on CI? We are at ONNX v1.6, while the latest is 1.8. Our ORT is hopelessly old: We are at 1.00 while the latest is 1.52.

I can take a look at CI upgrade for ONNX this month @jwfromm. I did that for PyTorch last month.

@jwfromm
Copy link
Contributor Author

jwfromm commented Dec 8, 2020

@masahi that would be nice, although in this case I was just being lazy and not calculating the output shape. I've fixed the test now if you want to take another look.

Copy link
Member

@masahi masahi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that we can support max unpool without modifying max pooling to return indices.

@masahi masahi merged commit 7a0d10c into apache:main Dec 8, 2020
@masahi
Copy link
Member

masahi commented Dec 8, 2020

thanks @jwfromm

@jwfromm
Copy link
Contributor Author

jwfromm commented Dec 8, 2020

@masahi you're right that most models will use MaxUnpool with MaxPool returning indices, and we probably want to add that option to MaxPool operators soon.

TusharKanekiDey pushed a commit to TusharKanekiDey/tvm that referenced this pull request Jan 20, 2021
* Added maxunpool test.

* MaxUnpool implemented and tested.

* Lint fix.

* Add explicit output shape in tests.
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Jan 21, 2021
* Added maxunpool test.

* MaxUnpool implemented and tested.

* Lint fix.

* Add explicit output shape in tests.
electriclilies pushed a commit to electriclilies/tvm that referenced this pull request Feb 18, 2021
* Added maxunpool test.

* MaxUnpool implemented and tested.

* Lint fix.

* Add explicit output shape in tests.
@jwfromm jwfromm deleted the onnx_maxunpool branch April 12, 2023 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants