[CINN] temp fix batch_norm check as inplace op bug #49738
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR types
Bug fixes
PR changes
Others
Describe
【临时方案】

修复
batch_norm
算子由于输出MeanOut
、VarianceOut
的变量与输入Mean
、Variance
完全一样,被识别成了inplace op,导致batch_norm
在子图划分的时候被判定为了CINN不支持算子的BUG(#46843 ),修复后PaddleClas Resnet50子图数目由56减少为6,且精度由不收敛变为收敛:该问题的根本原因在于CINN不支持inplace操作,且当前对于

batch_norm
的MeanOut
、VarianceOut
变量采用的是覆盖操作,而这会导致如下问题,此问题对batch_norm
的精度是有影响的,亟待解决: