TOSA reference model from MLIR using EmitC

Thanks for reminding me of this - I should have mentioned we had this option. At that point of time we considered it simpler to first get the pieces out, get traction and make the case for upstreaming.

Right now everything needed for TOSA functional validation is open source. The dialect, frontend legalizations (TF done, Torch in dev), reference model and the MLIR pass to emit flatbuffers to reference model.

Probably the easiest starting point here is to move the last mentioned piece into core as a conditional build rule, since it has a flatbuffers dependency. Could you point us to an existing core MLIR conditional build CMake construct ?

We’re very interested in upstreaming more pieces of TOSA infrastructure due to the interest level around it.

For example, we’d like to upstream the legalization unit test infrastructure to the frameworks. This would catch breakages in legalizations - valuable for e2e flows depending on TOSA.

We already have positive interest from @_sean_silva to go ahead with doing this for Torch-MLIR. We’d like to make the case based on that proof of concept, to upstream the unit test infrastructure for the TF/TFLite->TOSA legalizations to that repo too - something that would be run as at least an optional CI test. But perhaps this isn’t the right venue for that, and if so, is there another place we could propose it ?