-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port zero-padding from mlir-aie #560
Conversation
fba7384
to
3d1c7c4
Compare
Yeah the tests make sense to me. |
3d1c7c4
to
a6e806b
Compare
before = static_cast<uint8_t>(padDims.value()[i].getConstPadBefore()); | ||
after = static_cast<uint8_t>(padDims.value()[i].getConstPadAfter()); | ||
} else { | ||
before = static_cast<uint8_t>(padDims.value()[i].getConstPadBefore() * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we check that (padDims.value()[i].getConstPadBefore() * elementWidthIn32bWords) % 4 == 0
and fail otherwise? Otherwise, this could lead to hard to debug incorrect results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit: As discussed offline (padDims.value()[i].getConstPadBefore() * elementWidthIn32bWords) % 4 == 0
is incorrect. It should be bdOp.getBufferElementTypeWidthInBytes() * padDims.value()[i].getConstPadBefore() % 4 == 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
1a4c050
to
cfa3c9d
Compare
cfa3c9d
to
67dcdea
Compare
This PR adds zero-padding support to our CDO emission utility (port of Xilinx/mlir-aie#1613).
I trimmed the test cases down @erwei-xilinx can you give it a quick look to see if I didn't slip and miss something.
Fixes #537
cc @yzhang93 @MaheshRavishankar