Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 1.94 KB

BuildONNX.md

File metadata and controls

31 lines (20 loc) · 1.94 KB

Installing third_party ONNX for Backend Tests or Rebuilding ONNX Operations

Backend tests are triggered by make check-onnx-backend in the build directory and require a few preliminary steps to run successfully. Similarly, rebuilding the ONNX operations in ONNX-MLIR from their ONNX descriptions is triggered by make OMONNXOpsIncTranslation.

You will need to install python 3.x if its not default in your environment, and possibly set the cmake PYTHON_EXECUTABLE variable in your top cmake file.

You will also need pybind11 which may need to be installed (mac: brew install pybind11 for example) and you may need to indicate where to find the software (Mac, POWER, possibly other platforms: export pybind11_DIR=<your path to pybind>). Then install the third_party/onnx software (Mac: pip install -e third_party/onnx) typed in the top directory.

Known issues

On Macs/POWER and possibly other platforms, there is currently an issue that arises when installing ONNX. If you get an error during the build, try a fix where you edit the top CMakefile as reported in this PR: https://github.com/onnx/onnx/pull/2482/files.

While running make check-onnx-backend on a Mac you might encounter the following error:

Fatal Python error: Aborted

Current thread 0x0000000107919e00 (most recent call first):
  File "/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 2632 in getproxies_macosx_sysconf
  File "/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 2650 in getproxies
  File "/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 795 in __init__
  ...

A known workaround is to export the no_proxy environment variable in your shell as follow, and rerun the tests.

% export no_proxy="*"