How to use Glow

Hi Everyone,

I am new to Glow and PyTorch (trying to learn both). I have trained a very simple Neural network based classifier in PyTorch(C++). I want to do inferencing on PI3 and want to take advantage of glow. Requesting you to please let me know what all steps I need to follow to achieve this.

While checking example/mnist.cpp I observed that training, testing and validation is done using glow, however I was under the impression that glow has inference support only?

Is there any example where glow is applied on computational graph?

Thanks

I am new to Glow and PyTorch (trying to learn both). I have trained a very simple Neural network based classifier in PyTorch(C++). I want to do inferencing on PI3 and want to take advantage of glow. Requesting you to please let me know what all steps I need to follow to achieve this.

I think the best way here would be to use our AOT executable bundles, see here for more info.

While checking example/mnist.cpp I observed that training, testing and validation is done using glow, however I was under the impression that glow has inference support only?

Glow supports training to some extent – we support autograd and execution of many grad ops. However we have focused much more on inference.

Is there any example where glow is applied on computational graph?

Not sure what you’re asking about specifically here – you can find lots of simple examples of computational graphs we build directly in Glow IR in our OperatorTest.cpp.

Thanks for the response @jfix. I will check OperatorTest.cpp.
Originally I wanted to know if there is any example which takes a pre trained model and converts this to computational graphs for which glow optimisation can be applied.
Trained Model → computational graph → glow optimisation → binary

Apologies in advance if again I have confused you.

So a lot of Glow’s focus is on computational graphs, we use a Node-based Graph representation as our high level IR, and that is what we focus much of our optimizations on (GraphOptimizer.cpp). In OperatorTest.cpp you can find many such graphs that we build and run – they haven’t been trained on real models, it’s more for unit test and general functionality. For real models, we have e.g. many CV examples that are run through the image-classifier tool. For many of these you can take the Function in the code and run e.g. function->dumpDAG("graph.dot"), and then use that dot file to visualize the graph. Hope this helps.