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

Dynamic Composable Kernel Initial Integration #1059

Closed
wants to merge 53 commits into from

Conversation

asroy
Copy link
Contributor

@asroy asroy commented Jul 27, 2021

Add new dynamic composable kernel under:
src/composable_kernel/, which is pulled in as a "git subtree" from composable kernel repo
https://github.com/ROCmSoftwarePlatform/composable_kernel

Move old static composable kernel to:
src/kernels/static_composable_kernel/

Add a new iGEMM solver for Forward NCHW FP32/FP16/Int8 (int8 is not supported by ConvolutionContext so the solver support for Int8 cannot be used yet):
src/solver/conv_ck_igemm_fwd_v6r1_dlops_nchw.cpp::ConvCkIgemmFwdV6r1DlopsNchw , which is calls into composable kernel solver:
src/composable_kernel/host/driver_online/include/conv_igemm_fwd_v6r1_dlops_nchw_kcyx_nkhw.hpp::ConvIgemmFwdV6r1DlopsNchwKcyxNkhw

@atamazov
Copy link
Contributor

@asroy > Move old static composable kernel to: src/kernels/static_composable_kernel/

Why, if we can keep old static ones as is, and add new kernels to .../dynamic_composable_kernel?

@atamazov
Copy link
Contributor

@asroy

src/composable_kernel/host/online_compilation/addkernels/*

Does it differ from addkernels that we already have in the tree?

@atamazov
Copy link
Contributor

@asroy

Add a new iGEMM solver for Forward NCHW FP32/FP16/Int8 (int8 is not supported by ConvolutionContext so the solver support for Int8 cannot be used yet)

This should not be so. We already have Int8 convolution Solvers. What is wrong?

@atamazov
Copy link
Contributor

@asroy

Add new dynamic composable kernel under: src/composable_kernel/, which is pulled in as a "git subtree" from composable kernel repo

I am sorry but I do not remember the motivation for subtree... Where can I refresh my memory (mail thread or ticket in the repo...)?

@atamazov
Copy link
Contributor

@asroy Have you looked at DeepCode's analysis?

@asroy
Copy link
Contributor Author

asroy commented Jul 28, 2021

@asroy > Move old static composable kernel to: src/kernels/static_composable_kernel/

Why, if we can keep old static ones as is, and add new kernels to .../dynamic_composable_kernel?

I plan to remove the old static kernel source code eventually

@asroy
Copy link
Contributor Author

asroy commented Jul 28, 2021

@asroy

src/composable_kernel/host/online_compilation/addkernels/*

Does it differ from addkernels that we already have in the tree?

It's used when building composable kernel alone (and outside MIOpen). It is not used in MIOpen.

The whole composable kernel is pulled in as subtree

@asroy
Copy link
Contributor Author

asroy commented Jul 28, 2021

@asroy

Add new dynamic composable kernel under: src/composable_kernel/, which is pulled in as a "git subtree" from composable kernel repo

I am sorry but I do not remember the motivation for subtree... Where can I refresh my memory (mail thread or ticket in the repo...)?

The motivation is to be able to sync composable kernel repo and MIOpen automatically.

We had the meeting in 07/06 "MIOpen and composable kernel", between you, @JehandadKhan @pfultz2, me and @zjing14. Subtree approach was suggested there

@asroy
Copy link
Contributor Author

asroy commented Jul 28, 2021

@asroy

Add a new iGEMM solver for Forward NCHW FP32/FP16/Int8 (int8 is not supported by ConvolutionContext so the solver support for Int8 cannot be used yet)

This should not be so. We already have Int8 convolution Solvers. What is wrong?

There is not "IsInt8()" in ConvolutionContext. I tried to add it once, but compiler complain something like no "InputTensorDataType()". So I gave up

@atamazov atamazov requested review from pfultz2 and removed request for atamazov July 28, 2021 16:12
@atamazov
Copy link
Contributor

@asroy

There is not "IsInt8()" in ConvolutionContext. I tried to add it once, but compiler complain something like no "InputTensorDataType()". So I gave up

If this is a showstopper, then please ask @DrizztDoUrden or me for assistance or open a ticket.

@atamazov
Copy link
Contributor

@asroy

src/composable_kernel/host/online_compilation/addkernels/*

Does it differ from addkernels that we already have in the tree?

It's used when building composable kernel alone (and outside MIOpen). It is not used in MIOpen.

[Notice]
This does not answer my question. Let me assume that this addkernels is a copy of the one that resides in MIOpen.

If the efforts to make the composable kernels independent has resulted in the addition of another implicit dependency (a copy of addkernels), then I'm afraid that something is wrong.

But well, I signed off from reviewing this, so let's actual reviewers decide.

@asroy
Copy link
Contributor Author

asroy commented Jul 30, 2021

The commit history in this PR is messed up, because I did subtree pulls from different remote branches and from different composable_kernel repo forks.

I realized it's important to have a single composble_kernel repo, and a single composble_kernel branch to pull from, in order to keep the commit historyu correct.

I need to close this PR and open a new PR.

@atamazov I will refer to all your comments here in the new PR

@atamazov
Copy link
Contributor

@asroy

The motivation is to be able to sync composable kernel repo and MIOpen automatically.

[Notice] Thanks for the explanation. Maybe I do not understand the meaning of "automatically" in this context. But would it allow something like a one-liner PR in MIOpen to completely change the implementation of the Solvers that employ composable kernels? If yes, then this looks dangerous to me.

@atamazov
Copy link
Contributor

@asroy

I will refer to all your comments here in the new PR

I see. Thank you.

@asroy
Copy link
Contributor Author

asroy commented Jul 30, 2021

@asroy

src/composable_kernel/host/online_compilation/addkernels/*

Does it differ from addkernels that we already have in the tree?

It's used when building composable kernel alone (and outside MIOpen). It is not used in MIOpen.

[Notice]
This does not answer my question. Let me assume that this addkernels is a copy of the one that resides in MIOpen.

If the efforts to make the composable kernels independent has resulted in the addition of another implicit dependency (a copy of addkernels), then I'm afraid that something is wrong.

But well, I signed off from reviewing this, so let's actual reviewers decide.

I don't have a good way to avoid this issue (some composable kernel host codes are not used in MIOpen) if using subtree feature. I actually brought up this issue during our 07/06 meeting as a side effect of using subtree (or submodules).

The only way I can think of it's to make composable_kernel as a separately compiled library and provide a API that return a string of kernel source code to MIOpen. This was an alternative brought up by @JehandadKhan. But the in the meeting, it was decided subtree is the way to go.

I'm fine with either approach, my goal is keep composable_kernel maintainable, by keeping kernel source codes in one place instead of manually copying source files between two repos.

If we can reach a consensus on the best approach to achieve this goal, and if time permit, I can change accordingly
cc @atamazov @pfultz2 @JehandadKhan @junliume @aserio

@asroy
Copy link
Contributor Author

asroy commented Jul 30, 2021

The commit history in this PR is messed up, because I did subtree pulls from different remote branches and from different composable_kernel repo forks.

I realized it's important to have a single composble_kernel repo, and a single composble_kernel branch to pull from, in order to keep the commit historyu correct.

I need to close this PR and open a new PR.

@atamazov I will refer to all your comments here in the new PR

Closing this PR.

Open new one #1071

@asroy asroy closed this Jul 30, 2021
@asroy asroy deleted the composable_kernel_init_integration_v2 branch August 20, 2021 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants