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

[microNPU] Add support for nearest neighbor and bilinear upsampling #9841

Merged
merged 2 commits into from
Jan 31, 2022

Conversation

lhutton1
Copy link
Contributor

@lhutton1 lhutton1 commented Jan 5, 2022

Adds support for 2x2 nearest neighbor and bilinear upsampling. In the case of bilinear upsampling with align_corners set to true, the upsampling size must be 2*input_size - 1 (as opposed to 2*input_size).

cc @ekalda @mbaret @jacobbohlin @NicolaLancellotti @dchauhan-arm @manupa-arm

Copy link
Contributor

@ekalda ekalda left a comment

Choose a reason for hiding this comment

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

Great work, @lhutton1! I know that there are bits that might still change, but in general LGTM, just some clarifying questions!

python/tvm/relay/op/contrib/ethosu.py Show resolved Hide resolved
python/tvm/relay/backend/contrib/ethosu/util.py Outdated Show resolved Hide resolved
python/tvm/relay/backend/contrib/ethosu/legalize.py Outdated Show resolved Hide resolved
python/tvm/relay/op/contrib/ethosu.py Show resolved Hide resolved
Copy link
Contributor Author

@lhutton1 lhutton1 left a comment

Choose a reason for hiding this comment

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

Thanks for the review @ekalda, as mentioned there will be a follow up which makes a lot of improvement on the first attempt.

python/tvm/relay/backend/contrib/ethosu/legalize.py Outdated Show resolved Hide resolved
python/tvm/relay/backend/contrib/ethosu/util.py Outdated Show resolved Hide resolved
python/tvm/relay/op/contrib/ethosu.py Show resolved Hide resolved
python/tvm/relay/op/contrib/ethosu.py Show resolved Hide resolved
@lhutton1
Copy link
Contributor Author

As mentioned previously, a revised implementation has been pushed which removes the need for upscale_height and upscale_width to be passed to operator definitions, as well as correctly modeling the data dependency of upscaling in TE (previously not done), PTAL!

Adds support for 2x2 nearest neighbor and bilinear upsampling. In the
case of bilinear upsampling with align_corners set to true, the
upsampling size must be `2*input_size - 1` (as opposed to `2*input_size`).

Change-Id: I95d215eabfaac983629dcdedcda2b90efb8e0ddf
Change-Id: I840d8ee3671a40c5c99f22119442c349dbed39cf
Copy link
Contributor

@manupak manupak left a comment

Choose a reason for hiding this comment

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

LGTM!

@manupak manupak merged commit 02a7a41 into apache:main Jan 31, 2022
@manupak
Copy link
Contributor

manupak commented Jan 31, 2022

Thanks all! this is merged!.

@lhutton1 lhutton1 deleted the initial-upsampling-support branch January 31, 2022 16:25
ylc pushed a commit to ylc/tvm that referenced this pull request Feb 16, 2022
…pache#9841)

* [microNPU] Add support for nearest neighbor and bilinear upsampling

Adds support for 2x2 nearest neighbor and bilinear upsampling. In the
case of bilinear upsampling with align_corners set to true, the
upsampling size must be `2*input_size - 1` (as opposed to `2*input_size`).

Change-Id: I95d215eabfaac983629dcdedcda2b90efb8e0ddf

* rebase and add support for no-upsampling case.

Change-Id: I840d8ee3671a40c5c99f22119442c349dbed39cf
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.

3 participants