Skip to content

Conversation

@tkonolige
Copy link
Contributor

Generalize the conv2d compute statement to a generic convNd that supports any layout and groups. Replace some existing conv2d and conv1d compute statements with this generic compute. Also add a topi group_conv1d compute that uses the generic convNd compute. Existing schedules for conv1d work with group_conv1d, so they are reused.

I've tested this on an internal model and it provides a good speedup over the previous expand -> conv2d -> squeeze hack.

@mbrookhart

Copy link
Contributor

@mbrookhart mbrookhart left a comment

Choose a reason for hiding this comment

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

LGTM. I really like the ND kernel implementation.

Generalize the conv2d compute statement to a generic convNd that
supports any layout and groups. Replace some existing conv2d and conv1d
compute statements with this generic compute. Also add a topi
group_conv1d compute that uses the generic convNd compute. Existing
schedules for conv1d work with group_conv1d, so they are reused.
@mbrookhart mbrookhart merged commit f6f252f into apache:main Jan 7, 2022
@mbrookhart
Copy link
Contributor

Thanks, @tkonolige !

Raghav-Chakravarthy pushed a commit to Raghav-Chakravarthy/tvm that referenced this pull request Jan 28, 2022
* [TOPI] Support grouped conv1d

Generalize the conv2d compute statement to a generic convNd that
supports any layout and groups. Replace some existing conv2d and conv1d
compute statements with this generic compute. Also add a topi
group_conv1d compute that uses the generic convNd compute. Existing
schedules for conv1d work with group_conv1d, so they are reused.

* permute reduction axis order

* formatting
ylc pushed a commit to ylc/tvm that referenced this pull request Feb 16, 2022
* [TOPI] Support grouped conv1d

Generalize the conv2d compute statement to a generic convNd that
supports any layout and groups. Replace some existing conv2d and conv1d
compute statements with this generic compute. Also add a topi
group_conv1d compute that uses the generic convNd compute. Existing
schedules for conv1d work with group_conv1d, so they are reused.

* permute reduction axis order

* formatting
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