Skip to content

[Encoding] Drop resolver interface implementation for SpecializedEncodingAttr - #20718

Merged
hanhanW merged 1 commit into
iree-org:mainfrom
hanhanW:update-testing-encodings
May 5, 2025
Merged

hanhanW merged 1 commit into
iree-org:mainfrom
hanhanW:update-testing-encodings

Conversation

@hanhanW

@hanhanW hanhanW commented May 3, 2025

Copy link
Copy Markdown
Contributor

The attributes were created for testing SpecializeEncoding pass when the ideas were rough. The specialized_encoding is NOT a resolver, so it does not implement the interface.

The revision moves the implementation to unspecialized encoding resolver, and make corresponding changes. It returns itself in the cloning methods. There are no new tests because the existing tests are robust and already cover it. E.g.,

#executable_target_vmvx_bytecode_fb = #hal.executable.target<"vmvx", "vmvx-bytecode-fb", {iree.encoding.resolver = #iree_encoding.unspecialized_encoding<123>}>
#device_target_local_0_ = #hal.device.target<"local", {ordinal = 0 : index}, [#executable_target_vmvx_bytecode_fb]> : !hal.device
#encoding = #iree_encoding.testing_encoding<>
util.global private @device_a = #device_target_local_0_
util.func public @ops_with_result_encoding_only(%arg0: index, %arg1: index, %scalar_f32 : f32) {
%0 = stream.tensor.empty on(#hal.device.affinity<@device_a>) : tensor<?x0xf32, #encoding>{%arg0} in !stream.resource<*>{%arg1}
%1 = stream.tensor.constant on(#hal.device.affinity<@device_a>) : tensor<?x5x64xf32>{%arg0} in !stream.resource<constant> = dense<0.000000e+00> : tensor<1x5x64xf32>
%2 = stream.tensor.splat on(#hal.device.affinity<@device_a>) %scalar_f32 : f32 -> tensor<?x1x10xf32, #encoding>{%arg0} in !stream.resource<*>{%arg1}
util.return
}

The attributes were created for testing when the ideas were rough. The
specialized_encoding is NOT a resolver, so it does not implement the
interface.

The revision moves the implementation to unspecialized encoding
resolver, and make corresponding changes. It returns itself in the
cloning methods.

Signed-off-by: hanhanW <[email protected]>
@hanhanW
hanhanW requested a review from bjacob as a code owner May 3, 2025 00:13
@hanhanW
hanhanW requested review from jtuyls and removed request for bjacob May 3, 2025 00:13

@jtuyls jtuyls left a comment

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.

LGTM

@hanhanW
hanhanW merged commit 02cf396 into iree-org:main May 5, 2025
@hanhanW
hanhanW deleted the update-testing-encodings branch May 5, 2025 17:24
KyleHerndon pushed a commit to KyleHerndon/iree that referenced this pull request May 7, 2025
…dingAttr (iree-org#20718)

The attributes were created for testing SpecializeEncoding pass when the
ideas were rough. The specialized_encoding is NOT a resolver, so it does
not implement the interface.

The revision moves the implementation to unspecialized encoding
resolver, and make corresponding changes. It returns itself in the
cloning methods. There are no new tests because the existing tests are
robust and already cover it. E.g.,


https://github.com/iree-org/iree/blob/360288f1a4e7e177a24ca290aabc083bd6e26b4f/compiler/src/iree/compiler/Dialect/Stream/Transforms/test/specialize_encodings.mlir#L153-L163

Signed-off-by: hanhanW <[email protected]>
AWoloszyn pushed a commit that referenced this pull request Dec 1, 2025
…dingAttr (#20718)

The attributes were created for testing SpecializeEncoding pass when the
ideas were rough. The specialized_encoding is NOT a resolver, so it does
not implement the interface.

The revision moves the implementation to unspecialized encoding
resolver, and make corresponding changes. It returns itself in the
cloning methods. There are no new tests because the existing tests are
robust and already cover it. E.g.,


https://github.com/iree-org/iree/blob/360288f1a4e7e177a24ca290aabc083bd6e26b4f/compiler/src/iree/compiler/Dialect/Stream/Transforms/test/specialize_encodings.mlir#L153-L163

Signed-off-by: hanhanW <[email protected]>
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.

2 participants