* Add command to skip tests * Remove support for OV_2021.3_LTS and ov_2021.1 Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com> * Removed request_id parameter from all references request_id parameter was being used with ov_2020.3 release. Starting from 2020.4 OV release, input_name paramater is being used instead to get the KernelContext_GetInput. Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com> * Enabling CI Logs in the branch * CI Commits to enable logs * Enable CI Print * Added Imagescaler op to the supported op's list Fixes test_tiny_yolo_V2 opset 8 model to support fully on OV-EP. This model is the older variation of tiny_yolo_v2 model which has Imagescaler op. Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com> * Added ops to fully support yolov3 model -Added changes to support yolov3 opset 10 model fully on CPU_FP32. -This also increases the operator coverage for GPU hardware. There by enabling yolov3 model on GPU with fewer subgraphs. Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com> * Enabling tiny_yolov3 model fully on CPU ->Enabled tiny_yolov3 model fully on CPU. -> Also reduces the number of subgraphs to infer this model on GPU Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com> * Adding GatherND op support for CPU and GPU ->This enables yolov3_pytorch model to work with fewer subgraphs on CPU and GPU Devices. Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com> * Fixes Albert model for ISV customer ConvTranspose op was getting rejected due to a condition. Fixed it. Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com> * Disabling this 4 cpp tests for openvino-ep These unit tests are failing with special conditions for conv_transpose op with output_shape attribute. so disabling them for now. Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com> * Docker file changes for 2021.4-v3.1 * Remvoing duplicate code Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com> * ReduceMax No dimension supported * Fixes failing protobuf issue for docker Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com> * Excluding openvinoep type for convtranpose test Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com> * Disabled 2 Failing convtranspose tests with TensorRT EP Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com> Co-authored-by: suryasidd <surya.siddharth.pemmaraju@intel.com> Co-authored-by: Aravind Gunda <aravindx.gunda@intel.com> Co-authored-by: sfatimar <sahar.fatima@intel/com> |
||
|---|---|---|
| .. | ||
| scripts | ||
| Dockerfile.arm32v7 | ||
| Dockerfile.arm64 | ||
| Dockerfile.cuda | ||
| Dockerfile.jetson | ||
| Dockerfile.migraphx | ||
| Dockerfile.nuphar | ||
| Dockerfile.openvino | ||
| Dockerfile.openvino-centos7 | ||
| Dockerfile.openvino-csharp | ||
| Dockerfile.rocm | ||
| Dockerfile.server | ||
| Dockerfile.source | ||
| Dockerfile.tensorrt | ||
| Dockerfile.training | ||
| Dockerfile.vitisai | ||
| LICENSE-IMAGE.txt | ||
| README.md | ||
Docker Containers for ONNX Runtime
Dockerfiles
- CPU Dockerfile, Instructions
- CUDA + CUDNN: Dockerfile, Instructions
- TensorRT: Dockerfile, Instructions
- OpenVINO: Dockerfile, Instructions
- Nuphar: Dockerfile, Instructions
- ARM 32v7: Dockerfile, Instructions
- NVIDIA Jetson TX1/TX2/Nano/Xavier: Dockerfile, Instructions
- ONNX-Ecosystem (CPU + Converters): Dockerfile, Instructions
- ONNX Runtime Server: Dockerfile, Instructions
- MIGraphX: Dockerfile, Instructions
Published Microsoft Container Registry (MCR) Images
Use docker pull with any of the images and tags below to pull an image and try for yourself. Note that the CPU and CUDA images include additional dependencies like miniconda for compatibility with AzureML image deployment.
Example: Run docker pull mcr.microsoft.com/azureml/onnxruntime:latest-cuda to pull the latest released docker image with ONNX Runtime GPU, CUDA, and CUDNN support.
| Build Flavor | Base Image | ONNX Runtime Docker Image tags | Latest |
|---|---|---|---|
| Source (CPU) | mcr.microsoft.com/azureml/onnxruntime | :v0.4.0, :v0.5.0, v0.5.1, :v1.0.0, :v1.2.0, :v1.3.0, :v1.4.0, :v1.5.2 | :latest |
| CUDA (GPU) | mcr.microsoft.com/azureml/onnxruntime | :v0.4.0-cuda10.0-cudnn7, :v0.5.0-cuda10.1-cudnn7, :v0.5.1-cuda10.1-cudnn7, :v1.0.0-cuda10.1-cudnn7, :v1.2.0-cuda10.1-cudnn7, :v1.3.0-cuda10.1-cudnn7, :v1.4.0-cuda10.1-cudnn7, :v1.5.2-cuda10.2-cudnn8 | :latest-cuda |
| OpenVino | hub.docker.com/repository/docker/openvino/onnxruntime_ep_ubuntu18 | :2021.3, :2021.4 | :latest |
| OpenVino (VAD-M) | mcr.microsoft.com/azureml/onnxruntime | :v0.5.0-openvino-r1.1-vadm, :v1.0.0-openvino-r1.1-vadm, :v1.4.0-openvino-2020.3.194-vadm, :v1.5.2-openvino-2020.4.287-vadm | :latest-openvino-vadm |
| OpenVino (MYRIAD) | mcr.microsoft.com/azureml/onnxruntime | :v0.5.0-openvino-r1.1-myriad, :v1.0.0-openvino-r1.1-myriad, :v1.3.0-openvino-2020.2.120-myriad, :v1.4.0-openvino-2020.3.194-myriad, :v1.5.2-openvino-2020.4.287-myriad | :latest-openvino-myriad |
| OpenVino (CPU) | mcr.microsoft.com/azureml/onnxruntime | :v1.0.0-openvino-r1.1-cpu, :v1.3.0-openvino-2020.2.120-cpu, :v1.4.0-openvino-2020.3.194-cpu, :v1.5.2-openvino-2020.4.287-cpu | :latest-openvino-cpu |
| OpenVINO (GPU) | mcr.microsoft.com/azureml/onnxruntime | :v1.3.0-openvino-2020.2.120-gpu, :v1.4.0-openvino-2020.3.194-gpu, :v1.5.2-openvino-2020.4.287-gpu | :latest-openvino-gpu |
| Nuphar | mcr.microsoft.com/azureml/onnxruntime | :latest-nuphar | |
| Server | mcr.microsoft.com/onnxruntime/server | :v0.4.0, :v0.5.0, :v0.5.1, :v1.0.0 | :latest |
| MIGraphX (GPU) | mcr.microsoft.com/azureml/onnxruntime | :v0.6 | :latest |
| Training (usage) | mcr.microsoft.com/azureml/onnxruntime-training | :0.1-rc1-openmpi4.0-cuda10.1-cudnn7.6-nccl2.4.8, :0.1-rc2-openmpi4.0-cuda10.2-cudnn7.6-nccl2.7.6, :0.1-rc3.1-openmpi4.0-cuda10.2-cudnn8.0-nccl2.7 | :latest |
Building and using Docker images
CPU
Ubuntu 18.04, CPU, Python Bindings
- Build the docker image from the Dockerfile in this repository.
docker build -t onnxruntime-source -f Dockerfile.source ..
- Run the Docker image
docker run -it onnxruntime-source
CUDA
Ubuntu 18.04, CUDA 10.2, CuDNN 8
- Build the docker image from the Dockerfile in this repository.
docker build -t onnxruntime-cuda -f Dockerfile.cuda ..
- Run the Docker image
docker run --gpus all -it onnxruntime-cuda
or
nvidia-docker run -it onnxruntime-cuda
TensorRT
Ubuntu 18.04, CUDA 11.0, TensorRT 7.1.3.4
- Build the docker image from the Dockerfile in this repository.
docker build -t onnxruntime-trt -f Dockerfile.tensorrt .
- Run the Docker image
docker run -it onnxruntime-trt
OpenVINO
Public Preview
Ubuntu 18.04, Python & C# Bindings
1. Using pre-built container images for Python API
The unified container image from Dockerhub can be used to run an application on any of the target accelerators. In order to select the target accelerator, the application should explicitly specifiy the choice using the device_type configuration option for OpenVINO Execution provider. Refer to OpenVINO EP runtime configuration documentation for details on specifying this option in the application code.
If the device_type runtime config option is not explicitly specified, CPU will be chosen as the hardware target execution.
2. Building from Dockerfile
-
Build the onnxruntime image for one of the accelerators supported below.
Retrieve your docker image in one of the following ways.
- Choose Dockerfile.openvino for Python API or Dockerfile.openvino-csharp for C# API as for building an OpenVINO 2021.3 based Docker image. Providing the docker build argument DEVICE enables the onnxruntime build for that particular device. You can also provide arguments ONNXRUNTIME_REPO and ONNXRUNTIME_BRANCH to test that particular repo and branch. Default repository is http://github.com/microsoft/onnxruntime and default branch is master.
docker build --rm -t onnxruntime --build-arg DEVICE=$DEVICE -f <Dockerfile> . - Pull the official image from DockerHub.
- Choose Dockerfile.openvino for Python API or Dockerfile.openvino-csharp for C# API as for building an OpenVINO 2021.3 based Docker image. Providing the docker build argument DEVICE enables the onnxruntime build for that particular device. You can also provide arguments ONNXRUNTIME_REPO and ONNXRUNTIME_BRANCH to test that particular repo and branch. Default repository is http://github.com/microsoft/onnxruntime and default branch is master.
-
DEVICE: Specifies the hardware target for building OpenVINO Execution Provider. Below are the options for different Intel target devices.
| Device Option | Target Device |
|---|---|
CPU_FP32 |
Intel CPUs |
GPU_FP32 |
Intel Integrated Graphics |
GPU_FP16 |
Intel Integrated Graphics |
MYRIAD_FP16 |
Intel MovidiusTM USB sticks |
VAD-M_FP16 |
Intel Vision Accelerator Design based on MovidiusTM MyriadX VPUs |
HETERO:<DEVICE_TYPE_1>,<DEVICE_TYPE_2>,<DEVICE_TYPE_3>... |
All Intel® silicons mentioned above |
MULTI:<DEVICE_TYPE_1>,<DEVICE_TYPE_2>,<DEVICE_TYPE_3>... |
All Intel® silicons mentioned above |
Specifying Hardware Target for HETERO or Multi-Device Build:
HETERO:<DEVICE_TYPE_1>,<DEVICE_TYPE_2>.. MULTI:<DEVICE_TYPE_1>,<DEVICE_TYPE_2>.. The <DEVICE_TYPE> can be any of these devices from this list ['CPU','GPU','MYRIAD','HDDL']
A minimum of two DEVICE_TYPE'S should be specified for a valid HETERO or Multi-Device Build.
Example: HETERO:MYRIAD,CPU HETERO:HDDL,GPU,CPU MULTI:MYRIAD,GPU,CPU
This is the hardware accelerator target that is enabled by default in the container image. After building the container image for one default target, the application may explicitly choose a different target at run time with the same container by using the Dynamic device selction API.
OpenVINO on CPU
-
Build the docker image from the DockerFile in this repository.
docker build --rm -t onnxruntime-cpu --build-arg DEVICE=CPU_FP32 -f <Dockerfile> . -
Run the docker image
docker run -it --rm --device-cgroup-rule='c 189:* rmw' -v /dev/bus/usb:/dev/bus/usb onnxruntime-cpu:latest
OpenVINO on GPU
- Build the docker image from the DockerFile in this repository.
docker build --rm -t onnxruntime-gpu --build-arg DEVICE=GPU_FP32 -f <Dockerfile> . - Run the docker image
docker run -it --rm --device-cgroup-rule='c 189:* rmw' -v /dev/bus/usb:/dev/bus/usb --device /dev/dri:/dev/dri onnxruntime-gpu:latest
OpenVINO on Myriad VPU Accelerator
-
Build the docker image from the DockerFile in this repository.
docker build --rm -t onnxruntime-myriad --build-arg DEVICE=MYRIAD_FP16 -f <Dockerfile> . -
Install the Myriad rules drivers on the host machine according to the reference in here
-
Run the docker image by mounting the device drivers
docker run -it --rm --device-cgroup-rule='c 189:* rmw' -v /dev/bus/usb:/dev/bus/usb onnxruntime-myriad:latest
OpenVINO on VAD-M Accelerator Version
-
Download OpenVINO Full package for version 2021.4 for Linux on host machine from this link and install it with the help of instructions from this link
-
Install the drivers on the host machine according to the reference in here
-
Build the docker image from the DockerFile in this repository.
docker build --rm -t onnxruntime-vadm --build-arg DEVICE=VAD-M_FP16 -f <Dockerfile> . -
Run hddldaemon on the host in a separate terminal session using the following steps:
- Initialize the OpenVINO environment.
source <openvino_install_directory>/bin/setupvars.sh - Edit the hddl_service.config file from $HDDL_INSTALL_DIR/config/hddl_service.config and change the field “bypass_device_number” to 8.
- Restart the hddl daemon for the changes to take effect.
$HDDL_INSTALL_DIR/bin/hddldaemon- Note that if OpenVINO was installed with root permissions, this file has to be changed with the same permissions.
- Initialize the OpenVINO environment.
-
Run the docker image by mounting the device drivers
docker run -itu root:root --rm --device-cgroup-rule='c 189:* rmw' -v /dev/bus/usb:/dev/bus/usb --mount type=bind,source=/var/tmp,destination=/var/tmp --device /dev/ion:/dev/ion onnxruntime-vadm:latest
OpenVINO on HETERO or Multi-Device Build
-
Build the docker image from the DockerFile in this repository.
for HETERO:
docker build --rm -t onnxruntime-HETERO --build-arg DEVICE=HETERO:<DEVICE_TYPE_1>,<DEVICE_TYPE_2>,<DEVICE_TYPE_3>... -f <Dockerfile> .for MULTI:
docker build --rm -t onnxruntime-MULTI --build-arg DEVICE=MULTI:<DEVICE_TYPE_1>,<DEVICE_TYPE_2>,<DEVICE_TYPE_3>... -f <Dockerfile> . -
Install the required rules, drivers and other packages as required from the steps above for each of the DEVICE_TYPE accordingly that would be added for the HETERO or MULTI Device build type.
-
Run the docker image as mentioned in the above steps
ARM 32/64
The build instructions are similar to x86 CPU. But if you want to build them on a x86 machine, you need to install qemu-user-static system package (outside of docker instances) first. Then
- Build the docker image from the Dockerfile in this repository.
docker build -t onnxruntime-source -f Dockerfile.arm64 ..
- Run the Docker image
docker run -it onnxruntime-source
For ARM32, please use Dockerfile.arm32v7 instead of Dockerfile.arm64.
NVIDIA Jetson TX1/TX2/Nano/Xavier:
These instructions are for JetPack SDK 4.4.
The Dockerfile.jetson is using NVIDIA L4T 32.4.3 as base image.
Versions different from these may require modifications to these instructions.
Instructions assume you are on Jetson host in the root of onnxruntime git project clone(https://github.com/microsoft/onnxruntime)
Two-step installation is required:
- Build Python 'wheel' for ONNX Runtime on host Jetson system; Pre-built Python wheels are also available at Nvidia Jetson Zoo.
- Build Docker image using ONNX Runtime wheel from step 1. You can also install the wheel on the host directly.
Here are the build commands for each step:
1.1 Install ONNX Runtime build dependencies on Jetpack 4.4 host:
sudo apt install -y --no-install-recommends \
build-essential software-properties-common cmake libopenblas-dev \
libpython3.6-dev python3-pip python3-dev
1.2 Build ONNXRuntime Python wheel:
./build.sh --update --config Release --build --build_wheel \
--use_cuda --cuda_home /usr/local/cuda --cudnn_home /usr/lib/aarch64-linux-gnu
Note: You may add --use_tensorrt and --tensorrt_home options if you wish to use NVIDIA TensorRT (support is experimental), as well as any other options supported by build.sh script.
- After the Python wheel is successfully built, use 'find' command for Docker to install the wheel inside new image:
find . -name '*.whl' -print -exec sudo -H DOCKER_BUILDKIT=1 nvidia-docker build --build-arg WHEEL_FILE={} -f ./dockerfiles/Dockerfile.jetson . \;
Note: Resulting Docker image will have ONNX Runtime installed in /usr, and ONNX Runtime wheel copied to /onnxruntime directory. Nothing else from ONNX Runtime source tree will be copied/installed to the image.
Note: When running the container you built in Docker, please either use 'nvidia-docker' command instead of 'docker', or use Docker command-line options to make sure NVIDIA runtime will be used and appropiate files mounted from host. Otherwise, CUDA libraries won't be found. You can also set NVIDIA runtime as default in Docker.
Nuphar
Public Preview
Ubuntu 16.04, Python Bindings
- Build the docker image from the Dockerfile in this repository.
docker build -t onnxruntime-nuphar -f Dockerfile.nuphar .
- Run the Docker image
docker run -it onnxruntime-nuphar
MIGraphX
Ubuntu 16.04, rocm3.3, AMDMIGraphX v0.7
- Build the docker image from the Dockerfile in this repository.
docker build -t onnxruntime-migraphx -f Dockerfile.migraphx .
- Run the Docker image
docker run -it --device=/dev/kfd --device=/dev/dri --group-add video onnxruntime-migraphx
ONNX Runtime Server
Public Preview
Ubuntu 16.04
- Build the docker image from the Dockerfile in this repository
docker build -t {docker_image_name} -f Dockerfile.server .
- Run the ONNXRuntime server with the image created in step 1
docker run -v {localModelAbsoluteFolder}:{dockerModelAbsoluteFolder} -p {your_local_port}:8001 {imageName} --model_path {dockerModelAbsolutePath}
- Send HTTP requests to the container running ONNX Runtime Server
Send HTTP requests to the docker container through the binding local port. Here is the full usage document.
curl -X POST -d "@request.json" -H "Content-Type: application/json" http://0.0.0.0:{your_local_port}/v1/models/mymodel/versions/3:predict