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

rv1109(armv7)上,ncnn推理出现core dump,具体报错位置在:gemm_transB_packed_tile() #5322

Closed
Xiaowei-coder opened this issue Jan 30, 2024 · 6 comments
Labels

Comments

@Xiaowei-coder
Copy link

Xiaowei-coder commented Jan 30, 2024

error log | 日志或报错信息 | ログ

报错信息如下:
image
bt信息:
image

context | 编译/运行环境 | バックグラウンド

编译环境:linux_x86
运行环境:rv1109(双核32位ARM Cortex-A7)
可用内存:789568 kB(rv1109)
编译ncnn版本:20240102

how to reproduce | 复现步骤 | 再現方法

  1. ./benchncnn 2 2 0 -1 1 param=./model.ncnn.param shape=[32,1,1,1],[2,96,1,1]
  2. model.ncnn.zip

more | 其他 | その他

  1. rv1109(armv7)上,benchncnn可正常推理squeezenet模型
    image
  2. rv1109(armv7)上,benchncnn推理则会在gemm_transB_packed_tile()处报相同的错误,如下:
    image
  3. 在rv1109(armv7)上会报错;其他arm平台则能正常推理,如下:
    image

Tasks

Preview Give feedback
No tasks being tracked yet.
@Xiaowei-coder
Copy link
Author

Xiaowei-coder commented Jan 31, 2024

补充说明

相同的代码与模型,交叉编译后,测试发现中间层参数不同,具体如下:

  1. 在不带neon的arm平台上,可正常推理[view_75->gemm_0]:
    image
  2. 带neon的arm平台上,会在gemm_0处报错[view_75->gemm_0]:
    image
    @nihui nihui大佬,请问开启neon指令集后,出现这种异常情况是什么原因导致的呢;是我模型转换的时候出问题了吗

@Xiaowei-coder
Copy link
Author

补充说明

(1)不开启NEON,ncnn可正常推理;开启NEON后,ncnn推理会在在gemm做矩阵乘法的位置出错:
LD}90D85 ZG6{ZD9Y24842E
(2)去掉ncnn模型中报错的层gemm_0,仍会在下次调用gemm矩阵乘法函数处报错;

  • gemm_0对应模型中的Linear层

(3)开启和不开启neon,AT_tile.w出现了2倍关系

@nihui nihui added the bug label Feb 2, 2024
@nihui
Copy link
Member

nihui commented Feb 2, 2024

confirmed and reproduced

workaround

net.opt.use_fp16_storage = ncnn::cpu_support_arm_asimdhp();

before loading model

@nihui
Copy link
Member

nihui commented Feb 2, 2024

#5325

@Xiaowei-coder
Copy link
Author

带上#5325 修改后,加载模型前无需设置net.opt.use_fp16_storage = ncnn::cpu_support_arm_asimdhp(),也能在我的armv7平台上推理,再次感谢nihui大佬。
image

@nihui
Copy link
Member

nihui commented Feb 2, 2024

fixed in 984d6dd
Thanks for your report

@nihui nihui closed this as completed Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants