https://github.com/Hsiangkai created
https://github.com/llvm/llvm-project/pull/96177
None
>From 276ed8981c5243696da3bf233a777e1b84f11131 Mon Sep 17 00:00:00 2001
From: Hsiangkai Wang
Date: Mon, 17 Jun 2024 11:24:07 +0100
Subject: [PATCH 1/2] [mlir][linalg] Implement Conv2D using Winograd Conv2
https://github.com/Hsiangkai edited
https://github.com/llvm/llvm-project/pull/96177
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Hsiangkai edited
https://github.com/llvm/llvm-project/pull/96177
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Hsiangkai updated
https://github.com/llvm/llvm-project/pull/96177
>From 276ed8981c5243696da3bf233a777e1b84f11131 Mon Sep 17 00:00:00 2001
From: Hsiangkai Wang
Date: Mon, 17 Jun 2024 11:24:07 +0100
Subject: [PATCH 1/2] [mlir][linalg] Implement Conv2D using Winograd Conv2D
alg
https://github.com/Hsiangkai updated
https://github.com/llvm/llvm-project/pull/96177
>From 276ed8981c5243696da3bf233a777e1b84f11131 Mon Sep 17 00:00:00 2001
From: Hsiangkai Wang
Date: Mon, 17 Jun 2024 11:24:07 +0100
Subject: [PATCH 1/2] [mlir][linalg] Implement Conv2D using Winograd Conv2D
alg
https://github.com/Hsiangkai updated
https://github.com/llvm/llvm-project/pull/96177
>From 0c542404842679a5b9653a9a1049fb765245692e Mon Sep 17 00:00:00 2001
From: Hsiangkai Wang
Date: Mon, 17 Jun 2024 11:24:07 +0100
Subject: [PATCH 1/2] [mlir][linalg] Implement Conv2D using Winograd Conv2D
alg
https://github.com/Hsiangkai updated
https://github.com/llvm/llvm-project/pull/96177
>From 0c542404842679a5b9653a9a1049fb765245692e Mon Sep 17 00:00:00 2001
From: Hsiangkai Wang
Date: Mon, 17 Jun 2024 11:24:07 +0100
Subject: [PATCH 1/2] [mlir][linalg] Implement Conv2D using Winograd Conv2D
alg
https://github.com/Hsiangkai created
https://github.com/llvm/llvm-project/pull/96182
Add a transform operator structured.winograd_conv2d to convert
linalg.conv_2d_nhwc_fhwc to Linalg winograd operators.
>From a3d188ed7d25df05ccd6bc227ddc361b0c66a2f4 Mon Sep 17 00:00:00 2001
From: Hsiangkai Wan
Hsiangkai wrote:
Sorry, I am still figuring out how to create stack PRs.
https://github.com/llvm/llvm-project/pull/96177
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch
Hsiangkai wrote:
Sorry, I am still figuring out how to create stack PRs.
https://github.com/llvm/llvm-project/pull/96178
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch
https://github.com/Hsiangkai closed
https://github.com/llvm/llvm-project/pull/96178
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Hsiangkai closed
https://github.com/llvm/llvm-project/pull/96177
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/Hsiangkai closed
https://github.com/llvm/llvm-project/pull/96179
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
Hsiangkai wrote:
Sorry, I am still figuring out how to create stack PRs.
https://github.com/llvm/llvm-project/pull/96179
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch
https://github.com/Hsiangkai created
https://github.com/llvm/llvm-project/pull/96184
In order to support arbitrary size input data of conv2d, implement
TilingInterface for winograd operators. Before converting winograd operators
into nested loops with matrix multiply, tile the input of conv2d
https://github.com/Hsiangkai updated
https://github.com/llvm/llvm-project/pull/96182
>From 374b0d5b83ce080bea690199380e270a36ad1c52 Mon Sep 17 00:00:00 2001
From: Hsiangkai Wang
Date: Mon, 17 Jun 2024 11:49:08 +0100
Subject: [PATCH] [mlir][linalg] Add transform operator for Winograd Conv2D
alg
https://github.com/Hsiangkai updated
https://github.com/llvm/llvm-project/pull/96183
>From 24c4f957ae673c2955fc0674f91e488813d59350 Mon Sep 17 00:00:00 2001
From: Hsiangkai Wang
Date: Mon, 17 Jun 2024 17:39:49 +0100
Subject: [PATCH] [mlir][linalg] Decompose winograd operators
Convert Linalg wi
https://github.com/Hsiangkai updated
https://github.com/llvm/llvm-project/pull/96184
>From 73b524b7746839614655fd8082dbda297e93ba72 Mon Sep 17 00:00:00 2001
From: Hsiangkai Wang
Date: Mon, 17 Jun 2024 11:44:27 +0100
Subject: [PATCH] [mlir][linalg] Implement TilingInterface for winograd
operato
https://github.com/Hsiangkai updated
https://github.com/llvm/llvm-project/pull/96184
>From 73b524b7746839614655fd8082dbda297e93ba72 Mon Sep 17 00:00:00 2001
From: Hsiangkai Wang
Date: Mon, 17 Jun 2024 11:44:27 +0100
Subject: [PATCH 1/2] [mlir][linalg] Implement TilingInterface for winograd
ope
@@ -0,0 +1,88 @@
+// RUN: mlir-opt %s -transform-interpreter -canonicalize --split-input-file |
FileCheck %s
+
+func.func @conv2d(%arg0: tensor<2x10x10x5xf32>, %arg1: tensor<2x3x3x5xf32>,
%arg2: tensor<1xf32>) -> tensor<2x8x8x2xf32> {
+ %0 = tensor.empty() : tensor<2x8x8x2xf32>
@@ -0,0 +1,88 @@
+// RUN: mlir-opt %s -transform-interpreter -canonicalize --split-input-file |
FileCheck %s
+
+func.func @conv2d(%arg0: tensor<2x10x10x5xf32>, %arg1: tensor<2x3x3x5xf32>,
%arg2: tensor<1xf32>) -> tensor<2x8x8x2xf32> {
+ %0 = tensor.empty() : tensor<2x8x8x2xf32>
@@ -3480,6 +3480,31 @@ DiagnosedSilenceableFailure
transform::MapCopyToThreadsOp::applyToOne(
return DiagnosedSilenceableFailure::success();
}
+//===--===//
+// WinogradConv2DOp
+//===--
@@ -2587,4 +2587,55 @@ def MapCopyToThreadsOp :
}];
}
+//===--===//
+// Winograd Conv2D
+//===--===//
+
+def WinogradConv2DOp : Op {
+ let
@@ -2587,4 +2587,55 @@ def MapCopyToThreadsOp :
}];
}
+//===--===//
+// Winograd Conv2D
+//===--===//
+
+def WinogradConv2DOp : Op {
+ let
https://github.com/Hsiangkai edited
https://github.com/llvm/llvm-project/pull/96182
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -48,6 +287,261 @@ Value collapse2DData(RewriterBase &rewriter, Location loc,
Value data) {
reassociation);
}
+// This function transforms the filter. The data layout of the filter is FHWC.
+// The transformation matrix is 2
@@ -23,6 +26,156 @@ namespace linalg {
namespace {
+// clang-format off
+// Winograd Conv2D uses a minimal 2D filtering algorithm to calculate its
+// result. The formula of minimal 2D filtering algorithm F(m x m, r x r),
+// m is the output dimension and r is the filter dime
@@ -36,6 +189,92 @@ constexpr TransformMapKeyTy F_2_3{2, 3};
constexpr TransformMapKeyTy F_4_3{4, 3};
constexpr TransformMapKeyTy F_2_5{2, 5};
+struct TransformMatrix {
Hsiangkai wrote:
Done.
https://github.com/llvm/llvm-project/pull/96183
__
@@ -36,6 +189,92 @@ constexpr TransformMapKeyTy F_2_3{2, 3};
constexpr TransformMapKeyTy F_4_3{4, 3};
constexpr TransformMapKeyTy F_2_5{2, 5};
+struct TransformMatrix {
+ TransformMatrix(const float *table, int64_t rows, int64_t cols,
+ int64_t scalarFactor =
@@ -48,6 +287,261 @@ Value collapse2DData(RewriterBase &rewriter, Location loc,
Value data) {
reassociation);
}
+// This function transforms the filter. The data layout of the filter is FHWC.
+// The transformation matrix is 2
@@ -48,6 +287,261 @@ Value collapse2DData(RewriterBase &rewriter, Location loc,
Value data) {
reassociation);
}
+// This function transforms the filter. The data layout of the filter is FHWC.
+// The transformation matrix is 2
@@ -100,6 +594,161 @@ Value matrixMultiply(RewriterBase &rewriter, Location loc,
return expandOutput;
}
+// This function transforms the output. The data layout of the output is HWNF.
+// The transformation matrix is 2-dimension. We need to extract H x W from
+// HWNF first.
@@ -289,6 +938,123 @@ FailureOr winogradConv2DHelper(RewriterBase
&rewriter,
return transformedOutput.getDefiningOp();
}
+FailureOr
+decomposeWinogradFilterTransformHelper(RewriterBase &rewriter,
+ linalg::WinogradFilterTransformOp op)
@@ -323,5 +1089,12 @@ void populateWinogradConv2DPatterns(RewritePatternSet
&patterns, int64_t m,
patterns.insert(context, m, r);
}
+void populateDecomposeWinogradOpsPatterns(RewritePatternSet &patterns) {
+ MLIRContext *context = patterns.getContext();
+ patterns.insert(
@@ -2760,6 +2760,89 @@ LogicalResult WinogradFilterTransformOp::verify() {
return success();
}
+SmallVector
+WinogradFilterTransformOp::getIterationDomain(OpBuilder &builder) {
+ Location loc = getLoc();
+ Value zero = builder.create(loc, 0);
+ Value one = builder.create(
@@ -2638,4 +2638,41 @@ def WinogradConv2DOp : Op {
+ let description = [{
+Decompose winograd operators. It will convert filter, input and output
+transform operators into a combination of scf, tensor, and linalg
Hsiangkai wrote:
Done.
https://github.co
@@ -2760,6 +2760,89 @@ LogicalResult WinogradFilterTransformOp::verify() {
return success();
}
+SmallVector
+WinogradFilterTransformOp::getIterationDomain(OpBuilder &builder) {
+ Location loc = getLoc();
+ Value zero = builder.create(loc, 0);
+ Value one = builder.create(
@@ -2760,6 +2760,89 @@ LogicalResult WinogradFilterTransformOp::verify() {
return success();
}
+SmallVector
+WinogradFilterTransformOp::getIterationDomain(OpBuilder &builder) {
+ Location loc = getLoc();
+ Value zero = builder.create(loc, 0);
+ Value one = builder.create(
@@ -3480,6 +3480,31 @@ DiagnosedSilenceableFailure
transform::MapCopyToThreadsOp::applyToOne(
return DiagnosedSilenceableFailure::success();
}
+//===--===//
+// WinogradConv2DOp
+//===--
Author: Hsiangkai Wang
Date: 2021-10-10T20:22:30+08:00
New Revision: c28e32d20fd4a334e49f64a041cbefe7cd1e8ce3
URL:
https://github.com/llvm/llvm-project/commit/c28e32d20fd4a334e49f64a041cbefe7cd1e8ce3
DIFF:
https://github.com/llvm/llvm-project/commit/c28e32d20fd4a334e49f64a041cbefe7cd1e8ce3.diff
Author: Hsiangkai Wang
Date: 2021-01-13T10:57:43+08:00
New Revision: 914e2f5a02f4f896eec9a00f536d1118bf1d9961
URL:
https://github.com/llvm/llvm-project/commit/914e2f5a02f4f896eec9a00f536d1118bf1d9961
DIFF:
https://github.com/llvm/llvm-project/commit/914e2f5a02f4f896eec9a00f536d1118bf1d9961.diff
Author: Hsiangkai Wang
Date: 2021-01-15T20:08:51+08:00
New Revision: 619eb14775990d610236288f414a486d86df47cc
URL:
https://github.com/llvm/llvm-project/commit/619eb14775990d610236288f414a486d86df47cc
DIFF:
https://github.com/llvm/llvm-project/commit/619eb14775990d610236288f414a486d86df47cc.diff
Author: Hsiangkai Wang
Date: 2021-01-16T23:21:29+08:00
New Revision: 098dbf190a5586d02f48b84eb41b93b701cdeb97
URL:
https://github.com/llvm/llvm-project/commit/098dbf190a5586d02f48b84eb41b93b701cdeb97
DIFF:
https://github.com/llvm/llvm-project/commit/098dbf190a5586d02f48b84eb41b93b701cdeb97.diff
Author: Hsiangkai Wang
Date: 2021-01-22T00:47:32+08:00
New Revision: 9dd5aea1e0397f693a739bffb03fd94dc8e1ec79
URL:
https://github.com/llvm/llvm-project/commit/9dd5aea1e0397f693a739bffb03fd94dc8e1ec79
DIFF:
https://github.com/llvm/llvm-project/commit/9dd5aea1e0397f693a739bffb03fd94dc8e1ec79.diff
Author: Hsiangkai Wang
Date: 2021-01-22T00:59:58+08:00
New Revision: 266820be352d5b824cb01c93df1b00184fcc7803
URL:
https://github.com/llvm/llvm-project/commit/266820be352d5b824cb01c93df1b00184fcc7803
DIFF:
https://github.com/llvm/llvm-project/commit/266820be352d5b824cb01c93df1b00184fcc7803.diff
Author: Hsiangkai Wang
Date: 2021-01-22T01:15:55+08:00
New Revision: b8921af63b0d746606f2482f3a020ea7cd316cd2
URL:
https://github.com/llvm/llvm-project/commit/b8921af63b0d746606f2482f3a020ea7cd316cd2
DIFF:
https://github.com/llvm/llvm-project/commit/b8921af63b0d746606f2482f3a020ea7cd316cd2.diff
Author: Hsiangkai Wang
Date: 2021-01-22T11:33:42+08:00
New Revision: 5d354220d44f11c70f36d5a357ec2a2208a6ab92
URL:
https://github.com/llvm/llvm-project/commit/5d354220d44f11c70f36d5a357ec2a2208a6ab92
DIFF:
https://github.com/llvm/llvm-project/commit/5d354220d44f11c70f36d5a357ec2a2208a6ab92.diff
Author: Hsiangkai Wang
Date: 2021-01-23T08:54:56+08:00
New Revision: 97e33feb08aa9c042408862e555423f037753e12
URL:
https://github.com/llvm/llvm-project/commit/97e33feb08aa9c042408862e555423f037753e12
DIFF:
https://github.com/llvm/llvm-project/commit/97e33feb08aa9c042408862e555423f037753e12.diff
Author: Hsiangkai Wang
Date: 2021-01-02T08:42:53+08:00
New Revision: e4337159e3d1c70b1ec58f43fa59c9f0fd693e51
URL:
https://github.com/llvm/llvm-project/commit/e4337159e3d1c70b1ec58f43fa59c9f0fd693e51
DIFF:
https://github.com/llvm/llvm-project/commit/e4337159e3d1c70b1ec58f43fa59c9f0fd693e51.diff
Author: Hsiangkai Wang
Date: 2021-01-11T15:00:27+08:00
New Revision: 5e476061deb82ed4e6d440445f8830e1c7bccaa6
URL:
https://github.com/llvm/llvm-project/commit/5e476061deb82ed4e6d440445f8830e1c7bccaa6
DIFF:
https://github.com/llvm/llvm-project/commit/5e476061deb82ed4e6d440445f8830e1c7bccaa6.diff
Author: Hsiangkai Wang
Date: 2020-12-15T13:49:54+08:00
New Revision: e0d43a3b37a0d14c1caf3a79a4ad57a7a75fc3ae
URL:
https://github.com/llvm/llvm-project/commit/e0d43a3b37a0d14c1caf3a79a4ad57a7a75fc3ae
DIFF:
https://github.com/llvm/llvm-project/commit/e0d43a3b37a0d14c1caf3a79a4ad57a7a75fc3ae.diff
Author: Hsiangkai Wang
Date: 2020-12-15T14:59:22+08:00
New Revision: cbbdcfc47c86ddafe4ebad49f93dd37b513db0ac
URL:
https://github.com/llvm/llvm-project/commit/cbbdcfc47c86ddafe4ebad49f93dd37b513db0ac
DIFF:
https://github.com/llvm/llvm-project/commit/cbbdcfc47c86ddafe4ebad49f93dd37b513db0ac.diff
Author: Hsiangkai Wang
Date: 2020-12-15T16:23:22+08:00
New Revision: 14a91d676b794db09c14abecf363650a8fc90c61
URL:
https://github.com/llvm/llvm-project/commit/14a91d676b794db09c14abecf363650a8fc90c61
DIFF:
https://github.com/llvm/llvm-project/commit/14a91d676b794db09c14abecf363650a8fc90c61.diff
Author: Hsiangkai Wang
Date: 2020-12-17T10:57:36+08:00
New Revision: f03609b5c7531061be659e36824d37ef86a1fdf4
URL:
https://github.com/llvm/llvm-project/commit/f03609b5c7531061be659e36824d37ef86a1fdf4
DIFF:
https://github.com/llvm/llvm-project/commit/f03609b5c7531061be659e36824d37ef86a1fdf4.diff
Author: Hsiangkai Wang
Date: 2020-12-18T11:37:47+08:00
New Revision: 7087ae7be9f00b95d14bfba41264bbbd8f8711f2
URL:
https://github.com/llvm/llvm-project/commit/7087ae7be9f00b95d14bfba41264bbbd8f8711f2
DIFF:
https://github.com/llvm/llvm-project/commit/7087ae7be9f00b95d14bfba41264bbbd8f8711f2.diff
Author: Hsiangkai Wang
Date: 2020-12-20T17:39:20+08:00
New Revision: 41ab45d6624602ba10486f044c0fd06db5b9bedb
URL:
https://github.com/llvm/llvm-project/commit/41ab45d6624602ba10486f044c0fd06db5b9bedb
DIFF:
https://github.com/llvm/llvm-project/commit/41ab45d6624602ba10486f044c0fd06db5b9bedb.diff
Author: Hsiangkai Wang
Date: 2020-12-03T09:16:44+08:00
New Revision: 432d05174ed00a217c0ad37e2e823154624c1311
URL:
https://github.com/llvm/llvm-project/commit/432d05174ed00a217c0ad37e2e823154624c1311
DIFF:
https://github.com/llvm/llvm-project/commit/432d05174ed00a217c0ad37e2e823154624c1311.diff
Author: Hsiangkai Wang
Date: 2020-12-05T08:34:32+08:00
New Revision: 5e953a274b2ada5bfa54b3d765e391abb03f474f
URL:
https://github.com/llvm/llvm-project/commit/5e953a274b2ada5bfa54b3d765e391abb03f474f
DIFF:
https://github.com/llvm/llvm-project/commit/5e953a274b2ada5bfa54b3d765e391abb03f474f.diff
Author: Hsiangkai Wang
Date: 2020-12-11T14:02:56+08:00
New Revision: 5aa584ec713c6aefc34ecc997d98c5f05210fa07
URL:
https://github.com/llvm/llvm-project/commit/5aa584ec713c6aefc34ecc997d98c5f05210fa07
DIFF:
https://github.com/llvm/llvm-project/commit/5aa584ec713c6aefc34ecc997d98c5f05210fa07.diff
59 matches
Mail list logo