Skip to content

Commit b9054d2

Browse files
authored
[DT] Mark partial slices unsupported in padding encoding resolver. (#22359)
The implementation was wrong; the tests are missing. It addresses a post review comment: https://github.com/iree-org/iree/pull/22339/files#r2438738373 Signed-off-by: hanhanW <[email protected]>
1 parent df4c6ce commit b9054d2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

compiler/src/iree/compiler/Codegen/ExternalInterfaces/GPUEncodingExternalModels.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,14 @@ struct GPUPadEncodingLayoutMaterializerAttr final
593593
if (!boundType || !boundType.getEncoding()) {
594594
return failure();
595595
}
596+
// Only handle cases where the slice spans the whole
597+
// `!iree_tensor_ext.dispatch.tensor` type.
598+
// TODO(hanchung): Enable partial slices. It was copied from pattern's
599+
// implementaion, i.e., the users, and it can be dropped after we move the
600+
// checks to the interface implementations.
601+
if (!type.doesSliceSpanWholeTensor(dynamicDims, offsets, sizes, strides)) {
602+
return failure();
603+
}
596604
newSizes = getMixedValues(boundType.getShape(), dynamicDims, builder);
597605
newOffsets.resize(newSizes.size(), builder.getIndexAttr(0));
598606
newStrides.resize(newSizes.size(), builder.getIndexAttr(1));

0 commit comments

Comments
 (0)