Interface for DPS op creation #1671
Labels
MLIR Ops
Issues related to MLIR dialect ops and their implementations
TTIR Dialect
Issues related to TTIR dialect
TTNN Dialect
Issues related to TTNN dialect
Almost all ops in the TTIR dialect are DPS (and some are in TTNN as well). This means that during lowering from various frontends and decomposition we have a lot of repeating code that looks something like this
There are several problems with this approach. We don't have the standard way of calculating
outputType
(sometimes it'sdpsOut.getType()
, sometimes it's precomputed from the parameters of dpsOut creation, and there are a few other ways that I've seen throughout the codebase, some of them are outright wrong). Especially when multiple ops are created in a single function, it easily becomes a very error-prone process.A better interface would be the one that would look like a
rewriter.create
that would abstract away the creation ofEmptyOp
. It would be the default interface for the creation of DPS ops when we don't have a preexisting output tensor.The text was updated successfully, but these errors were encountered: