microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.85k stars 2.94k forks source link

LayerNormalization operator is not in onnx domain #7573

Open tianleiwu opened 3 years ago

tianleiwu commented 3 years ago

Describe the bug

Onnxruntime defined some operators (like LayerNormalization, SimplifiedLayerNormalization etc) in onnx domain: https://github.com/microsoft/onnxruntime/blob/8d737f977056444a307f1b7f0bcd402fba62d790/onnxruntime/contrib_ops/cuda/cuda_contrib_kernels.cc#L70-L75

However, they are not standard onnx operators as listed in (https://github.com/onnx/onnx/blob/master/docs/Operators.md).

That causes some issue. For example, symbolic shape inference outputs warning: Warning: Unsupported operator LayerNormalization. No schema registered for this operator.

Urgency If there are particular important use cases blocked by this or strict project-related timelines, please share more information and dates. If there are no hard deadlines, please specify none.

None

System information

To Reproduce

Expected behavior How about change to MS domain, and add some logic for backward compatible (like rewrite the domain for those operator during loading models).

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here. If the issue is about a particular model, please share the model details as well to facilitate debugging.

ytaous commented 3 years ago

@yufenglee , @SherlockNoMad , @ashbhandare - change it to "kMSDomain" ?

SherlockNoMad commented 3 years ago

@yufenglee , @SherlockNoMad , @ashbhandare - change it to "kMSDomain" ?

agree. let's fix this.

tianleiwu commented 3 years ago

I updated symbolic shape inference (in https://github.com/microsoft/onnxruntime/pull/7606) so that we will not call onnx shape inference on LayerNormalization node.

It is not urgent right now. Let's add this to back log.

ytaous commented 3 years ago

@tianleiwu - backlog created for backend team, close this for now with your workaround. We can sync offline on the progress. Thanks for reporting it.

kaiyux commented 2 years ago

Did you change the domain now? Seems like the domain is still kOnnxDomain in here & here.
And I still gets Fatal error: LayerNormalization is not a registered function/op even though opset com.microsoft is imported.

tianleiwu commented 1 year ago

Not fixed yet.

anpin commented 6 months ago

is there a workaround?