Skip to content

[DT][NFCI] Implement getOffsetsSizesStrides for GPU padding resolver. - #22339

Merged
hanhanW merged 2 commits into
iree-org:mainfrom
hanhanW:padding-resolver-improvement-0
Oct 17, 2025
Merged

hanhanW merged 2 commits into
iree-org:mainfrom
hanhanW:padding-resolver-improvement-0

Conversation

@hanhanW

@hanhanW hanhanW commented Oct 16, 2025 •

Copy link
Copy Markdown
Contributor

The revision implement the interface method with the existing logic; it allows us to remove padding specific load/store patterns, because they use interfaces.

No new tests are added since it aims to be a refactor PR and tests should be covered by materialize_encoding_into_padding.mlir

It is a step towards #20160

@hanhanW
hanhanW requested review from jtuyls and kuhar October 16, 2025 23:22
The revision implement the interface method with the existing logic; it
allows us to remove padding specific load/store patterns, because they
use interfaces.

No new tests are added since it aims to be a refactor PR and tests
should be covered by [materialize_encoding_into_padding.mlir](https://github.com/iree-org/iree/blob/3b1730e5fa15a520505000b3f3232bd2a230793b/compiler/src/iree/compiler/Codegen/Common/test/materialize_encoding_into_padding.mlir)

Signed-off-by: hanhanW <[email protected]>
@hanhanW
hanhanW force-pushed the padding-resolver-improvement-0 branch from 0209993 to f71303b Compare October 16, 2025 23:38
materializeEncodingPattern.add<MaterializeFlowDispatchTensorLoadOp,
MaterializeFlowDispatchTensorStoreOp,
MaterializeInterfaceBindingEncoding>(
materializeEncodingPattern.add<MaterializeInterfaceBindingEncoding>(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The removal of MaterializeInterfaceBindingEncoding requires some more work; I'll work on it in a follow-up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Then we should be closer to retire the pass.

Signed-off-by: hanhanW <[email protected]>
@hanhanW
hanhanW merged commit acbd6de into iree-org:main Oct 17, 2025
@hanhanW
hanhanW deleted the padding-resolver-improvement-0 branch October 17, 2025 03:29
if (!boundType || !boundType.getEncoding()) {
return failure();
}
newSizes = getMixedValues(boundType.getShape(), dynamicDims, builder);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment as on the IdentityEncoding PR, but I think that we should check whether the provided offsets, sizes and strides, span the whole tensor?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My understanding about the attribute is that they don't transfer the actual sizes/offsets/strides, so it is okay to remove the check. However, I understand that the tests are missing because of the current pattern implmenetations, so I'm okay with adding it back. See #22337 (comment) for details.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

#22359 should address your concern, thanks for catching it!

weidel-p pushed a commit to weidel-p/iree that referenced this pull request Oct 21, 2025
…iree-org#22339)

The revision implements the interface method with the existing logic; it
allows us to remove padding specific load/store patterns, because they
use interfaces.

No new tests are added since it aims to be a refactor PR and tests
should be covered by
[materialize_encoding_into_padding.mlir](https://github.com/iree-org/iree/blob/3b1730e5fa15a520505000b3f3232bd2a230793b/compiler/src/iree/compiler/Codegen/Common/test/materialize_encoding_into_padding.mlir)

It is a step towards iree-org#20160

---------

Signed-off-by: hanhanW <[email protected]>
Signed-off-by: Philipp <[email protected]>
pstarkcdpr pushed a commit to pstarkcdpr/iree that referenced this pull request Nov 28, 2025
…iree-org#22339)

The revision implements the interface method with the existing logic; it
allows us to remove padding specific load/store patterns, because they
use interfaces.

No new tests are added since it aims to be a refactor PR and tests
should be covered by
[materialize_encoding_into_padding.mlir](https://github.com/iree-org/iree/blob/3b1730e5fa15a520505000b3f3232bd2a230793b/compiler/src/iree/compiler/Codegen/Common/test/materialize_encoding_into_padding.mlir)

It is a step towards iree-org#20160

---------

Signed-off-by: hanhanW <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants