BladeDISC icon indicating copy to clipboard operation
BladeDISC copied to clipboard

Please add mhlo::PadOp lowering in disc

Open tanyokwok opened this issue 2 years ago • 2 comments

Currently, DISC lowers all pad-like op into mhlo::DynamicPadOp. However, the DPadToPad pattern in mhlo::DynamicPadOp's CanonicalizationPatterns may convert mhlo::DynamicPadOp into mhlo::PadOp since the rebase https://github.com/alibaba/BladeDISC/pull/525. It will cause lowering exception of DISC.

To address the issue, we masked the usage of DPadToPad pattern. I think more foundermental solution is to add mhlo::PadOp lowering and codegen in DISC.

tanyokwok avatar Aug 10 '22 08:08 tanyokwok

Seems because we only handle DynamicPadOp through out the lowering pipeline. (for simplicity??) How about add a pass somewhere in early stage to convert PadOp to DynamicPadOp?

qiuxiafei avatar Aug 29 '22 07:08 qiuxiafei

Yes, DISC did do that. But DPadToPad will convert PadOp back to DynamicPadOp.

tanyokwok avatar Aug 30 '22 01:08 tanyokwok

We now convert mhlo::PadOp into mhlo::DynamicPadOp in DISC, since the dynamic one is more general https://github.com/alibaba/BladeDISC/pull/978

tanyokwok avatar Feb 02 '23 03:02 tanyokwok