News for hackers. Stuff that matters.
Re:Onnx Runtime: “Cross-Platform Accelerated Machine Learning” by synergy20 on Tuesday July 25, 2023 @11:57AM (#36864273)
There are two kinds of runtime: training and inference. ONNX runtime as far as I know is only for inference, which is open for all.
Re:Onnx Runtime: “Cross-Platform Accelerated Machine Learning” by liuliu on Tuesday July 25, 2023 @12:00PM (#36864329)
And this is a superficial difference carried from old days when we need to do deployment and deployment-specific optimizations.

With LoRA / QLoRA, my bet is that edge training capabilities are as important in the next decade. I don't have any citations though.

Re:Onnx Runtime: “Cross-Platform Accelerated Machine Learning” by imjonse on Tuesday July 25, 2023 @12:09PM (#36864510)
> And this is a superficial difference carried from old days when we need to do deployment and deployment-specific optimizations.

Is it? From what I understand, to use an analogy, ONNX is the bytecode specification and JVM whereas Pytorch, TF and other frameworks combined with converting tools are the Java compilers.

Re:Onnx Runtime: “Cross-Platform Accelerated Machine Learning” by fisf on Tuesday July 25, 2023 @12:22PM (#36864782)
Onnx is just a serialisation format (using protobuf iirc) for the network, weights, etc.

Your training framework and a suitable export is the compiler.

Onnx Runtime (which really has various backends), tensorrt, .. (whatever inference engine you are using) is your JVM.

Re:Onnx Runtime: “Cross-Platform Accelerated Machine Learning” by nerpderp82 on Tuesday July 25, 2023 @01:55PM (#36866516)
That is my understanding, ONNX is the weights and the operators. You could then project that model into SPIR-V, Verilog or run it via native code.
Re:Onnx Runtime: “Cross-Platform Accelerated Machine Learning” by snnn on Wednesday July 26, 2023 @09:48AM (#36877657)
It is true if your model is statically shaped. ONNX is also a collection of C++ code , a C++ library for doing shape inference. You cannot project the C++ code to another high level programming language.
Re:Onnx Runtime: “Cross-Platform Accelerated Machine Learning” by nerpderp82 on Tuesday August 01, 2023 @12:01PM (#36957833)
The model itself doesn't contain C++ code. The runtime supports Python, JS, etc. I don't think they are shipping a copy of clang as part of the rt. I could be wrong, I haven't looked. Of course it needs the scaffolding to get data in and out.

I just did an install of the runtime on Python ( pip install onnxruntime ) . Here are the additional packages it installs.

    Package       Version
    ------------- -------
    coloredlogs   15.0.1
    flatbuffers   23.5.26
    humanfriendly 10.0
    mpmath        1.3.0
    numpy         1.25.2
    onnxruntime   1.15.1
    packaging     23.1
    protobuf      4.23.4
    sympy         1.12
https://onnxruntime.ai/docs/install/
Re:Onnx Runtime: “Cross-Platform Accelerated Machine Learning” by snnn on Saturday August 05, 2023 @12:58AM (#37009150)
ONNX is a spec. ONNX Runtime is an implementation of ONNX. There are other implementations too. But ONNX is not a text spec like the RFCs for network protocols. ONNX is also a collection of C/C++ code. ONNX's implementations rely on this code to do type and shape inference. My point was: if someone wants to implement ONNX(write a library that can load and run ONNX models), he/she has to reuse this C/C++ code, or totally rewrite them in his/her favorite programming language(but I think it is not very practical).

If an ONNX implementation wants to do codegen, like what XLA does, then usually it is based on LLVM and it needs to be shipped with a copy of LLVM.

Re:Onnx Runtime: “Cross-Platform Accelerated Machine Learning” by refulgentis on Tuesday July 25, 2023 @12:14PM (#36864623)
There's a training runtime too (and it enables edge training, as sibling reply hopes for in next decade)
Re:Onnx Runtime: “Cross-Platform Accelerated Machine Learning” by spearman on Tuesday July 25, 2023 @01:04PM (#36865590)
The training support is much less mature and much less widely used, but it does exit: https://onnxruntime.ai/docs/get-started/training-on-device.h... https://onnxruntime.ai/docs/get-started/training-pytorch.htm...
Re:Onnx Runtime: “Cross-Platform Accelerated Machine Learning” by new_user55 on Tuesday July 25, 2023 @09:04PM (#36871876)
We wanted to use ONNX runtime for a "model driver" for MD simulations, where any ML model can be used for molecular dynamics simulations. Problem was it was way too immature. Like ceiling function will only work with single precision in ONNX. But the biggest issue was that we could not take derivatives in ONNX runtime, so any complicated model that uses derivatives inside was a nogo, is that limitation still exist? Do you know if it can take derivatives in training mode now?

Eventually we went with pytorch only support for the time being, with still exploring OpenXLA in place of ONNX, as a universal adapter: https://github.com/ipcamit/colabfit-model-driver

Re:Onnx Runtime: “Cross-Platform Accelerated Machine Learning” by luckyt on Tuesday July 25, 2023 @01:28PM (#36866000)
Yea, ONNX runtime is mostly used for inference. The requirements for training and inference differ quite a lot: training requires a library that can calculate gradients for the back propagation, loop over large datasets, split the model across multiple GPUs, etc. During inference you need to run a quantized version of the model on a specific target hardware, whether it be CPU, GPU, or mobile. So typically you will use one library for training, and convert it to a different library for deployment.
Re:Onnx Runtime: “Cross-Platform Accelerated Machine Learning” by Zetobal on Tuesday July 25, 2023 @02:50PM (#36867468)
The biggest problem with onnx models is that you can't reshape them :/