Repository navigation
[mlir][tosa] Remove vector unrolling support for apply_scale - #238010
Conversation
The vector unrolling support for `tosa.apply_scale` has no tests or in-tree users, leaving its intended use unclear. This PR removes that support ahead of the planned vector unrolling refactor, keeping the refactor focused on demonstrated uses of the interface. This PR removes that support ahead of the planned vector unrolling refactor (llvm#233408), keeping the refactor focused on demonstrated uses of the interface. This effectively reverts the following commit: ``` commit 8156600 Author: Jakub Kuderski <[email protected]> Date: Mon Feb 13 16:51:37 2023 -0500 [mlir][tosa] Enable `apply_scale` unrolling ```
|
@llvm/pr-subscribers-mlir-tosa Author: Andrzej Warzyński (banach-space) ChangesThe vector unrolling support for This PR removes that support ahead of the planned vector unrolling This effectively reverts the following commit: 4 Files Affected:
diff --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaUtilOps.td b/mlir/include/mlir/Dialect/Tosa/IR/TosaUtilOps.td
index 9ba3c31613ff15..1929ea663f7cba 100644
--- a/mlir/include/mlir/Dialect/Tosa/IR/TosaUtilOps.td
+++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaUtilOps.td
@@ -19,7 +19,6 @@ include "mlir/IR/OpBase.td"
include "mlir/Interfaces/SideEffectInterfaces.td"
include "mlir/Interfaces/LoopLikeInterface.td"
-include "mlir/Interfaces/VectorInterfaces.td"
include "mlir/Dialect/Tosa/IR/TosaInterfaces.td"
include "mlir/Dialect/Tosa/IR/TosaTypesBase.td"
@@ -27,8 +26,7 @@ include "mlir/Dialect/Tosa/IR/TosaOpBase.td"
def Tosa_ApplyScaleOp :
Tosa_Op<"apply_scale",
- [Pure, DeclareOpInterfaceMethods<VectorUnrollOpInterface>] #
- ElementwiseMappable.traits> {
+ [Pure] # ElementwiseMappable.traits> {
let summary = "Rescale scalar operator for Tosa tensor operators";
let description = [{
@@ -51,10 +49,6 @@ def Tosa_ApplyScaleOp :
Tosa_IntLike:$output
);
- let extraClassDeclaration = [{
- std::optional<SmallVector<int64_t, 4>> getIterationShapeToUnroll();
- }];
-
let assemblyFormat =
"operands `rounding_mode` `` $rounding_mode attr-dict `:` "
"functional-type(operands, results)";
diff --git a/mlir/lib/Dialect/Tosa/CMakeLists.txt b/mlir/lib/Dialect/Tosa/CMakeLists.txt
index 6404ca8fc5a561..579156c72e19a8 100644
--- a/mlir/lib/Dialect/Tosa/CMakeLists.txt
+++ b/mlir/lib/Dialect/Tosa/CMakeLists.txt
@@ -24,7 +24,6 @@ add_mlir_dialect_library(MLIRTosaDialect
MLIRQuantUtils
MLIRSideEffectInterfaces
MLIRTensorDialect
- MLIRVectorInterfaces
MLIRViewLikeInterface
)
diff --git a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
index b5e8eb5b9314c5..6d1b75079065cd 100644
--- a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
+++ b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
@@ -5201,13 +5201,6 @@ LogicalResult WhileOp::inferReturnTypeComponents(
return success();
}
-std::optional<SmallVector<int64_t, 4>>
-ApplyScaleOp::getIterationShapeToUnroll() {
- if (auto vt = llvm::dyn_cast<VectorType>(getType()))
- return llvm::to_vector<4>(vt.getShape());
- return std::nullopt;
-}
-
static void printInitializationList(OpAsmPrinter &parser,
Block::BlockArgListType blocksArgs,
ValueRange initializers,
diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
index 41f6f6998f21b9..95ed49b90bd26c 100644
--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -12702,7 +12702,6 @@ td_library(
":LoopLikeInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
- ":VectorInterfacesTdFiles",
],
)
|
|
@llvm/pr-subscribers-mlir Author: Andrzej Warzyński (banach-space) ChangesThe vector unrolling support for This PR removes that support ahead of the planned vector unrolling This effectively reverts the following commit: 4 Files Affected:
diff --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaUtilOps.td b/mlir/include/mlir/Dialect/Tosa/IR/TosaUtilOps.td
index 9ba3c31613ff15..1929ea663f7cba 100644
--- a/mlir/include/mlir/Dialect/Tosa/IR/TosaUtilOps.td
+++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaUtilOps.td
@@ -19,7 +19,6 @@ include "mlir/IR/OpBase.td"
include "mlir/Interfaces/SideEffectInterfaces.td"
include "mlir/Interfaces/LoopLikeInterface.td"
-include "mlir/Interfaces/VectorInterfaces.td"
include "mlir/Dialect/Tosa/IR/TosaInterfaces.td"
include "mlir/Dialect/Tosa/IR/TosaTypesBase.td"
@@ -27,8 +26,7 @@ include "mlir/Dialect/Tosa/IR/TosaOpBase.td"
def Tosa_ApplyScaleOp :
Tosa_Op<"apply_scale",
- [Pure, DeclareOpInterfaceMethods<VectorUnrollOpInterface>] #
- ElementwiseMappable.traits> {
+ [Pure] # ElementwiseMappable.traits> {
let summary = "Rescale scalar operator for Tosa tensor operators";
let description = [{
@@ -51,10 +49,6 @@ def Tosa_ApplyScaleOp :
Tosa_IntLike:$output
);
- let extraClassDeclaration = [{
- std::optional<SmallVector<int64_t, 4>> getIterationShapeToUnroll();
- }];
-
let assemblyFormat =
"operands `rounding_mode` `` $rounding_mode attr-dict `:` "
"functional-type(operands, results)";
diff --git a/mlir/lib/Dialect/Tosa/CMakeLists.txt b/mlir/lib/Dialect/Tosa/CMakeLists.txt
index 6404ca8fc5a561..579156c72e19a8 100644
--- a/mlir/lib/Dialect/Tosa/CMakeLists.txt
+++ b/mlir/lib/Dialect/Tosa/CMakeLists.txt
@@ -24,7 +24,6 @@ add_mlir_dialect_library(MLIRTosaDialect
MLIRQuantUtils
MLIRSideEffectInterfaces
MLIRTensorDialect
- MLIRVectorInterfaces
MLIRViewLikeInterface
)
diff --git a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
index b5e8eb5b9314c5..6d1b75079065cd 100644
--- a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
+++ b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
@@ -5201,13 +5201,6 @@ LogicalResult WhileOp::inferReturnTypeComponents(
return success();
}
-std::optional<SmallVector<int64_t, 4>>
-ApplyScaleOp::getIterationShapeToUnroll() {
- if (auto vt = llvm::dyn_cast<VectorType>(getType()))
- return llvm::to_vector<4>(vt.getShape());
- return std::nullopt;
-}
-
static void printInitializationList(OpAsmPrinter &parser,
Block::BlockArgListType blocksArgs,
ValueRange initializers,
diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
index 41f6f6998f21b9..95ed49b90bd26c 100644
--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -12702,7 +12702,6 @@ td_library(
":LoopLikeInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
- ":VectorInterfacesTdFiles",
],
)
|
FedericoBruzzone
left a comment
There was a problem hiding this comment.
LGTM, thank you! But please wait for @ziereis :D
AGindinson
left a comment
There was a problem hiding this comment.
LGTM (on behalf of @ziereis too)
|
Thank you for the reviews. Let me revert the Bazel changes (pre-commit fails anyway) and then land it. |
|
Thank you for the reviews. Let me revert the Bazel changes (pre-commit fails anyway) and then land it. |
The vector unrolling support for
tosa.apply_scalehas no tests orin-tree users, leaving its intended use unclear. This PR removes that
support ahead of the planned vector unrolling refactor, keeping the
refactor focused on demonstrated uses of the interface.
This PR removes that support ahead of the planned vector unrolling
refactor (#233408), keeping
the refactor focused on demonstrated uses of the interface.
This effectively reverts the following commit: