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

Gemm kernel does not exist #15

Closed
shidong-ai opened this issue Jul 18, 2017 · 8 comments
Closed

Gemm kernel does not exist #15

shidong-ai opened this issue Jul 18, 2017 · 8 comments

Comments

@shidong-ai
Copy link

Hello, I was using MIOpen as an external library when implementing my own program. But below error occurs when I call the convolution forward API. I tried to link the miopengemm to the program, but it still doesn't work. Anyone got any clue? Thanks in advance!

ROCmSoftwarePlatform/MIOpen/src/gemm.cpp:329: looking for gemm kernel (does not exist): miopenConvolutionFwdAlgoGEMM, tC0_tA0_tB0_colMaj1_m65536_n32_k75_lda65536_ldb75_ldc65536_ws0_f32

@dagamayank
Copy link
Contributor

dagamayank commented Jul 18, 2017

@doody1986 Do you have miopengemm installed on your system, as noted in the Prerequisites section of the README?

If yes, can you set export MIOPEN_ENABLE_LOGGING=1 and provide the output.

@shidong-ai
Copy link
Author

@dagamayank
I did install that, and the output is as below. Thanks a lot !
miopenStatus_t miopenCreateTensorDescriptor(miopenTensorDescriptor_t *){
tensorDesc = 0x6572695720646e61
}
miopenStatus_t miopenCreateTensorDescriptor(miopenTensorDescriptor_t *){
tensorDesc = 0x30363237
}
miopenStatus_t miopenCreateConvolutionDescriptor(miopenConvolutionDescriptor_t *){
convDesc = 0
}
miopenStatus_t miopenCreateTensorDescriptor(miopenTensorDescriptor_t *){
tensorDesc = 0x303632
}
miopenStatus_t miopenSet4dTensorDescriptor(miopenTensorDescriptor_t, miopenDataType_t, int, int, int, int){
tensorDesc =
dataType = 1
n = 100
c = 3
h = 256
w = 256
}
miopenStatus_t miopenInitConvolutionDescriptor(miopenConvolutionDescriptor_t, miopenConvolutionMode_t, int, int, int, int, int, int){
convDesc = 0, 0, 1, 1, 1, 1,
mode = 0
pad_h = 2
pad_w = 2
u = 1
v = 1
dilation_h = 1
dilation_w = 1
}
miopenStatus_t miopenSet4dTensorDescriptor(miopenTensorDescriptor_t, miopenDataType_t, int, int, int, int){
tensorDesc =
dataType = 1
n = 32
c = 3
h = 5
w = 5
}
miopenStatus_t miopenSet4dTensorDescriptor(miopenTensorDescriptor_t, miopenDataType_t, int, int, int, int){
tensorDesc =
dataType = 1
n = 100
c = 32
h = 256
w = 256
}
miopenStatus_t miopenConvolutionForwardGetWorkSpaceSize(miopenHandle_t, const miopenTensorDescriptor_t, const miopenTensorDescriptor_t, const miopenConvolutionDescriptor_t, const miopenTensorDescriptor_t, size_t *){
wDesc = 32, 3, 5, 5
yDesc = 100, 32, 256, 256
convDesc = 2, 2, 1, 1, 1, 1,
workSpaceSize = 3159602
}
miopenStatus_t miopenConvolutionBackwardWeightsGetWorkSpaceSize(miopenHandle_t, const miopenTensorDescriptor_t, const miopenTensorDescriptor_t, const miopenConvolutionDescriptor_t, const miopenTensorDescriptor_t, size_t *){
dyDesc = 100, 32, 256, 256
xDesc = 100, 3, 256, 256
convDesc = 2, 2, 1, 1, 1, 1,
dwDesc = 32, 3, 5, 5
workSpaceSize = 14416760
}
miopenStatus_t miopenConvolutionBackwardDataGetWorkSpaceSize(miopenHandle_t, const miopenTensorDescriptor_t, const miopenTensorDescriptor_t, const miopenConvolutionDescriptor_t, const miopenTensorDescriptor_t, size_t *){
dyDesc = 100, 32, 256, 256
wDesc = 32, 3, 5, 5
convDesc = 2, 2, 1, 1, 1, 1,
dxDesc = 100, 3, 256, 256
workSpaceSize = 0
}
miopenStatus_t miopenConvolutionForward(miopenHandle_t, const void *, const miopenTensorDescriptor_t, const void *, const miopenTensorDescriptor_t, const void *, const miopenConvolutionDescriptor_t, miopenConvFwdAlgorithm_t, const void *, const miopenTensorDescriptor_t, void *, void *, size_t){
alpha = 0x7f55c0a81138
xDesc = 100, 3, 256, 256
x = 0x22010a7000
wDesc = 32, 3, 5, 5
w = 0x226e6ab000
convDesc = 2, 2, 1, 1, 1, 1,
algo = 0
beta = 0x7f55c0a82a34
yDesc = 100, 32, 256, 256
y = 0x220a6a9000
workSpace = 0x226e6b3000
workSpaceSize = 19660800
}
MIOpen Error: /home/yifan/dev/src/github.com/ROCmSoftwarePlatform/MIOpen/src/gemm.cpp:329: looking for gemm kernel (does not exist): miopenConvolutionFwdAlgoGEMM, tC0_tA0_tB0_colMaj1_m65536_n32_k75_lda65536_ldb75_ldc65536_ws0_f32

