Repository navigation
[NFC][Encoding] Move materializeEncodingValueFn to type converter - #20720
Merged
Merged
Conversation
Signed-off-by: Jorn Tuyls <[email protected]>
hanhanW
approved these changes
May 5, 2025
Comment on lines
+147
to
+148
| if (llvm::all_of(staticTileSizes, | ||
| [](int64_t i) { return !ShapedType::isDynamic(i); })) { |
Contributor
There was a problem hiding this comment.
We can avoid the lambda if we use ShapedType::isDynamicShape(staticTileSizes). It also looks cleaner to me.
I understand that it is refactoring the code. I'd appreciate it if you update the old code during the refactoring. We can either fix it in my PR (#20731) or in your PR.
(My PR exclude this case to avoid conflict. I can make the change after you land this. Either works for me. I'll let you make the call.)
Contributor
|
Actually, let's go ahead and merge the PR because my comment is very trivial. Any post comments from other reviewers can be addressed in a follow-up (, if someone chimes in). This is a reasonable change to me. Merging the PR now. |
KyleHerndon
pushed a commit
to KyleHerndon/iree
that referenced
this pull request
May 7, 2025
…ee-org#20720) This PR performs some refactoring as part of collapsing MaterializeEncodingIntoPadding into MaterializeEncoding (iree-org#20160) and moves the `materializeEncodingValueFn` parameter from OpMaterializeEncodingPattern to the MaterializeEncodingTypeConverter, together with the `getInnerTileSizesOfr` implementation, for following reasons: - The `typeConverter` and `materializeEncodingValueFn` objects are typically passed around together, so now only `typeConverter` needs to be passed around and this simplifies the code. - As part of iree-org#20160, I am creating a `getOffsetsSizesStrides` method in the MaterializeEncodingTypeConverter and SerializableEncodingAttrInterface and all encoding specific logic should be moved there. I would specifically like to avoid the need for passing a `MaterializeEncodingValueFn` to `getOffsetsSizesStrides`. This PR moves us in that direction. Signed-off-by: Jorn Tuyls <[email protected]>
AWoloszyn
pushed a commit
that referenced
this pull request
Dec 1, 2025
…0720) This PR performs some refactoring as part of collapsing MaterializeEncodingIntoPadding into MaterializeEncoding (#20160) and moves the `materializeEncodingValueFn` parameter from OpMaterializeEncodingPattern to the MaterializeEncodingTypeConverter, together with the `getInnerTileSizesOfr` implementation, for following reasons: - The `typeConverter` and `materializeEncodingValueFn` objects are typically passed around together, so now only `typeConverter` needs to be passed around and this simplifies the code. - As part of #20160, I am creating a `getOffsetsSizesStrides` method in the MaterializeEncodingTypeConverter and SerializableEncodingAttrInterface and all encoding specific logic should be moved there. I would specifically like to avoid the need for passing a `MaterializeEncodingValueFn` to `getOffsetsSizesStrides`. This PR moves us in that direction. Signed-off-by: Jorn Tuyls <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR performs some refactoring as part of collapsing MaterializeEncodingIntoPadding into MaterializeEncoding (#20160) and moves the
materializeEncodingValueFnparameter from OpMaterializeEncodingPattern to the MaterializeEncodingTypeConverter, together with thegetInnerTileSizesOfrimplementation, for following reasons:typeConverterandmaterializeEncodingValueFnobjects are typically passed around together, so now onlytypeConverterneeds to be passed around and this simplifies the code.getOffsetsSizesStridesmethod in the MaterializeEncodingTypeConverter and SerializableEncodingAttrInterface and all encoding specific logic should be moved there. I would specifically like to avoid the need for passing aMaterializeEncodingValueFntogetOffsetsSizesStrides. This PR moves us in that direction.