-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[CUTLASS] More robust support for pattern matching and alignment #9698
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
masahi
requested review from
anijain2305,
areusch,
comaniac,
Huyuwei,
icemelon,
jcf94,
jroesch,
junrushao,
jwfromm,
kevinthesun,
Laurawly,
MarisaKirisame,
mbrookhart,
merrymercy,
slyubomirsky,
tqchen,
vinx13,
wweic,
yzhliu,
zhiics and
ZihengJiang
as code owners
December 10, 2021 04:00
masahi
force-pushed
the
cutlass-more-robust
branch
from
December 10, 2021 13:50
5db9b52
to
7f258d3
Compare
comaniac
approved these changes
Dec 10, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
masahi
force-pushed
the
cutlass-more-robust
branch
3 times, most recently
from
December 11, 2021 07:28
2714e30
to
cd83677
Compare
masahi
force-pushed
the
cutlass-more-robust
branch
3 times, most recently
from
December 13, 2021 13:18
807ea11
to
5b439d1
Compare
masahi
force-pushed
the
cutlass-more-robust
branch
from
December 13, 2021 14:13
5b439d1
to
1d5ce30
Compare
masahi
force-pushed
the
cutlass-more-robust
branch
from
December 13, 2021 20:38
1d5ce30
to
73740c4
Compare
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Jan 7, 2022
…che#9698) * bug fix in im2col encoding * skip legalize when batch size is dynamic * add sm75 kernels to sm80 profilings * add dtype and layout check in parttern match * use align1 kernel for unusual channel cases (IC = 3 etc) * test IC=3 convolution * fixed check functions for fused cases, run infer type before mergecomposite * check align on N dim * add comment on IC == 3 case * lint fix * do not offload depthwise conv2d * lint * trigger CI
yangulei
pushed a commit
to yangulei/tvm
that referenced
this pull request
Jan 11, 2022
…che#9698) * bug fix in im2col encoding * skip legalize when batch size is dynamic * add sm75 kernels to sm80 profilings * add dtype and layout check in parttern match * use align1 kernel for unusual channel cases (IC = 3 etc) * test IC=3 convolution * fixed check functions for fused cases, run infer type before mergecomposite * check align on N dim * add comment on IC == 3 case * lint fix * do not offload depthwise conv2d * lint * trigger CI
yangulei
pushed a commit
to yangulei/tvm
that referenced
this pull request
Jan 12, 2022
…che#9698) * bug fix in im2col encoding * skip legalize when batch size is dynamic * add sm75 kernels to sm80 profilings * add dtype and layout check in parttern match * use align1 kernel for unusual channel cases (IC = 3 etc) * test IC=3 convolution * fixed check functions for fused cases, run infer type before mergecomposite * check align on N dim * add comment on IC == 3 case * lint fix * do not offload depthwise conv2d * lint * trigger CI
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Jan 13, 2022
…che#9698) * bug fix in im2col encoding * skip legalize when batch size is dynamic * add sm75 kernels to sm80 profilings * add dtype and layout check in parttern match * use align1 kernel for unusual channel cases (IC = 3 etc) * test IC=3 convolution * fixed check functions for fused cases, run infer type before mergecomposite * check align on N dim * add comment on IC == 3 case * lint fix * do not offload depthwise conv2d * lint * trigger CI
qsqqsqqsq-intellif
pushed a commit
to qsqqsqqsq-intellif/tvm
that referenced
this pull request
Apr 29, 2022
…che#9698) * bug fix in im2col encoding * skip legalize when batch size is dynamic * add sm75 kernels to sm80 profilings * add dtype and layout check in parttern match * use align1 kernel for unusual channel cases (IC = 3 etc) * test IC=3 convolution * fixed check functions for fused cases, run infer type before mergecomposite * check align on N dim * add comment on IC == 3 case * lint fix * do not offload depthwise conv2d * lint * trigger CI
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
N, K
dimensions are not divisible by 8, 4 etc, i.e.align = 1
is mandatory. This came up in MaskRCNN where there is a workload(M, N, K) = (?, 91, 1024)
. Since the output shape is(?, 91)
, we cannot do vectorized memory access on the output tensor. Hence, onlyalign = 1
variants are valid candidates. The same fix also enabled offloading conv2d withIC = 3
case.align = 1
variants are valid candidates.conv2d
(see the change ingen_conv2d.py
). But this code will be removed soon anyway when I introduce the dedicated conv2d profiler and kernel selection.Since we need to use
align = 1
kernels for cases above and CUTLASS sm80 gemm kernels do not seem to supportalign=1
, I had to add sm75 kernels to sm80 kernel selection (see the change ingen_tensor_op.py
). It turned out sm75 kernels are faster than sm80 on RTX 3070 on some workloads, so mixing sm75 and 80 seems to be a good idea.cc @comaniac @Laurawly