microsoft / MMdnn

MMdnn is a set of tools to help users inter-operate among different deep learning frameworks. E.g. model conversion and visualization. Convert models between Caffe, Keras, MXNet, Tensorflow, CNTK, PyTorch Onnx and CoreML.
MIT License
5.8k stars 965 forks source link

what's the difference between onnx and mmdnn? #837

Open Joejiong opened 4 years ago

Joejiong commented 4 years ago

what's the difference between onnx and mmdnn?

linmajia commented 4 years ago

@Joejiong , thank you very much for the feedback.

Orginally, ONNX is an open neural network exchange format, with a similar motivation for framework interoperability. However, it includes only essential operators, which are much less than those in popular DL frameworks. For example, there are about 137 operators in ONNX v1.5 while TensorFlow r1.13 has more than 500. Therefore if a source model uses one out-of-range operator, it cannot be converted or directly exported to ONNX. And the extensibility of ONNX has to align with the supporting frameworks and hardware vendors.

The goal of MMdnn is faithful model conversion instead of formulating a common model format, hence the IR design can be simplified to focus on the graph syntax without caring a lot about the implementation of various IR constructs. MMdnn refers to the syntax of ONNX and other frameworks to design its simple yet unified IR, with the purpose of an intermediate medium to describe as many IR constructs as possible. It is more likely that the target framework already has an equivalent for the source operator. Hence, MMdnn can quickly support more DL operators, models and frameworks for model conversion.

Joejiong commented 4 years ago

I see,but what do u mean by:

“focus on graph syntax without implementation of various IR constructs”

Joejiong commented 4 years ago

can i interpret that ur goal is actually put as much as possible the ops, without consider the intersection? or what? you take union of all ops, instead of create some risc instruction. and then if there is really a difficult one to convert you will have some tech to solve the issue.

so in other words, do you mean onnx is a carefully designed instructions set or what? but it is not generally available.

may i know which part of the code or is there any blog talk about the issue?