This revision separates the LinalgSplitReduction pattern, whose application is based on attributes,
from its implementation.
A transform dialect op extension is added to control the application of the transformation at a finer granularity.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td | ||
---|---|---|
161 | I'd expand a bit on what the transformation does. | |
mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp | ||
404 | Nit: can't one just omit the name? | |
410 | Payload ops shouldn't be null, if they are, this sounds like a bug. Note that .front() will fail on the empty list, not return null. | |
412 | Can't we just make it apply to each operand via the TransformEachOpTrait? | |
412 | Otherwise, please add a test for this user-visible error message. | |
423 | Nit: I'd rather do getSplitLinalgOp().cast<OpResult>() | |
mlir/lib/Dialect/Linalg/Transforms/SplitReduction.cpp | ||
68 | Nit: expand auto | |
110 | Not for this diff: it would be nice to have this reported through DiagnosedSilenceableFailure. I don't know if we can connect the rewriter to that. |
It turns out that the transformation had a few issues, in particular related to dynamic dimensions and somewhat hardcoded assumptions.
I spent some time writing a version that does not require ExpandShapeOp and that instead rewrites the dimension with a "convolution" flavor.
This has certain advantages over the ExpandShapeOp version for some of the work I am doing but may be generally undesirable for @ThomasRaoux 's use cases.
Let's see what Thomas thinks of this version.
Reverted back to an NFC PR from the point of view of the transformation itself.
I'll send the proposed "SplitReduction without ExpanShapeOp" separately.
mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h | ||
---|---|---|
763–764 | Something is broken with this signature | |
792 | This looks fishy | |
809–811 | I'd do something like SmallVector<SmallVector<Operation *>, 1> here to avoid over-allocating on stack in the common case of there being only one result. | |
818–838 | const &, we don't want to copy here | |
831 | Ditto |
I see a bunch of spurious stderr: 'fatal: Unable to create '/var/lib/buildkite-agent/builds/llvm-project-fork/.git/index.lock': File exists. in the build bots.
Tests pass locally, landing as is.
I'd expand a bit on what the transformation does.