CINN icon indicating copy to clipboard operation
CINN copied to clipboard

Add ReductionRewrite ProgramPass

Open Avin0323 opened this issue 3 years ago • 1 comments

新增ReductionRewrite

以一种无需原子就能实现的方式重写reduction:将一个reduction操作重写为两个。

将:

f32[B] out = reduce(f32[A, B, C] input, dimensions={0, 2})

重写为:

f32[A, B] tmp = reduce(f32[A, B, C] input, dimensions={2})
f32[B] out = reduce(f32[A, B] tmp, dimensions={0})

Avin0323 avatar Feb 28 '22 12:02 Avin0323

Thanks for your contribution!

paddle-bot-old[bot] avatar Feb 28 '22 12:02 paddle-bot-old[bot]