optimize elementwise_min_grad using new reduce interface #38236
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
Performance optimization
PR changes
OPs
Describe
功能
该PR使用Reduce接口优化了elementwise_min的反向计算
效果
以下是op-benchmark效果,其中「paddle优化1」 表示使用Reduce初步优化效果;「paddle优化2」表示进一步优化,即三元计算替换二元计算后的优化效果:
整体上,效果与elementwise_max_grad几乎相同:优化3(适配多输出代码优化后)较优化1(reduce接口优化)、优化2(三元functor优化)均有显著提升;但当前前两个配置差于dev 10%左右;