-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Description
ONNX has been a well-known effort towards cross-framework compatibility. However, to fully support ONNX, there are several difficulties that might or might not be solvable. As a result, Paddle's main inference frameworks should probably mainly depend on our internal format for now.
-
The set of operators defined by ONNX is not enough to cover all common models.
If an operator is used by Paddle to train a model and that operator cannot be represented by ONNX, then the trained model cannot be converted to ONNX. As a result, no other framework can use the model through ONNX. -
The concept of LodTensor is not supported by ONNX. A large part of Paddle uses LodTensor. However, LodTensor is an unknown concept to ONNX. How to map Paddle operators that uses LodTensor to ONNX operators is an open question.
-
Many Paddle operators, though has similar names in ONNX, don't work the same way. For example, multiply in Paddle might do the reshape if the input doesn't match the shape it expects. However multiply in ONNX might not accept reshape behavior. Enforcing consistency between all Paddle and ONNX operators can be a non-trivial effort.
-
Currently, we are only working on Paddle to ONNX conversion, but not ONNX to Paddle conversion. This is strange because users can leave Paddle by converting Paddle model to, say Caffe, through ONNX conversion. But user cannot move from Caffe to Paddle through ONNX to Paddle conversion.