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 pack and unpack #9960

Merged
merged 2 commits into from
Feb 9, 2022

Conversation

lhutton1
Copy link
Contributor

Pack is represented by a series of expand_dims operations followed by a concatenate in Relay. Unpack is represented by a split followed by a series of squeeze operations in Relay. This PR legalizes expand_dims and squeeze to reshape operations while making use of existing legalization techniques for split and concatenate so that pack and unpack can be offloaded to the NPU.

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

Copy link
Contributor

@NicolaLancellotti NicolaLancellotti left a comment

Choose a reason for hiding this comment

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

LGTM!

Pack is represented by a series of `expand_dims` operations
followed by a `concatenate` in Relay. Unpack is represented
by a `split` followed by a series of `squeeze` operations in
Relay. This commit legalizes `expand_dims` and `squeeze` to
reshape operations while making use of existing legalization
techniques for `split` and `concatenate` so that pack and
unpack can be offloaded to the NPU.

Change-Id: I3fbebb4ece5ca04598f8e587b9e6c0ddf280266d
Change-Id: Ic6a9fd77b61368720328bfe82032490bcc66152c
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 9282367 into apache:main Feb 9, 2022
@manupak
Copy link
Contributor

manupak commented Feb 9, 2022

Thanks @lhutton1 . this is merged now!

@lhutton1 lhutton1 deleted the pack-and-unpack branch February 15, 2022 15:33
ylc pushed a commit to ylc/tvm that referenced this pull request Feb 16, 2022
* [microNPU] Add support for pack and unpack

Pack is represented by a series of `expand_dims` operations
followed by a `concatenate` in Relay. Unpack is represented
by a `split` followed by a series of `squeeze` operations in
Relay. This commit legalizes `expand_dims` and `squeeze` to
reshape operations while making use of existing legalization
techniques for `split` and `concatenate` so that pack and
unpack can be offloaded to the NPU.

Change-Id: I3fbebb4ece5ca04598f8e587b9e6c0ddf280266d

* rebase and add tests for expand dims and squeeze

Change-Id: Ic6a9fd77b61368720328bfe82032490bcc66152c
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