Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1.96 KB

onnxrt_ep_setup.md

File metadata and controls

46 lines (33 loc) · 1.96 KB

ONNXRuntime Execution Provider Setup

For users who want to use onnxruntime as the frontend, you will need to install the onnxruntime Vitis-AI Execution Provider(EP).

There are two options to install the required Vitis-AI EP:

Note: Python 3.9 is required for onnxruntime EP installation

Download and install from CI prebuilt packages

  • Download install_release.zip package from pre-built package and extract it.
  • Activate your ryzenai-transformers conda environment
    conda activate ryzenai-transformers
  • Then execute following command to copy files and install packages:
    cd install_release
    pip install --upgrade --force-reinstall onnxruntime_vitisai-1.15.1-cp39-cp39-win_amd64.whl
    pip install --upgrade --force-reinstall voe-0.1.0-cp39-cp39-win_amd64.whl
    python installer.py

Build the onnxruntime EP from scratch

If you need to do some development works and want to keep the onnxruntime EP updated with the latest code, you can build the package from scratch by following these steps:

Prequisites

  • Visual Studio 2019, with individual component spectre installed. For adding Spectre Mitigation to Visual Studio, please refer to the instructions here.
  • CMake (version >= 3.26)
  • XRT. Download the xrt test_package.zip from the artifactory and unzip it for later use.

Build onnxruntime EP

conda activate ryzenai-transformers
cd transformers
setup_phx.bat
cd ext\vai-rt
./build_latest.bat

Some known issues

  • Protobuf related errors: check if you have installed protobuf somewhere already, then remove it (generally in base conda env).