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
MQBench的结果与SNPE DSP的结果不是位精确的 #109
Comments
整个流程没有任何问题,事实上我们几乎不可能做到在pytorch里bit对齐后端硬件,有太多未知的运算细节. |
谢谢! |
@Tracin 我进一步测试了一下mobilenetv3-small(num_classes=2),发现有些样本quantsim的结果为[-0.6173174 -0.05346843] 想请问一下,有哪些地方可以改进来尽量对齐quantsim和DSP的结果,是不是mobilenetv3不适合来做量化 |
可以先检查量化参数是否正确
|
我的整个模型是UNet的模式,有三个输出
1.我检查了带量化节点的onnx,看上去没有问题。
DLC-quant的输出是:
我发现几个问题: 我把onnx json和dlc的log放在了zip文件里面,如果可以帮忙看看,谢谢 |
可以尝试:
|
This issue has not received any updates in 120 days. Please reply to this issue if this still unresolved! |
MQBench是一个非常有趣的项目。
环境
pytorch: 1.8.1
MQBench: branch main, e217520
SNPE: snpe-1.61.0.3358
问题:
我用一个只有两层卷积模型做了一个简单的测试,比对MQBench 量化后的结果和SNPE DSP的结果,发现并不是位精确的,请问一下这是否是正常的,我是否有哪里做错了。
复现
DLC转换
./snpe-onnx-to-dlc --input_network mqbench_qmodel_deploy_model.onnx --output_path tmp.dlc --quantization_overrides mqbench_qmodel_clip_ranges.json
./snpe-dlc-quantize --input_dlc tmp.dlc --input_list tmp_file.txt --output_dlc tmp_quat_mq.dlc --override_params --bias_bitwidth 32
tmp_file.txt和tmp_file_android.txt都只有一个文件就是tmp.raw,tmp.raw在上面python程序里面保存下来为一个3x20x20的float文件
SNPE DSP run
./snpe-net-run --container /sdcard/tmp_quat_mq.dlc --input_list /sdcard/tmp_file_android.txt --use_dsp
##################################################
74.raw
(20,)
[-0.34493 -0.285929 -0.081694 -0.222389 0.127079 0.236005 0.435701
-0.299544 -0.049924 0.226927 -0.036308 0.081694 -0.149772 -0.172465
0.131618 0.149772 -0.490163 -0.177003 0.599088 -0.068078]
比对quant sim result 和 DSP 的结果,可以看到粗斜体是二者不一致的地方
The text was updated successfully, but these errors were encountered: