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

opencl的一个bug #91

Open
peyer opened this issue Jan 26, 2022 · 8 comments
Open

opencl的一个bug #91

peyer opened this issue Jan 26, 2022 · 8 comments

Comments

@peyer
Copy link

peyer commented Jan 26, 2022

我在测试bolt的opencl时发现一个bug;
由于bolt采用了NCHW / NCHWC4等数据排布混用、针对opencl在层与层之间的blob混用了buffer、image1d、image2d、image3d,同时内存分配上还采用了内存复用,可能导致了我的一个模型在depth2space_ocl层触发了一个bug,就是depth2space对应的kernel的arg里是写的是buffer的输入类型,但是内存复用以后,对应arg传入了一个image3d的数据类型,导致set_arg报错CL_INVALID_MEM_OBJ,我还在定位是内存复用的代码

@yunfanxiao
Copy link
Contributor

你好,正常情况下depth2space的output不会被设置为image类型,可在cnn.cpp与memory_tracker的相关代码中定位为何被修改为image,可打开debug模式获取更多信息。

@peyer
Copy link
Author

peyer commented Jan 28, 2022

上面的表述有误,我更正一下;应该是depth2space前一层是conv,conv的output是image类型并给了depth2space做输入,而depth2space的输入支持buffer的类型

@peyer
Copy link
Author

peyer commented Jan 28, 2022

python脚本构造一个简易网络,第一层是conv,输入1x2x4x4,filter16x2x3x3,stride=1,pad=0,dilation=1,输出1x16x2x2,第二层是depth2space,blocksize=4,输出1x1x8x8,也会触发

@yunfanxiao
Copy link
Contributor

这里确实有些问题,请问计算触发depth2space_mali_fp16.cpp 74行的转换了吗?

@peyer
Copy link
Author

peyer commented Jan 28, 2022

2分支都可能触发错误;因为depth2space的kernel输入只支持buffer的类型,一旦前一层传递一个image的就会出错

@yunfanxiao
Copy link
Contributor

提交了一个修复的patch,可以试一试#92

@peyer
Copy link
Author

peyer commented Feb 7, 2022

@yunfanxiao 还是有点问题,需要再改一下
image

@peyer
Copy link
Author

peyer commented Feb 7, 2022

按理说github的单元测试应该很容易找到这个bug,是CI没有跑就强合了吗?

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

2 participants