Benchmarking and profiling Tutorial#

Next sections shows how to measure performance of an ONNX graph when executing with onnxruntime.

The tutorial was tested with following version:

<<<

import sys
import numpy
import scipy
import onnx
import onnxruntime
import lightgbm
import xgboost
import sklearn
import onnxconverter_common
import onnxmltools
import skl2onnx
import pyquickhelper
import mlprodict
import onnxcustom

print("python {}".format(sys.version_info))
mods = [numpy, scipy, sklearn, lightgbm, xgboost,
        onnx, onnxmltools, onnxruntime, onnxcustom,
        onnxconverter_common,
        skl2onnx, mlprodict, pyquickhelper]
mods = [(m.__name__, m.__version__) for m in mods]
mx = max(len(_[0]) for _ in mods) + 1
for name, vers in sorted(mods):
    print("{}{}{}".format(name, " " * (mx - len(name)), vers))

>>>

    python sys.version_info(major=3, minor=9, micro=1, releaselevel='final', serial=0)
    lightgbm             3.3.4
    mlprodict            0.9.1887
    numpy                1.24.1
    onnx                 1.13.0
    onnxconverter_common 1.13.0
    onnxcustom           0.4.344
    onnxmltools          1.11.1
    onnxruntime          1.14.92+cpu
    pyquickhelper        1.11.3801
    scipy                1.10.0
    skl2onnx             1.13.1
    sklearn              1.2.0
    xgboost              1.7.3