Repository navigation
Fix out-of-bound accessing in pad op lowering. - #2615
Conversation
This also fixes convolution issue, because there is a pass to extract padding attributes from convolution op, which hits pad op issue as well. Fixes iree-org#2531 Fixes iree-org#2530 Fixes iree-org#2345
antiagainst
left a comment
There was a problem hiding this comment.
Super awesome! One pull request to close three issues. Thanks Hahan!!
| // value. | ||
| const auto &edgePaddingLow = op.edge_padding_low(); | ||
| const auto &edgePaddingHigh = op.edge_padding_high(); | ||
| const auto &interiorPadding = op.interior_padding(); |
There was a problem hiding this comment.
So we return error when interior padding contains non-zero values at the very beginning. Here we are actually able to handle that case.. Should we drop the check at the beginning? (Can happen as a separate patch and will want to have tests.)
There was a problem hiding this comment.
Ah, forgot the condition. I think we can remove it, it was there because it made the logic complicated. It's simple in this approach, let me also add a test for it.
note that it's still passing on Android.
| rewriter.create<CmpIOp>(loc, CmpIPredicate::slt, dim, bound); | ||
| applyAndOp(checkUb); | ||
| } | ||
| // The pass for splitting dispatch function for vulkan requires no other ops |
There was a problem hiding this comment.
That pass should be relaxed to allow "metadata" ops in the middle. Technically this pass should not be concerning its downstream users.. But it's fine for now. :)
There was a problem hiding this comment.
Cool, I added a TODO here. Once the condition is relaxed, we can move it to before where it's used.
|
Thanks. Sorry I missed this (had an issue with notifications that is fixed now) |
This also fixes convolution issue, because there is a pass to extract
padding attributes from convolution op, which hits pad op issue as well.
Fixes #2531
Fixes #2530
Fixes #2345