util/debug.py python script to debug numerical errors, when onnx-mlir-compiled inference executable produces
numerical results that are inconsistent with those produced by the training framework.
This python script will run the model through onnx-mlir and a reference backend, and compare
the intermediate results produced by these two backends layer by layer.
ONNX_MLIR_HOMEenvironment variable to be the path to the HOME directory for onnx-mlir. The HOME directory for onnx-mlir refers to the parent folder containing the
lib, etc sub-folders in which ONNX-MLIR executables and libraries can be found.
pip install onnxruntime. To use a different testing backend, simply replace code importing onnxruntime to some other ONNX-compliant backend.
util/debug.py supports the following command-line options:
usage: debug.py [-h] model_path positional arguments: model_path Path to the model to debug.