Thanks a lot for the detailed answer @Hzfengsy.
There is already an FX importer for PyTorch at the MLC fork and will upstream later.
A quick follow-up question here, are there other frontends under development. We heavily depend on onnx frontend, so just wanted to ask if there already is development work going on for the onnx frontend and if not perhaps we could try to help out here as it might be of major interest to us.
what’s the causation between porting it to C++ and relay being an optional module?
I don’t think there’s any specific connection between the C++ port and relax being optional. I should have phrased that question differently, sorry about that.
My major interest was that, since there are quite a few things (like frontends, op support, etc.) that need improvements in Relax, and it might be a while to get there, we would need to work with a combination of Relay + Relax to get performance till we reach a point where we don’t need relay.
So the question about a c++ implementation of the relay translator should have been about the stability of the relay translator until we reach a point where we can go directly to Relax.
Yes, we have FuseOps and FuseTIR passes in Relax, as we would not plan to use Relay’s passes in a long-time view.
The question about Relay vs Relax fusion was because we need to use Relay frontend right now and then relay translator, but relay translator does not generate Relax ops (it only generates call_tir calls to lowered primfuncs), so how would fusion go in this workflow?
IIUC, Relax FuseOps only works on Relax operators, not the lowered TIR PrimFuncs. I went through Extract Op Info from Primfunc, and was curious if there’s any plan to do some sort of fusion directly on prim_funcs based on tir::PatternKindAnalyzer?