forked from microsoft/onnxruntime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 89618e8
Showing
930 changed files
with
127,587 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
# Defaults for all languages. | ||
BasedOnStyle: Google | ||
|
||
# Setting ColumnLimit to 0 so developer choices about where to break lines are maintained. | ||
# Developers are responsible for adhering to the 120 character maximum. | ||
ColumnLimit: 0 | ||
SortIncludes: false | ||
DerivePointerAlignment: false | ||
|
||
# if you want to customize when working locally see https://clang.llvm.org/docs/ClangFormatStyleOptions.html for options. | ||
# See ReformatSource.ps1 for a script to update all source according to the current options in this file. | ||
# e.g. customizations to use Allman bracing and more indenting. | ||
# AccessModifierOffset: -2 | ||
# BreakBeforeBraces: Allman | ||
# CompactNamespaces: false | ||
# IndentCaseLabels: true | ||
# IndentWidth: 4 | ||
# NamespaceIndentation: All | ||
|
||
... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
# turn off readability-braces-around-statements to allow single line statement like 'if (x == y) doSomething();' | ||
Checks: '-*,cppcoreguidelines-*,google-*,readability-*,modernize-*,-readability-braces-around-statements,-google-runtime-references,-cppcoreguidelines-pro-type-reinterpret-cast' | ||
WarningsAsErrors: '' | ||
HeaderFilterRegex: '.*lotus\/core\/.*' | ||
AnalyzeTemporaryDtors: false | ||
FormatStyle: none | ||
CheckOptions: | ||
- key: google-readability-braces-around-statements.ShortStatementLines | ||
value: '1' | ||
- key: google-readability-function-size.StatementThreshold | ||
value: '800' | ||
- key: google-readability-namespace-comments.ShortNamespaceLines | ||
value: '10' | ||
- key: google-readability-namespace-comments.SpacesBeforeComments | ||
value: '2' | ||
- key: modernize-loop-convert.MaxCopySize | ||
value: '16' | ||
- key: modernize-loop-convert.MinConfidence | ||
value: reasonable | ||
- key: modernize-loop-convert.NamingStyle | ||
value: CamelCase | ||
- key: modernize-pass-by-value.IncludeStyle | ||
value: google | ||
- key: modernize-replace-auto-ptr.IncludeStyle | ||
value: google | ||
- key: modernize-use-nullptr.NullMacros | ||
value: 'NULL' | ||
... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This sets the default behaviour, overriding core.autocrlf | ||
* text=auto | ||
|
||
# All source files should have unix line-endings in the repository, | ||
# but convert to native line-endings on checkout | ||
*.cc text | ||
*.h text | ||
|
||
# Windows specific files should retain windows line-endings | ||
*.sln text eol=crlf | ||
|
||
# make sure build.sh retains Unix line endings, even when checked out on windows. | ||
*.sh text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# build, distribute, and bins (+ python proto bindings) | ||
build | ||
build_host_protoc | ||
build_android | ||
build_ios | ||
build_* | ||
.build_debug/* | ||
.build_release/* | ||
distribute/* | ||
*.testbin | ||
*.bin | ||
cmake_build | ||
.cmake_build | ||
gen | ||
*~ | ||
.vs | ||
TestResults/ | ||
.idea/ | ||
lotus.egg-info | ||
nuget_root/ | ||
.packages/ | ||
.vscode/ | ||
*.code-workspace | ||
__pycache__ | ||
onnxruntime_profile*.json | ||
/docs/python/*.md | ||
/docs/python/auto_examples/* | ||
/docs/python/media/* | ||
/docs/python/examples/*.onnx | ||
/docs/python/examples/graph.* | ||
/docs/python/*_LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[submodule "external/protobuf"] | ||
path = cmake/external/protobuf | ||
url = https://github.com/google/protobuf.git | ||
[submodule "cmake/external/googletest"] | ||
path = cmake/external/googletest | ||
url = https://github.com/google/googletest.git | ||
[submodule "cmake/external/onnx"] | ||
path = cmake/external/onnx | ||
url = https://github.com/onnx/onnx | ||
[submodule "cmake/external/tvm"] | ||
path = cmake/external/tvm | ||
url = https://github.com/dmlc/tvm.git | ||
[submodule "cmake/external/date"] | ||
path = cmake/external/date | ||
url = https://github.com/HowardHinnant/date.git | ||
[submodule "cmake/external/gsl"] | ||
path = cmake/external/gsl | ||
url = https://github.com/Microsoft/GSL.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
# Build ONNX Runtime | ||
|
||
## Supported dev environments | ||
|
||
| OS | Supports CPU | Supports GPU| Notes | | ||
|-------------|:------------:|:------------:|------------------------------------| | ||
|Windows 10 | YES | YES |Must use VS 2017 or the latest VS2015| | ||
|Windows 10 <br/> Subsystem for Linux | YES | NO | | | ||
|Ubuntu 16.x | YES | YES | | | ||
|Ubuntu 17.x | YES | YES | | | ||
|Ubuntu 18.x | YES | YES | | | ||
|Fedora 24 | YES | YES | | | ||
|Fedora 25 | YES | YES | | | ||
|Fedora 26 | YES | YES | | | ||
|Fedora 27 | YES | YES | | | ||
|Fedora 28 | YES | NO |Cannot build GPU kernels but can run them | | ||
|
||
* Red Hat Enterprise Linux and CentOS are not supported. | ||
* GCC 4.x and below are not supported. If you are using GCC 7.0+, you'll need to upgrade eigen to a newer version before compiling ONNX Runtime. | ||
|
||
OS/Compiler Matrix: | ||
|
||
| OS/Compiler | Supports VC | Supports GCC | Supports Clang | | ||
|-------------|:------------:|:----------------:|:---------------:| | ||
|Windows 10 | YES | Not tested | Not tested | | ||
|Linux | NO | YES(gcc>=5.0) | YES | | ||
|
||
ONNX Runtime python binding only supports Python 3.x. Please use python 3.5+. | ||
|
||
## Build | ||
Install cmake-3.11 or better from https://cmake.org/download/. | ||
|
||
Checkout the source tree: | ||
``` | ||
git clone --recursive https://github.com/Microsoft/onnxruntime | ||
cd onnxruntime | ||
./build.sh for Linux (or ./build.bat for Windows) | ||
``` | ||
The build script runs all unit tests by default. | ||
|
||
The complete list of build options can be found by running `./build.sh (or ./build.bat) --help` | ||
|
||
## Build/Test Flavors for CI | ||
|
||
### CI Build Environments | ||
|
||
| Build Job Name | Environment | Dependency | Test Coverage | Scripts | | ||
|--------------------|---------------------|---------------------------------|--------------------------|------------------------------------------| | ||
| Linux_CI_Dev | Ubuntu 16.04 | python=3.5 | Unit tests; ONNXModelZoo | [script](tools/ci_build/github/linux/run_build.sh) | | ||
| Linux_CI_GPU_Dev | Ubuntu 16.04 | python=3.5; nvidia-docker | Unit tests; ONNXModelZoo | [script](tools/ci_build/github/linux/run_build.sh) | | ||
| Windows_CI_Dev | Windows Server 2016 | python=3.5 | Unit tests; ONNXModelZoo | [script](build.bat) | | ||
| Windows_CI_GPU_Dev | Windows Server 2016 | cuda=9.0; cudnn=7.0; python=3.5 | Unit tests; ONNXModelZoo | [script](build.bat) | | ||
|
||
## Additional Build Flavors | ||
The complete list of build flavors can be seen by running `./build.sh --help` or `./build.bat --help`. Here are some common flavors. | ||
|
||
### Windows CUDA Build | ||
ONNX Runtime supports CUDA builds. You will need to download and install [CUDA](https://developer.nvidia.com/cuda-toolkit) and [CUDNN](https://developer.nvidia.com/cudnn). | ||
|
||
ONNX Runtime is built and tested with CUDA 9.0 and CUDNN 7.0 using the Visual Studio 2017 14.11 toolset (i.e. Visual Studio 2017 v15.3). | ||
CUDA versions up to 9.2 and CUDNN version 7.1 should also work with versions of Visual Studio 2017 up to and including v15.7, however you may need to explicitly install and use the 14.11 toolset due to CUDA and CUDNN only being compatible with earlier versions of Visual Studio 2017. | ||
|
||
To install the Visual Studio 2017 14.11 toolset, see <https://blogs.msdn.microsoft.com/vcblog/2017/11/15/side-by-side-minor-version-msvc-toolsets-in-visual-studio-2017/> | ||
|
||
If using this toolset with a later version of Visual Studio 2017 you have two options: | ||
|
||
1. Setup the Visual Studio environment variables to point to the 14.11 toolset by running vcvarsall.bat prior to running cmake | ||
- e.g. if you have VS2017 Enterprise, an x64 build would use the following command | ||
`"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64 -vcvars_ver=14.11` | ||
|
||
2. Alternatively if you have CMake 3.12 or later you can specify the toolset version in the "-T" parameter by adding "version=14.11" | ||
- e.g. use the following with the below cmake command | ||
`-T version=14.11,host=x64` | ||
|
||
CMake should automatically find the CUDA installation. If it does not, or finds a different version to the one you wish to use, specify your root CUDA installation directory via the -DCUDA_TOOLKIT_ROOT_DIR CMake parameter. | ||
|
||
_Side note: If you have multiple versions of CUDA installed on a Windows machine and are building with Visual Studio, CMake will use the build files for the highest version of CUDA it finds in the BuildCustomization folder. e.g. C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\BuildCustomizations\. If you want to build with an earlier version, you must temporarily remove the 'CUDA x.y.*' files for later versions from this directory._ | ||
|
||
The path to the 'cuda' folder in the CUDNN installation must be provided. The 'cuda' folder should contain 'bin', 'include' and 'lib' directories. | ||
|
||
You can build with: | ||
|
||
``` | ||
./build.sh --use_cuda --cudnn_home /usr --cuda_home /usr/local/cuda (Linux) | ||
./build.bat --use_cuda --cudnn_home <cudnn home path> --cuda_home <cuda home path> (Windows) | ||
``` | ||
|
||
### MKL-DNN | ||
To build ONNX Runtime with MKL-DNN support, build it with `./build.sh --use_mkldnn --use_mklml` | ||
|
||
### OpenBLAS | ||
#### Windows | ||
Instructions how to build OpenBLAS for windows can be found here https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio#build-openblas-for-universal-windows-platform. | ||
|
||
Once you have the OpenBLAS binaries, build ONNX Runtime with `./build.bat --use_openblas` | ||
|
||
#### Linux | ||
For Linux (e.g. Ubuntu 16.04), install libopenblas-dev package | ||
`sudo apt-get install libopenblas-dev` and build with `./build.sh --use_openblas` | ||
|
||
### OpenMP | ||
``` | ||
./build.sh --use_openmp (for Linux) | ||
./build.bat --use_openmp (for Windows) | ||
``` | ||
|
||
### Build with Docker on Linux | ||
Install Docker: `https://docs.docker.com/install/` | ||
|
||
#### CPU | ||
``` | ||
cd tools/ci_build/github/linux/docker | ||
docker build -t onnxruntime_dev --build-arg OS_VERSION=16.04 -f Dockerfile.ubuntu . | ||
docker run --rm -it onnxruntime_dev /bin/bash | ||
``` | ||
|
||
#### GPU | ||
If you need GPU support, please also install: | ||
1. nvidia driver. Before doing this please add 'nomodeset rd.driver.blacklist=nouveau' to your linux [kernel boot parameters](https://www.kernel.org/doc/html/v4.17/admin-guide/kernel-parameters.html). | ||
2. nvidia-docker2: [Install doc](`https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(version-2.0)`) | ||
|
||
To test if your nvidia-docker works: | ||
``` | ||
docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi | ||
``` | ||
|
||
Then build a docker image. We provided a sample for use: | ||
``` | ||
cd tools/ci_build/github/linux/docker | ||
docker build -t cuda_dev -f Dockerfile.ubuntu_gpu . | ||
``` | ||
|
||
Then run it | ||
``` | ||
./tools/ci_build/github/linux/run_dockerbuild.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Contributing | ||
|
||
We're always looking for your help to fix bugs and improve the product. Create a pull request and we'll be happy to take a look. | ||
Start by reading the [Engineering Design](docs/HighLevelDesign.md). | ||
|
||
# Checkin procedure | ||
``` | ||
git clone --recursive https://github.com/Microsoft/onnxruntime | ||
git checkout -b feature_branch | ||
# make your changes | ||
# write unit tests | ||
# make sure it builds and all tests pass | ||
git commit -m "my changes" | ||
git push origin HEAD | ||
``` | ||
To request merge into master send a pull request from the web ui | ||
https://github.com/Microsoft/onnxruntime | ||
New code *must* be accompanied by unit tests. | ||
|
||
# Build | ||
[Build](BUILD.md) | ||
|
||
# Additional Documentation | ||
* [Adding a custom operator](docs/AddingCustomOp.md) | ||
|
||
# Coding guidelines | ||
Please see [Coding Conventions and Standards](./docs/Coding_Conventions_and_Standards.md) | ||
|
||
# Licensing guidelines | ||
This project welcomes contributions and suggestions. Most contributions require you to | ||
agree to a Contributor License Agreement (CLA) declaring that you have the right to, | ||
and actually do, grant us the rights to use your contribution. For details, visit | ||
https://cla.microsoft.com. | ||
|
||
When you submit a pull request, a CLA-bot will automatically determine whether you need | ||
to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the | ||
instructions provided by the bot. You will only need to do this once across all repositories using our CLA. | ||
|
||
# Code of conduct | ||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) | ||
or contact [[email protected]](mailto:[email protected]) with any additional questions or comments. | ||
|
||
# Reporting Security Issues | ||
Security issues and bugs should be reported privately, via email, to the Microsoft Security | ||
Response Center (MSRC) at [[email protected]](mailto:[email protected]). You should | ||
receive a response within 24 hours. If for some reason you do not, please follow up via | ||
email to ensure we received your original message. Further information, including the | ||
[MSRC PGP](https://technet.microsoft.com/en-us/security/dn606155) key, can be found in | ||
the [Security TechCenter](https://technet.microsoft.com/en-us/security/default). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Microsoft Corporation | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# ONNX Runtime | ||
|
||
[![Build Status](https://dev.azure.com/onnxruntime/onnxruntime/_apis/build/status/Microsoft.onnxruntime)](https://dev.azure.com/onnxruntime/onnxruntime/_build/latest?definitionId=1) | ||
|
||
ONNX Runtime is the runtime for [ONNX](https://github.com/onnx/onnx). | ||
|
||
# Engineering Design | ||
[Engineering Design](docs/HighLevelDesign.md) | ||
|
||
# API | ||
| API | CPU package | GPU package | | ||
|-----|-------------|-------------| | ||
| [Python](https://docs.microsoft.com/en-us/python/api/overview/azure/onnx/intro?view=azure-onnx-py) | [Windows](TODO)<br>[Linux](https://pypi.org/project/onnxruntime/)<br>[Mac](TODO)| [Windows](TODO)<br>[Linux](https://pypi.org/project/onnxruntime-gpu/) | | ||
| [C#](docs/CSharp_API.md) | [Windows](TODO)| Not available | | ||
| [C](docs/C_API.md) | [Windows](TODO)<br>[Linux](TODO) | Not available | | ||
|
||
# Build | ||
[Build](BUILD.md) | ||
|
||
# Contribute | ||
[Contribute](CONTRIBUTING.md) | ||
|
||
# Versioning | ||
[Versioning](docs/Versioning.md) | ||
|
||
# Feedback | ||
* File a bug in [GitHub Issues](https://github.com/Microsoft/onnxruntime/issues) | ||
|
||
# Code of Conduct | ||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) | ||
or contact [[email protected]](mailto:[email protected]) with any additional questions or comments. | ||
|
||
# License | ||
[LICENSE](LICENSE) |
Oops, something went wrong.