PaddlePaddle / Paddle-Lite

PaddlePaddle High Performance Deep Learning Inference Engine for Mobile and Edge (飞桨高性能深度学习端侧推理引擎)
https://www.paddlepaddle.org.cn/lite
Apache License 2.0
6.92k stars 1.61k forks source link

晶晨C308x运行picodet报错:Can not add a aml::nn::Tensor with precision=TENSOR_QUANT_INT8_SYMM_PER_CHANNEL ! #7752

Closed apupu1 closed 2 years ago

apupu1 commented 2 years ago

如题,CPU可运行,NPU报错如下:

[I 1/ 1 2:17:25.165 ...le-Lite/lite/core/optimizer/optimizer.cc:104 ApplyPasses] == Running pass: xpu_memory_optimize_pass [I 1/ 1 2:17:25.165 ...le-Lite/lite/core/optimizer/optimizer.cc:112 ApplyPasses] - Skip xpu_memory_optimize_pass because the target or kernel does not match. [I 1/ 1 2:17:25.288 ...re/optimizer/mir/generate_program_pass.h:41 GenProgram] insts.size: 1 [I 1/ 1 2:17:25.548 ...e-Lite/lite/model_parser/model_parser.cc:562 SaveModelNaive] 2. Model is optimized and saved into ./picodet_s_ptq.nb successfully [W 1/ 1 2:17:25.804 ...adapter/nnadapter/runtime/compilation.cc:210 Finish] Failed to create a program, No model and cache is provided. [W 1/ 1 2:17:25.804 ...le-Lite/lite/kernels/nnadapter/engine.cc:122 LoadFromCache] Build model failed(2) ! [I 1/ 1 2:17:25.806 ...r/nnadapter/driver/amlogic_npu/driver.cc:66 CreateProgram] Create program for amlogic_npu. ovxlib version 1_1_27ccccreatTensor dim 0:320 ccccreatTensor dim 1:320 ccccreatTensor dim 2:3 ccccreatTensor dim 3:1 this is output:320 [F 1/ 1 2:17:25.857 .../nnadapter/driver/amlogic_npu/utility.cc:178 CreateAmlTensor] Can not add a aml::nn::Tensor with precision=TENSOR_QUANT_INT8_SYMM_PER_CHANNEL ! [F 1/ 1 2:17:25.857 .../nnadapter/driver/amlogic_npu/utility.cc:178 CreateAmlTensor] Can not add a aml::nn::Tensor with precision=TENSOR_QUANT_INT8_SYMM_PER_CHANNEL ! [F 1/ 1 2:17:25.858 ...adapter/nnadapter/runtime/compilation.cc:75 ~Compilation] Check failed: device_context: No device found. [F 1/ 1 2:17:25.858 ...adapter/nnadapter/runtime/compilation.cc:75 ~Compilation] Check failed: device_context: No device found. terminate called after throwing an instance of 'nnadapter::logging::NNAdapterException' what(): NNAdapter C++ Exception: [F 1/ 1 2:17:25.858 ...adapter/nnadapter/runtime/compilation.cc:75 ~Compilation] Check failed: device_context: No device found. Aborted

以上,是什么原因呢?该如何解决?谢谢

paddle-bot-old[bot] commented 2 years ago

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网文档常见问题历史Issue来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQ and Github Issue to get the answer.Have a nice day!

hong19860320 commented 2 years ago

晶晨NPU在即将发布的Paddle Lite 2.10正式版目前只支持MobileNetV1-int8、ResNet-50-int8和SSD-MobileNetV1-relu-int8(静态图)模型,picodet目前还没有适配哈,还有晶晨和瑞芯微NPU都不支持per channel的量化方式哈,只支持per layer的哦,这个是硬件的限制呢。 https://paddle-lite.readthedocs.io/zh/latest/demo_guides/amlogic_npu.html

hong19860320 commented 2 years ago

我们正在通过芯原TIM-VX 支持瑞芯微RK1808/RV1109/RV1126、Amlogic C308X/S905D3/A311D和 NXP i.MX 8 plus的 NPU,解决目前算子、模型支持较少的问题,到明年 Q1会得到缓解,预计今年12月底会覆盖如下开源模型:

其它 PP 系列模型(例如picodet)也会在明年Q1纳入到重点模型支持中,感谢关注哈~

apupu1 commented 2 years ago

谢谢回复