Skip to content
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

Merged
merged 2 commits into from
Jul 17, 2024
Merged

Conversation

makslevental
Copy link
Collaborator

@makslevental makslevental commented Jul 16, 2024

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

@makslevental makslevental force-pushed the makslevental/zero-padding branch 3 times, most recently from fba7384 to 3d1c7c4 Compare July 16, 2024 22:08
@makslevental makslevental changed the title [wip] port zero-padding Port zero-padding from mlir-aie Jul 16, 2024
@makslevental makslevental marked this pull request as ready for review July 16, 2024 22:09
@erwei-xilinx
Copy link
Contributor

Yeah the tests make sense to me.

@makslevental makslevental force-pushed the makslevental/zero-padding branch from 3d1c7c4 to a6e806b Compare July 16, 2024 22:28
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() *
Copy link
Collaborator

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.

Copy link
Collaborator

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

Copy link
Collaborator

@jtuyls jtuyls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@makslevental makslevental enabled auto-merge (squash) July 17, 2024 22:28
@makslevental makslevental force-pushed the makslevental/zero-padding branch from 1a4c050 to cfa3c9d Compare July 17, 2024 22:30
@makslevental makslevental force-pushed the makslevental/zero-padding branch from cfa3c9d to 67dcdea Compare July 17, 2024 22:55
@makslevental makslevental merged commit a1460a8 into main Jul 17, 2024
2 checks passed
@makslevental makslevental deleted the makslevental/zero-padding branch July 17, 2024 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port zero-padding from mlir-aie
3 participants