I'm considering using the glow compiler to deploy neural networks on a custom embedded hardware which only comes with a proprietary C compiler and optimizer.
I want to reuse the frontend components and the graph and high-level/low-level glow IR optimizer, but I'm not very sure about the code generation component, as from what I understood so far is based on LLVM (including some custom LLVM based optimizations like operator stacking and so on), which obviously does not support my target architecture.
What would be the high-level steps and estimated effort to add a new backend / target architecture that is not supported by LLVM? (my current high-level idea is that I should implement manual C optimizations of the glow IR operations and then generate compilable C code from the glow IR that I can further compile using my targeted custom compiler for my device).
Hi @celsisusdegr
Glow gives you a few different options for generating code for your device. The main choice is between the high-level graph, and the low-level IR. You can start from either one of them. I suspect that starting from the low-level IR would be easier, because it would do much of the work for you.
One possible strategy would be to simply iterate over the low-level IR and 'print' C code. You could then use the embedded compiler to compile the generated C code.
Most helpful comment
Hi @celsisusdegr
Glow gives you a few different options for generating code for your device. The main choice is between the high-level graph, and the low-level IR. You can start from either one of them. I suspect that starting from the low-level IR would be easier, because it would do much of the work for you.
One possible strategy would be to simply iterate over the low-level IR and 'print' C code. You could then use the embedded compiler to compile the generated C code.