llvm/mlir/lib
Lei Zhang cb2e651800 [mlir][linalg] Fix incorrect bound calculation for tiling conv
For convolution, the input window dimension's access affine map
is of the form `(d0 * s0 + d1)`, where `d0`/`d1` is the output/
filter window dimension, and `s0` is the stride.

When tiling, https://reviews.llvm.org/D109267 changed how the
way dimensions are acquired. Instead of directly querying using
`*.dim` ops on the original convolution op, we now get it by
applying the access affine map to the loop upper bounds. This
is fine for dimensions having single-dimension affine maps,
like matmul, but not for convolution input. It will cause
incorrect compuation and out of bound. A concrete example, say
we have 1x225x225x3 (NHWC) input, 3x3x3x32 (HWCF) filter, and
1x112x112x3 (NHWC) output with stride 2, (112 * 2 + 3) would be
227, which is different from the correct input window dimension
size 225.

Instead, we should first calculate the max indices for each loop,
and apply the affine map to them, and then plus one to get the
dimension size. Note this makes no difference for matmul-like
ops given they will have `d0 - 1 + 1` effectively.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D110849
2021-09-30 13:50:57 -04:00
..
Analysis [mlir] Unroll-and-jam loops with iter_args. 2021-09-28 14:13:27 -07:00
Bindings/Python [mlir] Remove unused namespace alias. 2021-09-30 13:50:31 +02:00
CAPI [mlir] Add value_begin/value_end methods to DenseElementsAttr 2021-09-21 01:57:43 +00:00
Conversion [MLIR][LLVM] Add error if using incorrect attribute type for specifying LLVM linkage 2021-09-27 13:24:05 -04:00
Dialect [mlir][linalg] Fix incorrect bound calculation for tiling conv 2021-09-30 13:50:57 -04:00
ExecutionEngine [mlir] AsyncRuntime: use int64_t for ref counting operations 2021-09-27 07:55:01 -07:00
Interfaces [mlir] Add value_begin/value_end methods to DenseElementsAttr 2021-09-21 01:57:43 +00:00
IR [AsmParser] move AsmParser::getContext to IR library. 2021-09-29 22:07:00 -07:00
Parser AsmParser::getContext() - there can be only one. This should unbreak the build. 2021-09-29 22:23:03 -07:00
Pass Remove unused llvm/Support/Parallel.h from MLIR (NFC) 2021-09-14 23:30:42 +00:00
Reducer
Rewrite [SymbolRefAttr] Revise SymbolRefAttr to hold a StringAttr. 2021-08-29 21:54:47 -07:00
Support Make the --mlir-disable-threading command line option overrides the C++ API usage 2021-09-15 03:20:48 +00:00
TableGen [mlir-tblgen] Add DagNode StaticMatcher. 2021-09-20 23:37:42 +00:00
Target [mlir] Always create a list of alias scopes when emitting LLVM IR 2021-09-22 00:00:46 +02:00
Tools
Transforms Introduced AllocationOpInterface to create deallocation operations on-the-fly that are compatible with the allocation operation implementing this interface. 2021-09-29 15:54:21 +02:00
Translation
CMakeLists.txt