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

[Hexagon] Add contrib tests for blocked conv2d and maxpool2d #8960

Merged
merged 2 commits into from
Sep 14, 2021
Merged

[Hexagon] Add contrib tests for blocked conv2d and maxpool2d #8960

merged 2 commits into from
Sep 14, 2021

Conversation

csullivan
Copy link
Contributor

@csullivan csullivan commented Sep 8, 2021

This PR adds llvm unit tests that demonstrate the scheduling of conv2d and maxpool2d using a packed layout wherein spatial and channel dimensions are split into blocks. These tests can serve as a base off which to develop lowering for hexagon.

@csullivan
Copy link
Contributor Author

Copy link
Contributor

@tmoreau89 tmoreau89 left a comment

Choose a reason for hiding this comment

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

Great PR, thank you @csullivan ! Left some comments and nits

int(ceildiv(in_channel, in_factor)),
kernel,
kernel,
in_factor // in_second_factor,
Copy link
Contributor

Choose a reason for hiding this comment

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

in_first_factor

tests/python/contrib/test_hexagon/conftest.py Outdated Show resolved Hide resolved
tests/python/contrib/test_hexagon/test_conv2d_blocked.py Outdated Show resolved Hide resolved
tests/python/contrib/test_hexagon/infrastructure.py Outdated Show resolved Hide resolved
tests/python/contrib/test_hexagon/infrastructure.py Outdated Show resolved Hide resolved
tests/python/contrib/test_hexagon/test_conv2d_blocked.py Outdated Show resolved Hide resolved
tests/python/contrib/test_hexagon/test_conv2d_blocked.py Outdated Show resolved Hide resolved
@Lunderberg
Copy link
Contributor

The changes look good to me. I like the hoisting of the shape definitions up into the conftest.py, to avoid redefinition across multiple files.

@csullivan
Copy link
Contributor Author

Thanks for the feedback @tmoreau89 @adstraw @Lunderberg, I've updated the commit. Please take a look when you have a chance.

Copy link
Contributor

@tmoreau89 tmoreau89 left a comment

Choose a reason for hiding this comment

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

Thank you @csullivan the PR looks excellent, LGTM!

@tmoreau89 tmoreau89 merged commit b856d9e into apache:main Sep 14, 2021
@tmoreau89
Copy link
Contributor

Thank you @adstraw @Lunderberg @csullivan the PR has been merged

# Combination of padding required by conv2d operator and padding to evenly divisible
# number of blocks. Note that this padding should be inlined in the schedule so
# as to avoid input copying.
pad_h = (block_H - ((H + padding[1]) % block_H)) % block_H
Copy link
Contributor

Choose a reason for hiding this comment

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

is the second % block_H necessary?

ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
…8960)

* Add hexagon contrib tests for blocked conv2d and maxpool2d

* Restructure based on review comments
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
…8960)

* Add hexagon contrib tests for blocked conv2d and maxpool2d

* Restructure based on review comments
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.

5 participants