ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

ncnn下,有哪些方法可以加速推理

Open weilanShi opened this issue 5 years ago • 4 comments

作者你好,请问ncnn可以输入单通道图像吗,转到ncnn下,推理速度还是没有达到要求,请问下有哪些方法可以尽可能地加速推理过程呢

weilanShi avatar Sep 28 '20 02:09 weilanShi

可以输入单通道图像 如果想要更好的加速,设计模型的时候尽可能使用 ncnn 优化的卷积参数,比如常用的 conv1x1 conv3x3 depthwise-conv 等,不要用超大kernel(>7),dilation>1等

尝试绑定手机大核心,减少调度 ncnn::set_cpu_powersave(2); A53 可以尝试开启 bf16,net.opt.use_bf16_storage = true;

nihui avatar Oct 11 '20 05:10 nihui

可以输入单通道图像 如果想要更好的加速,设计模型的时候尽可能使用 ncnn 优化的卷积参数,比如常用的 conv1x1 conv3x3 depthwise-conv 等,不要用超大kernel(>7),dilation>1等

尝试绑定手机大核心,减少调度 ncnn::set_cpu_powersave(2); A53 可以尝试开启 bf16,net.opt.use_bf16_storage = true;

thanks

weilanShi avatar Nov 18 '20 03:11 weilanShi

ncnn::set_cpu_powercpu is now deprecated? Cann't use it now?

zengjie617789 avatar Apr 10 '25 02:04 zengjie617789

ncnn::set_cpu_powercpu is now deprecated? Cann't use it now?

there is set_cpu_powersave in cpu.h

nihui avatar Apr 10 '25 02:04 nihui