[BYOC][Layout conversion] How to use Convert layout pass with BYOC flow?

In that case, does it make sense to run ConvertLayout first before calling External Codegen Partitioner?

Your proposal looks like an example of global optimization after partitioning is done. Current infrastructure, IIUC, supports local optimizations for subgraphs, assuming that we don’t need to pass any information from external subgraphs to fallback portion. In your case, you external function realizes that it needs NCHWc layout and it wants to propagate that information to fallback graphs and hoist/sink the layout transforms from the external func to the fallback graph, and then possibly optimize it away.

If we are ok with this passing of information from the external funcs back to fallback graph, your proposal make sense. I have not worked heavily on external codegen portion of TVM, so maybe @comaniac @zhiics can comment on it.