I have been able to build my own custom model-runner based on the glow-provided model-runner and image-classifier (refer to Glow with generic model builder). Using the custom builder, I am able to output a bundle. I am also able to use the bundle to run the custom network (built a custom runner based on ResNet50 example).
My question now is: is it possible to cross-build for ARM and other architectures, or must I build on the target? In general, it looks like we should be able to build for anything that LLVM supports, but I certainly do not want to build on the target.
I am focusing only on the cpu backend for now.
The more precise question can be phrased as follows. I understand that the *.weights file is just a binary weights file, so we should be able to load it on any architecture. How can we make sure that the *.o bundle file is compatible with the target architecture? How can we direct the builder to compile it for a specific target?
You want to use -target when you run e.g. image-classifier or model-compiler, etc., which are the tools that can be used to create the binary you’re going to deploy to another machine with a different CPU architecture. -target should not be used as a CMake flag – you still want to build Glow itself for your local machine’s architecture.