microsoft / onnxruntime

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

[Feature Request] Fortran API #14633

Open jalvesz opened 1 year ago

jalvesz commented 1 year ago

Describe the feature request

Hi, wondering if there could be any consideration for supporting a Fortran wrapper API? if such initiative would be of interest maybe one way to kick-start it would be by looking at tools such as: https://github.com/LLNL/shroud

Describe scenario use case

Many HPC applications/engineering software run on large code bases written in Fortran. It would be very convenient to enable calling onnx directly within the language.

This would be very welcome by the Fortran community of developers.

Thanks

natke commented 1 year ago

Hi @jalvesz, we don't have any plans to add a Fortran API at the moment but we would be open to a community contributed one. We already have some of these: https://onnxruntime.ai/docs/api/

jerrylin96 commented 1 year ago

Would like to add that a Fortran API would be of great assistance for climate scientists seeking to replace computationally intensive subgrid models with neural network emulators in long-term climate simulations.

Here is a paper that describes what that would look like: https://[arxiv.org/pdf/2306.08754.pdf](https://arxiv.org/pdf/2306.08754.pdf)

gronki commented 7 months ago

Any changes on this? There seem to be Julia bindings, which is an alternative on numerical computing. Meanawhile Fortran is the industry standard and currently ranks #14 in TIOBE index, higher than Julia: https://www.tiobe.com/tiobe-index/

Fortran has a very robust standardized mechanism for creating bindings to any C library. Maybe give it a second look?

EDIT: only now noticed that Julia binding is a community work. My bad.