@dagamayank
Copy link
Contributor

How did you install miopengemm? The above convolution is working fine on my end.

@shidong-ai
Copy link
Author

@dagamayank
I just used "sudo apt-get install miopengemm. Is that all right?

@shidong-ai
Copy link
Author

@dagamayank
I tried to build an MIOpen library with miopengemm instead of using the one installed, but it still doesn't work.

@patflick
Copy link
Contributor

@doody1986

You have to run miopenFindConvolutionForwardAlgorithm(...) prior to miopenConvolutionForward.

In your log above it looks like you're not doing this. The Find type functions will create and compile multiple kernels, and then run each one once to find the fastest one. The miopenConvolutionForward function then just tries to load the kernel, but fails because the kernel was not yet created/compiled.

@shidong-ai
Copy link
Author

Thanks a lot! That explains a lot. I thought it would work when I hard-coded the algorithm in my code

@dagamayank
Copy link
Contributor

@patflick Thanks for catching that. I also added a wiki page to clarify a bit about MIOpen Convolutions.

ltqin pushed a commit that referenced this issue Oct 28, 2021
646fcc268 Merge pull request #47 from ROCmSoftwarePlatform/develop
6014185ac [Bug Fix] GridwiseGemm_bk0mk1_bk0nk1_mn_xdlops_v2r4 loop issue (#44)
3e9113707 Merge pull request #46 from ROCmSoftwarePlatform/miopen_downstream_all
211dae822 Merge branch 'develop' into miopen_downstream_all
5890e3007 [Composable Kernel] update develop branch code to ck_upstream
d5297abae fix bug in gridwise gemm xdlops v2r3 (#45)
38a90b6ed Merge pull request #43 from ROCmSoftwarePlatform/develop
c3018794b bug fix (#39)
fd49ff808 add nchw atomic , nhwc and nhwc atomic method   for backward weight (#30)
b2dc55f82 [MIOpen Downstream] Fix Reduction Kernel (#34)
b3e8d57d5 Tweak GEMM kernel (#38)
846f462bd Add VectorType support into StaticBuffer (#27)
dfb80c4e3 [Enhancements] Several bugfixes and refactoring of dynamic generic reduction  (#1156)
8557901d0 Merge pull request #1165 from ROCmSoftwarePlatform/develop
f305bebdc Merge pull request #31 from ROCmSoftwarePlatform/miopen_downstream-dynamic_reduction_pr
b725e3fc8 Merge remote-tracking branch 'origin/develop' into miopen_downstream-dynamic_reduction_pr
88833bd9a Merge pull request #32 from ROCmSoftwarePlatform/develop
df0d68106 :Merge remote-tracking branch 'origin/develop' into CK_upstream
f3acd2510 Add  a version of Merge transform that use integerdivision and mod (#25)
19613902b GEMM driver and kernel (#29)
627d8ef35 Backward weight v4r4r2 with xdlops (#18)
10bb81106 Misc fixes (#24)
9e80cdceb [SWDEV-281541][MSRCHA-100] Implementation of Dynamic Generic Reduction  (#1108)
a7a758d8c GlobalAtomicAdd for fp32/int32 (#23)
9d3f634a3 Xdlops refactor fix (#22)
c6f26bb48 magic division use __umulhi() (#19)
6fe3627a9 Composable kernel init integration v3 (#1097)
a2ad6d353 refactor dynamic xdlops iGemm (#13)
ba6f79a75 Added host_conv_wrw for verification (#15)

git-subtree-dir: src/composable_kernel
git-subtree-split: 646fcc268ede841a16cdaafb68aa64803d8390e1
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

No branches or pull requests

3 participants