[Mlir-commits] [mlir] [mlir][linalg] Constrain the parameters m, r in Winograd ops (PR #144657)
Oleksandr Alex Zinenko
llvmlistbot at llvm.org
Tue Jun 24 00:00:28 PDT 2025
================
@@ -122,4 +122,22 @@ def TypeFn : I32EnumAttr<"TypeFn", "", [
let cppNamespace = "::mlir::linalg";
}
+/// We use F(m, r) to define the size of minimal filtering algorithms.
+/// m is the output dimension and r is the filter dimension. We can get
+/// the input dimension, alpha, from the formula, alpha = m + r - 1.
+///
+/// For example, when m = 2 and r = 3, we know its input size is 4.
+/// The Conv2D will operate on 4x4 input data with 3x3 filter and get
+/// 2x2 output result.
+def WinogradConv2DFmr : I32EnumAttr<"WinogradConv2DFmr",
+ "Winograd Conv2D F(m, r)",
+ [
+ I32EnumAttrCase<"F_2_3", 0>,
+ I32EnumAttrCase<"F_4_3", 1>,
+ I32EnumAttrCase<"F_2_5", 2>,
+ I32EnumAttrCase<"Unknown", -1>,
----------------
ftynse wrote:
I'd rather not have "unknown" as an enum entry. This turns a compile-time error into a runtime error (one can pass an instance of the enum into an op constructor and it is only caught at verifier/assertion).
https://github.com/llvm/llvm-project/pull/144657
More information about the Mlir-commits
mailing list