TOSA to LinAlg lowerings and legalizations

Thanks for starting this thread, @rsuderman ! As we described in the RFC, we did a simple POC of the lowering to LinAlg. @stellaraccident suggested we push that as a followon patch to the TOSA dialect which has now landed in the LLVM tree. However, as you mentioned, LinAlg has evolved quite a bit since then, so this is no longer the same work. Back then, LinAlg on tensors wasn’t something we knew much of. I’ll take another look at this pass and the latest on LinAlg.

There’s been quite a few advances within underlying MLIR related to LinAlg codegen, control flow lowering, as well as dynamic shapes handling, and we’re interested in discussing how the dialect implementation could address these well.

We’re happy to discuss dialect level mechanics that don’t impact spec. For spec impacting work, @TomCookseyArm offers some additional information in [RFC] TOSA Dialect in MLIR - #39 by TomCookseyArm .

The full unit test infrastructure actually targets the TOSA reference model. This infrastructure is described on mlplatform: Test Infrastructure for TOSA - TOSA - Discourse . The reference model is a C++ functional implementation of the TOSA op set and runs full TOSA networks serialized in flatbuffers form. The reference model has also been open sourced:
⚡ TOSA
reference_model.git - [no description]
Doesn’t the mlir-cpu-runner require accurate legalizations from TOSA to LinAlg to be in place ?