I would like to know why ToSaToLinalg does not convert tosa::AddOp
to linalg::Add
, but to linalg.generic
Because linalg::AddOp
is new and TOSA has added lowering to Linalg a long time ago.
Since linalg::AddOp
has strict cast semantics, TOSA would have to lower to not just AddOp
but also potentially broadcasts, reduction and types cast operations. Same for all other unary/binary/ternary named ops added recently.
I’d be happy to work with TOSA folks to add that support to their lowering, but as mentioned in a torch-mlir
thread, if we want to make this into an option, then we may have to duplicate code.
Got it, thank you!