Skip to content

[TOOLS][ADD] Model checker support Huawei NPU#684

Merged
shaundai-tencent merged 13 commits into
masterfrom
model_checker_npu_support
Dec 31, 2020
Merged

[TOOLS][ADD] Model checker support Huawei NPU#684
shaundai-tencent merged 13 commits into
masterfrom
model_checker_npu_support

Conversation

@daigx1124
Copy link
Copy Markdown
Contributor

@daigx1124 daigx1124 commented Dec 30, 2020

  1. Support Huawei NPU in model checker;
  2. fix npu pooling and upsample layer bug;
  3. fix network structure break due to HuaweiNPU.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Dec 30, 2020

Codecov Report

Merging #684 (bfaa12a) into master (2483c38) will increase coverage by 0.28%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #684      +/-   ##
==========================================
+ Coverage   33.00%   33.28%   +0.28%     
==========================================
  Files         288      298      +10     
  Lines        8472     8814     +342     
==========================================
+ Hits         2796     2934     +138     
- Misses       5676     5880     +204     
Impacted Files Coverage Δ
include/tnn/core/common.h 100.00% <0.00%> (ø)
include/tnn/core/status.h 100.00% <0.00%> (ø)
source/tnn/core/layer_type.cc 100.00% <0.00%> (ø)
source/tnn/interpreter/layer_param.h 0.00% <0.00%> (ø)
source/tnn/optimizer/optimizer_const.h 100.00% <0.00%> (ø)
...ce/tnn/optimizer/net_optimizer_cbam_fused_reduce.h 100.00% <0.00%> (ø)
source/tnn/layer/cbam_fused_pooling_layer.cc 11.76% <0.00%> (ø)
source/tnn/core/blob_int8.h 100.00% <0.00%> (ø)
.../tnn/optimizer/net_optimizer_cbam_fused_pooling.cc 16.27% <0.00%> (ø)
source/tnn/layer/cbam_fused_reduce_layer.cc 10.52% <0.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2483c38...bfaa12a. Read the comment docs.

Comment on lines +107 to +108
*sub_network_interp_->GetNetStructure() = *default_interpreter->GetNetStructure();
*sub_network_interp_->GetNetResource() = *default_interpreter->GetNetResource();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接对一个对象的私有成员变量赋值,感觉不太像一个规范的做法

Comment thread tools/model_check/main.cc Outdated
"OPENCL, METAL, ARM, CUDA\n"
"\t-i, --input \t(optional) input file\n"
"\t-o, --output \t(optional) dump output\n"
"\t-c, --cmp_o \t(optional) compare output only\n"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个参数感觉有点奇怪,有点意义不明,在前面的很多脚本中,-c 都是clean的意思

Comment thread tools/model_check/model_checker.h Outdated
Comment on lines +68 to +69
bool CompareData(void* device_data, void* cpu_data, DimsVector blob_dims);
void DumpBlobData(void* blob_data, DimsVector blob_dims,
std::string output_name);
bool CompareDiffCosDistance(void* device_data, void* cpu_data, DimsVector blob_dims);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个两个接口的参数完全一样,是不是可以通过增加一个compare_type的参数,不然后面如果有个MSE的方式,又得加一个接口

@shaundai-tencent shaundai-tencent merged commit 3e53f76 into master Dec 31, 2020
@shaundai-tencent shaundai-tencent deleted the model_checker_npu_support branch December 31, 2020 05:25
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

Successfully merging this pull request may close these issues.

4 participants