ARM-software / armnn

Arm NN ML Software. The code here is a read-only mirror of https://review.mlplatform.org/admin/repos/ml/armnn
https://developer.arm.com/products/processors/machine-learning/arm-nn
MIT License
1.14k stars 307 forks source link

understanding the onnx parser #772

Open kumarutkarsh1248 opened 1 month ago

kumarutkarsh1248 commented 1 month ago

Hi, I am currently trying to understand the ONNX parser. Is there any developer documentation or any other resources available that can help me understand the parser quickly, or do I have to follow along just with comments?

Colm-in-Arm commented 1 month ago

Hi,

There is limited documentation on the Onnx parser. There's the outline of supported operators here.

Probably the best way to learn about how it functions would be to use ExecuteNetwork to run an Onnx model and step through the code in a debugger.

Colm.

kumarutkarsh1248 commented 1 month ago

Hi @Colm-in-Arm, Basically, I am working on creating an ONNX converter for the mlpack(a machine learning library) framework and for that i am taking the refrence of armnn converter. My current ONNX-MLPack converter is working fine for some simple linear and convolutional models(https://github.com/kumarutkarsh1248/onnx_mlpack_translator ). Basically, what my converter does is iterate through the nodes of the graph in topological order, extract the attributes of each node, and while doing so, the converter adds layers to the MLPack model one by one with all their attributes mapped.

This overall approach works fine for simple models with no side branching, but this converter fails when it comes to ONNX models with some side branches associated with nodes or complex closed connectivity of nodes.

There is also a significant difference in the graph for different versions of the ONNX model.

I don’t know how to deal with these issues, and I can’t find any documentation or reference on how machine learning frameworks should make their converters. If you could provide any such developer documentation or any other resources, it would help me a lot.