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
Add ernie c++ inference test #21015
Add ernie c++ inference test #21015
Conversation
test=develop
|
||
void SetConfig(AnalysisConfig *cfg) { | ||
cfg->SetModel(FLAGS_infer_model); | ||
cfg->DisableGpu(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加一下跟mkldnn、gpu的测试。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已增加。
1.20926, -1.62216, 0.202339, -0.51834, -0.255833, 0.403484, | ||
-1.61329, 2.44492, -0.621071, 1.93191, -2.43418, 0.252749, | ||
3.9044, -2.59725, -0.988252, -1.72084, 2.54846, -0.660083, | ||
-0.907154, -0.903408, 1.83843, 0.94278, -2.09705, 0.819825}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
结果还是跟模型、数据一起上传吧,这样比较容易扩展。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改,上传。
cfg->SwitchIrOptim(); | ||
cfg->SetCpuMathLibraryNumThreads(FLAGS_paddle_num_threads); | ||
if (FLAGS_zero_copy) { | ||
cfg->SwitchUseFeedFetchOps(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FLAGS_zero_copy
不只是加这一行,
- 如果打开开关不能跑的话,这个PR可以先去掉。
- 如果要支持的话,请参考 https://github.com/PaddlePaddle/Paddle/compare/develop...luotao1:bert_zero_copy?expand=1 并给出zero_copy在这个模型上是否有加速的benchmark result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
打开开关之后有问题,已去掉zero_copy。
@@ -129,6 +129,11 @@ set(PYRAMID_DNN_INSTALL_DIR "${INFERENCE_DEMO_INSTALL_DIR}/pyramid_dnn") | |||
download_model_and_data(${PYRAMID_DNN_INSTALL_DIR} "PyramidDNN_model.tar.gz" "PyramidDNN_data.txt.tar.gz") | |||
inference_analysis_api_test(test_analyzer_pyramid_dnn ${PYRAMID_DNN_INSTALL_DIR} analyzer_pyramid_dnn_tester.cc) | |||
|
|||
#Ernie | |||
set(ERNIE_INSTALL_DIR "${INFERENCE_DEMO_INSTALL_DIR}/ernie") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
因为CI会缓存目录,重新上传后,请换一个目录名字,比如Ernie
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
test=develop
test=develop
test=develop
|
||
if (use_mkldnn) { | ||
config.EnableMKLDNN(); | ||
config.pass_builder()->AppendPass("fc_mkldnn_pass"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥要在外面加这个pass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fc_mkldnn_pass属于可加可不加。如果fc_mkldnn_pass对ernie没有性能提速的话,不需要加。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经去掉fc_mkldnn_pass
|
||
if (use_gpu) { | ||
config.EnableUseGpu(100, 0); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 144 - 151可以挪到SetConfig函数里面。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
两个位置都移动到SetConfig函数里
test=develop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Great work!
* Add ernie unit test test=develop * Add ernie unit test test=develop * Add ernie unit test test=develop * remove ngraph * optimize gpu test test=develop * optimize codes test=develop
* Add ernie unit test test=develop * Add ernie unit test test=develop * Add ernie unit test test=develop * remove ngraph * optimize gpu test test=develop * optimize codes test=develop
* Add ernie unit test test=develop * Add ernie unit test test=develop * Add ernie unit test test=develop * remove ngraph * optimize gpu test test=develop * optimize codes test=develop
…22198) * Optimize the kernel implementation of layernorm with openmp (#20895) * Add ernie c++ inference test (#21015) * Add ernie unit test test=develop * Add ernie unit test test=develop * Add ernie unit test test=develop * remove ngraph * optimize gpu test test=develop * optimize codes test=develop * fix cmake fails on inference_download_and_uncompress (#21185) * solve cmake fails on inference_download_and_uncompress test=develop * solve cmake fails on inference_download_and_uncompress test=develop * Add fc padding to improve mkl GEMM's performance when N and K are multiple of 128. (#20972) * Add fc padding to solve mkl performance test=develop * fix gpu pass and error information test=develop * fix fc_fuse_pass_test test=develop * fix error information test=develop * fix error information test=develop * fix name and add fc op padding test test=develop * fix attributes test=develop * optimize fc padding test=develop * fix test test=develop * Polish the codes of fc when needs padding (#21378) test=develop * Add ernie large c++ inference test (#21365) * add ernie-large test test=develop * add ernie large c++ inference test test=develop * Modify padding strategy: remove weight copy in fc padding (#21650) test=develop * optimize fc jit (#21878) test=develop Co-authored-by: Yihua Xu <yihuaxu@hotmail.com>
Add ernie c++ inference test