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

[TOPI] Add support for groupped conv3d #9873

Merged
merged 11 commits into from
Feb 18, 2022
Merged

Conversation

tkonolige
Copy link
Contributor

Change conv3d to use generic conv implementation which supports grouped convolutions. Also, remove support for non-float16 tensorcore operations as they cause large degradation in accuracy. Generic conv now supports autoscheduler.

@mbrookhart @jwfromm

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.

A couple of nits. I'd love it if @masahi or @jwfromm could take a look re: tensorcores, but otherwise, I'm happy.

src/target/source/codegen_cuda.cc Show resolved Hide resolved
Comment on lines 823 to 827
if ((floordiv(x, y)).Match(ret) && analyzer_->CanProve(x.Eval() < y.Eval())) {
return 0;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what this is for?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe need to a a pass test for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is needed so that the simplifier here: https://github.com/apache/tvm/pull/9873/files#diff-04a1aab966320b6f63c390cc8b79f79b543a1a7a3f560ea3a97d18c2bb041a0aR837-R839 will remove the division by groups. Without this, simplification get stuck simplifying ff // (num_filter // groups) * (in_channel // groups) + rc to ff // num_filter * in_channel + rc. It can't prove that ff // num_filter = 0.

@masahi
Copy link
Member

masahi commented Jan 18, 2022

Also, remove support for non-float16 tensorcore operations as they cause large degradation in accuracy

Yeah, I also noticed this implicit downcasting before, I'm in favor of this change. Users can always explicitly cast their inputs to fp16. The original code was added before we have the fp16 conversion pass.

This may break existing flows if some users depend on this behavior, which is also the default in cudnn/cublas. Personally I don't mind it, but if that's concerning we can always add a workaround to allow the old behavior.

Tristan Konolige added 4 commits February 9, 2022 11:04
Change conv3d to use generic conv implementation which supports groupped
convolutions. Also, remove support for non-float16 tensorcore operations
as they cause large degradation in accuracy. Generic conv now supports
autoscheduler.
@tkonolige
Copy link
Contributor Author

@masahi @mbrookhart I've finally got this branch green. Could you re-review?

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 would love to align on the tensorcore issues across the ops, if any still remain, but that can be a second PR.

@masahi masahi merged commit 2c0a7c2 into apache:main Feb 18, 2022
pfk-beta pushed a commit to pfk-beta/tvm that referenced this pull request Apr 11, 2022
* [TOPI] Add support for groupped conv3d

Change conv3d to use generic conv implementation which supports groupped
convolutions. Also, remove support for non-float16 tensorcore operations
as they cause large degradation in accuracy. Generic conv now supports
autoscheduler.

* correct none check

* add tests for floordiv simplification

* fixed incorrect test for autoscheduler

* formatting

* add groups to winograd

* fix tensorcore

* manually simplify index instead of relying on simplifier

* formatting

* add groups argument to conv3d_ncdhw_winograd_without_weight_transform

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

3 participants