Fix mkldnn related irpasses being added triple times#16225
Fix mkldnn related irpasses being added triple times#16225luotao1 wants to merge 1 commit intoPaddlePaddle:developfrom luotao1:mkldnn_placement_pass
Conversation
|
Roughly looking, this could work fine unless a user calls AnalysisConfig::EnableMKLDNN() twice. Now the flag use_mkldnn_ has no use in both:
|
flag use_mkldnn_ would be used in Paddle/paddle/fluid/inference/api/analysis_predictor.cc Lines 376 to 379 in c49e604 |
|
ok |
|
with this change, the issue looks like fixed, but it seems to cause status mismatch between Passes_ and use_mkldnn_ in CpuPassStrategy. use_mkldnn_ in old CpuPassStrategy instance was not copied into new one, while Passes_ copied. Better to add use_mkldnn_ in CpuPassStrategy copy constructor to avoid this mismatch. |
|
tensor-tang
left a comment
There was a problem hiding this comment.
LGTM.
Need @Superjomn 's double check.
I mean use_mkldnn_ in CpuPassStrategy/PassStrategy, instead of AnalysisConfig, There are 2 members named use_mkldnn_ , one is AnaysisConfig, the other in PassStrategy. with your change, passes_ will not be added again, but use_mkldnn_ in PassStrategy will be false. |
|
I agree with @LeoZhao-Intel that the use_mkldnn_ left in the PassStrategy now has no clear purpose and something should be done about it. |
pass_builder()->EnableMKLDNN()is called again inUpdate()after pass_builder reset (see Fix mkldnn related irpasses being added triple times #16175 (comment)).