Skip to content

Conversation

@etiotto
Copy link
Contributor

@etiotto etiotto commented Oct 21, 2025

We have implemented feature #5272 to collapse 3-dim loads on block ptrs into 2-dim loads when the tensor loaded has outermost dimension equal to 1. This feature compliments feature #5272. The goal here is to remove unnecessary boundaryCheck indexes on load operations if they are not necessary.

@etiotto etiotto self-assigned this Oct 21, 2025
@etiotto etiotto marked this pull request as ready for review October 21, 2025 22:15
Copy link
Contributor

@whitneywhtsang whitneywhtsang left a comment

Choose a reason for hiding this comment

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

please add a lit test

@chengjunlu
Copy link
Contributor

Why we want to remove the boundary check while the hardware support the boundary check natively?
To remove the boundary check. We'd generate some different block IO than natural to override the boundary check in HW.

@whitneywhtsang
Copy link
Contributor

Why we want to remove the boundary check while the hardware support the boundary check natively? To remove the boundary check. We'd generate some different block IO than natural to override the boundary check in HW.

It is to compliments feature #5272, it is not always safe to collapse dimensions when there is boundary check.

Signed-off-by: Ettore Tiotto <[email protected]>
@etiotto
Copy link
Contributor Author

etiotto commented Oct 22, 2025

please add a lit test

Added

@etiotto
Copy link
Contributor Author

etiotto commented Oct 22, 2025

Why we want to remove the boundary check while the hardware support the boundary check natively? To remove the boundary check. We'd generate some different block IO than natural to override the boundary check in HW.

It is to compliments feature #5272, it is not always safe to collapse dimensions when there is boundary check.

Correct. The idea of this pass is to remove boundary checks that are provably not needed (the load is always inbound in the associated boundaryCheck dimension). The transformation in #5272 (which runs later in the pass pipeline) will then be able to collapse the outermost dimension of the block ptr is the boundary check is not present.

Signed-off-by: Ettore Tiotto <[email protected]>
Signed-off-by: Ettore Tiotto <[email protected]>
@etiotto
Copy link
Contributor Author

etiotto commented Oct 24, 2025

@whitneywhtsang I have addressed review comments. How does it look now?

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.

3 participants