nGraph EP documentation (#939)

This commit is contained in:
nivas-x86 2019-04-30 18:38:09 -07:00 committed by jywu-msft
parent 1978b3c953
commit 7f14326dab
4 changed files with 57 additions and 0 deletions

View file

@ -114,6 +114,9 @@ If you want to build with an earlier version, you must temporarily remove the 'C
To build ONNX Runtime with MKL-DNN support, build it with `./build.sh --use_mkldnn`
To build ONNX Runtime using MKL-DNN built with dependency on MKL small libraries, build it with `./build.sh --use_mkldnn --use_mklml`
### nGraph
ONNX runtime with nGraph as an execution provider (released as preview) can be built on Linux as follows : `./build.sh --use_ngraph`
### TensorRT
ONNX Runtime supports the TensorRT execution provider (released as preview). You will need to download and install [CUDA](https://developer.nvidia.com/cuda-toolkit), [CUDNN](https://developer.nvidia.com/cudnn) and [TensorRT](https://developer.nvidia.com/nvidia-tensorrt-download).

View file

@ -54,6 +54,25 @@
docker run -it --runtime=nvidia --rm nvidia/cuda onnxruntime-gpu
```
## nGraph Version (Preview)
#### Linux 16.04, Python Bindings
1. Build the docker image from the Dockerfile in this repository.
```
# If you have a Linux machine, preface this command with "sudo"
docker build -t onnxruntime-ngraph -f Dockerfile.ngraph .
```
2. Run the Docker image
```
# If you have a Linux machine, preface this command with "sudo"
docker run -it onnxruntime-ngraph
```
### Other options to get started with ONNX Runtime
- Deploy [inference for pretrained ONNX models](https://github.com/Azure/MachineLearningNotebooks/tree/master/how-to-use-azureml/deployment/onnx) for handwritten digit recognition (MNIST)

BIN
docs/images/ngraph-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View file

@ -0,0 +1,35 @@
<p align="center">
<img src="docs/images/ngraph-logo.png">
</p>
## nGraph Execution Provider (preview)
[nGraph](https://github.com/NervanaSystems/ngraph) is a deep learning compiler from Intel®. The integration of nGraph as an execution provider (EP) into ONNX Runtime accelerates performance of ONNX model workloads across wide range of hardware offerings. Microsoft and Intel worked closely to integrate the nGraph EP with ONNX Runtime to showcase the benefits of quantization (int8). The nGraph EP leverages Intel® DL Boost and delivers performance increase with minimal loss of accuracy relative to FP32 ONNX models. With the nGraph EP, the ONNX Runtime delivers better inference performance across range of Intel hardware including Intel® Xeon® Processors compared to a generic CPU execution provider.
### Build nGraph execution provider
Developers can now tap into the power of nGraph through ONNX Runtime to accelerate inference performance of ONNX models. Instructions for building the nGraph execution provider from the source is available [here](https://github.com/Microsoft/onnxruntime/blob/master/BUILD.md#nGraph).
While the nGraph Compiler stack supports various operating systems and backends ([full list available here](https://www.ngraph.ai/ecosystem)), the nGraph execution provider for ONNX Runtime is validated for the following:
### Supported OS
* Ubuntu 16.04
* More to be added soon!
### Supported backend
* CPU
* More to be added soon!
### Using the nGraph execution provider
#### C/C++
To use nGraph as execution provider for inferencing, please register it as below.
```
InferenceSession session_object{so};
session_object.RegisterExecutionProvider(std::make_unique<::onnxruntime::NGRAPHExecutionProvider>());
status = session_object.Load(model_file_name);
```
The C API details are [here](https://github.com/Microsoft/onnxruntime/blob/master/docs/C_API.md#c-api).
### Python
When using the python wheel from the ONNX Runtime built with nGraph execution provider, it will be automatically prioritized over the CPU execution provider. Python APIs details are [here](https://github.com/Microsoft/onnxruntime/blob/master/docs/python/api_summary.rst#api-summary).
### Using onnxruntime_perf_test
You can test the performance of your ONNX Model with the nGraph execution provider. Use the flag -e ngraph in [onnxruntime_perf_test](https://github.com/Microsoft/onnxruntime/tree/master/onnxruntime/test/perftest#onnxruntime-performance-test).