microsoft / onnxruntime

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

Implementation of ONNX Functions #6360

Open jay-karan opened 3 years ago

jay-karan commented 3 years ago

Hi,

All the ONNX operators are being implemented by ONNX RT right. But, there are multiple ONNX functions such as Celu, GreaterOrEqual, LessOrEqual as given in the table here too.

faxu commented 3 years ago

Function expansion is supported in ORT, which means it should be able to run any registered function that uses existing kernels. https://github.com/microsoft/onnxruntime/commit/517bff9675b35306b74184802fe322285a3203b1#diff-7a78ae0f46b964baada174d3b21d56bdc3b509591cb3dd73a4afd00f71dc46d0

For performance optimization, functions may be implemented separately for better efficiency - they are in the same place as regular operators - https://github.com/microsoft/onnxruntime/tree/master/onnxruntime/core/providers/cpu

What do you mean by "custom ONNX function"? If it's an existing ONNX function that is missing a dedicated kernel in ORT, you can contribute it to ORT. If it's a new function that doesn't exist yet in ONNX, you can propose it in https://github.com/onnx/onnx/issues. If you want to just register a new op in ORT - see https://www.onnxruntime.ai/docs/how-to/add-custom-op.html

jay-karan commented 3 years ago

Thank you,

I am actually going to propose a PR to an operation in ONNX. So, concurrently, can I propose a PR to register this op in ORT. If so, Can I use Type 3 and Type 1 approach from here.