Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DirectML 1.5.1 to 1.8.0 for ORT1.10 #9765

Merged
merged 138 commits into from
Nov 20, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
ed56657
Merged PR 5195856: Fix broken cases of zero size tensors in Cast/Reduce
fdwr Sep 21, 2020
9d57bb4
Add way to disable additional linker opt flags
jstoecker Sep 22, 2020
682ac27
Merged PR 5201369: Remove copy of initializers added in DMLXP refactor
jeffbloo Sep 22, 2020
c2c3028
Merge remote-tracking branch 'upstream/master' into DmlDev
Sep 25, 2020
098f6b9
Merge remote-tracking branch 'upstream/master' into DmlDev
Sep 25, 2020
5af3630
Merge remote-tracking branch 'upstream/master' into DmlDev
jstoecker Sep 29, 2020
c443330
Merge remote-tracking branch 'upstream/master' into DmlDev
Sep 30, 2020
e237b9d
Merge remote-tracking branch 'upstream/master' into DmlDev
Sep 30, 2020
a343b21
Merge remote-tracking branch 'upstream/master' into DmlDev
Oct 1, 2020
bb3c8f9
Merge remote-tracking branch 'upstream/master' into DmlDev
Oct 2, 2020
3165d80
Merge remote-tracking branch 'upstream/master' into DmlDev
Oct 3, 2020
891175d
Merged PR 5253310: Fix 0-sized dimension broadcasting
Oct 5, 2020
1a3bfd7
Merge remote-tracking branch 'upstream/master' into DmlDev
Oct 6, 2020
8aa61aa
Merge remote-tracking branch 'upstream/master' into DmlDev
Oct 9, 2020
17544fc
Merge remote-tracking branch 'upstream/master' into DmlDev
Oct 10, 2020
88ebad4
Merge remote-tracking branch 'upstream/master' into DmlDev
Oct 14, 2020
c1602ff
Merge remote-tracking branch 'upstream/master' into DmlDev
Oct 15, 2020
ec0dd8e
Merge remote-tracking branch 'upstream/master' into DmlDev
Oct 16, 2020
bc84aeb
Merge remote-tracking branch 'upstream/master' into DmlDev
Oct 17, 2020
21e02ef
Merge remote-tracking branch 'upstream/master' into DmlDev
Oct 20, 2020
00d749b
Merge remote-tracking branch 'upstream/master' into DmlDev
Oct 22, 2020
49ec73e
Merge remote-tracking branch 'upstream/master' into DmlDev
Oct 23, 2020
e380fd3
Merged PR 5334334: Fix asserts and failure in GraphKernelHelper.cpp
jeffbloo Oct 26, 2020
1d87831
Merged PR 5344477: Disable GPU timeouts in DML EP command queue creation
jeffbloo Oct 28, 2020
1e13eca
Merged PR 5380534: BatchNormalization failure in autopilot - fix outp…
fdwr Nov 7, 2020
81b2cb9
Merge remote-tracking branch 'upstream/master' into DmlDev
Nov 7, 2020
838bc77
Merged PR 5386132: Update 8D BatchNorm
nickfeeney Nov 9, 2020
de85638
Merge remote-tracking branch 'upstream/master' into DmlDev
Nov 10, 2020
7d98596
Merged PR 5390213: Tile allow 0 in repeats
fdwr Nov 10, 2020
502f85c
Merged PR 5411855: Manual pull from onnxruntime upstream GitHub maste…
fdwr Nov 17, 2020
395fac9
Merged PR 5419219: DmlDev RI from GitHub master 2020-11-18
fdwr Nov 18, 2020
26882c2
Merge remote-tracking branch 'upstream/master' into user/dwayner/DmlD…
fdwr Nov 18, 2020
63ee7b4
Merged PR 5420139: DmlDev RI from GitHub master 2020-11-18 #2
fdwr Nov 18, 2020
62d4f75
Merge remote-tracking branch 'upstream/master' into DmlDev
Nov 19, 2020
cd07783
Merge remote-tracking branch 'upstream/master' into DmlDev
Nov 19, 2020
8f0bfe8
Merge remote-tracking branch 'upstream/master' into user/dwayner/DmlD…
fdwr Nov 19, 2020
4b17fd5
Merged PR 5425356: DmlDev RI from GitHub master 2020-11-19
fdwr Nov 20, 2020
934b788
Merge remote-tracking branch 'upstream/master' into dmldev_temp
Dec 2, 2020
0afbdfd
Merge remote-tracking branch 'upstream/master' into HEAD
Dec 7, 2020
054fb4d
Merged PR 5490021: Merge latest github master into dmldev branch
Dec 11, 2020
c442995
Revert "Merged PR 5490021: Merge latest github master into dmldev branch
Dec 11, 2020
a12faed
Merge remote-tracking branch 'upstream/master' into 054fb4d3-revert-f…
Dec 11, 2020
3b44eee
Merged PR 5490057: Preserve history of merge
Dec 11, 2020
18ef0fa
Merged PR 5551793: Merge with latest ORT master
Jan 7, 2021
b4082e3
Merged PR 5557382: Revert "Merged PR 5551793: Merge with latest ORT m…
Jan 9, 2021
e22ae49
Merge remote-tracking branch 'upstream/master' into user/pavignol/1234
Jan 9, 2021
f9cc6ee
Merged PR 5557454: Update to latest ORT master
Jan 9, 2021
355cc0e
Merge remote-tracking branch 'upstream/master' into user/rylai/update…
Feb 4, 2021
7427d6e
Merged PR 5650614: Merge Github onnxruntime into dmldev
Feb 4, 2021
284f686
Merge remote-tracking branch 'upstream/master' into HEAD
Feb 8, 2021
97c1693
Merged PR 5663009: Merge latest github onnxruntime into dmldev
Feb 8, 2021
c6c0278
Merged PR 5672827: RI from github
orilevari Feb 10, 2021
e1b0cf9
Revert "Merged PR 5672827: RI from github"
Feb 10, 2021
986c7a9
Merge remote-tracking branch 'upstream/master' into user/orilevari/un…
Feb 10, 2021
a9245f5
Merged PR 5673432: Unsquash RI
orilevari Feb 10, 2021
c31d278
Merge remote-tracking branch 'upstream/master' into dmldev_temp
martinb35 Feb 17, 2021
14c9095
Merged PR 5694922: Onnxruntime GitHub to DmlDev RI
martinb35 Feb 17, 2021
609d0ec
Merge remote-tracking branch 'upstream/master' into dmldev_temp
martinb35 Feb 19, 2021
67e7a9c
Merged PR 5703823: GitHub RI OnnxRuntime to DmlDev
martinb35 Feb 19, 2021
a134b1f
Merge remote-tracking branch 'upstream/master' into dmldev_temp
nickfeeney Feb 25, 2021
46e026e
Merged PR 5727374: Github to DmlDev Update 2/25/2021
nickfeeney Feb 25, 2021
50973de
Merged PR 5691446: QLinear Graph Support
nickfeeney Mar 10, 2021
4f5d6a0
Add ARM64X forwarder libs
tiagoshibata Mar 17, 2021
bc3aea4
Capitalize DLL name
tiagoshibata Mar 17, 2021
934bb52
Merged PR 5805461: Add ARM64X forwarder libs
tiagoshibata Mar 17, 2021
897a0b9
Merged PR 5807395: Add DML kernels for QLinearAdd (com.microsoft name…
jeffbloo Mar 18, 2021
3d37a3c
Merged PR 5807585: Remove support for strided 64-bit emulation in DML…
Mar 18, 2021
293774f
Merge remote-tracking branch 'upstream/master' into p/adtsai/merge
Mar 25, 2021
39bd192
Merged PR 5837692: Merge latest from upstream
Mar 25, 2021
a8f0ab9
Merged PR 5846998: Fix warnings level for DML EP
Mar 26, 2021
56d2c4b
Merged PR 5861108: Allow nodes in DML graph partitions with empty sha…
jeffbloo Mar 31, 2021
057de97
Merged PR 5866812: Decompose unsupported QLinearSigmoid operation in …
jeffbloo Apr 1, 2021
9a8991e
Merged PR 5866671: Move onnxruntime arm64x forwarder
tiagoshibata Apr 1, 2021
48fcddd
Merged PR 5873494: Resize support nearest_mode floor in DML EP
fdwr Apr 2, 2021
8cafd2f
Merged PR 5918130: Add activation fusions missing in newer opsets
jeffbloo Apr 12, 2021
e359220
Merged PR 5938615: RI onnxruntime into Dmldev
zhangxiang1993 Apr 15, 2021
fc88a7a
Merge commit 'ef1aaa367aab7c0c384081678ae506e658be864f' into user/ryl…
Apr 19, 2021
e9286aa
Merged PR 5950370: Unsquash merge from github Onnxruntime into dmldev
Apr 19, 2021
988ea05
Merge remote-tracking branch 'upstream/master' into user/rylai/latest…
Apr 27, 2021
9921f94
Merged PR 5982350: Latest Github master into Dmldev
Apr 27, 2021
7290270
Merge remote-tracking branch 'mainstream/master' into DmlDev
tiagoshibata May 4, 2021
9456bf4
Merged PR 6006709: Merge onnxruntime's master with DmlDev
tiagoshibata May 4, 2021
a27ef39
Merged PR 6047693: DML EP fix GetSupportedDeviceDataTypeMask for int6…
fdwr May 14, 2021
503bd59
Merge commit '31e6d3f85c21bb3fc0a9b194cf5a6e7380fd57d8' into user/jus…
jstoecker May 20, 2021
3eace1a
React native debug keystore. **BYPASS_SECRET_SCANNING**
jstoecker May 20, 2021
62a1c39
Merged PR 6070939: Merge ORT master
jstoecker May 20, 2021
3fb4a2d
Merge remote-tracking branch 'upstream/master' into user/justoeck/ri_…
jstoecker May 25, 2021
c0a8905
Merged PR 6087868: Update ORT to latest master
jstoecker May 25, 2021
a85a9dd
Merged PR 6091402: Fix inbox ORT debug info
tiagoshibata May 26, 2021
3f43a84
Merged PR 6093117: Fix test_DynamicQuantizedLinear_max_adjusted_expan…
sumitsays May 28, 2021
bccf292
Merged PR 6103324: Remove usage of non-generic error code (FWP_E_NULL…
sumitsays May 29, 2021
14fe3e8
Merged PR 6115559: RI changes from Github into dmldev
Jun 3, 2021
5c8b075
Merge commit '0fbec1b9c1d8f34a44ac5e7efc1fee0a0a08ac84' into user/ryl…
Jun 3, 2021
2fd703a
Merged PR 6115647: RI github into dmldev. Need to merge this unsquashed
Jun 3, 2021
64f1a4e
Merge remote-tracking branch 'upstream/master' into HEAD
Jun 4, 2021
8c951b9
Merge remote-tracking branch 'upstream/master' into user/rylai/ri_6_4
Jun 7, 2021
f5c6b97
Merged PR 6129591: Merge github master into Dmldev
Jun 8, 2021
8b0c2e1
Merged PR 6101363: Int64 prototype work for ONNX runtime DML EP
fdwr Jun 11, 2021
de1b1ed
Merge remote-tracking branch 'upstream/master' into HEAD
Jun 15, 2021
365070b
Merged PR 6158327: RI Onnxruntime github into DmlDev
Jun 16, 2021
b0c0b08
FIx merge conflict
Jul 21, 2021
83bb771
Merged PR 6283367: RI Onnxruntime github to internal Fork 7/21
Jul 21, 2021
6b05a62
Merge remote-tracking branch 'upstream/master' into HEAD
Jul 27, 2021
d78568a
Merge remote-tracking branch 'upstream/master' into HEAD
Jul 29, 2021
c80740b
Merged PR 6311990: RI 7/29 github master into dmldev
Jul 29, 2021
675ea9b
Merged PR 6486412: Register ORT DML ONNX operators for int64
fdwr Sep 22, 2021
8bcd076
Merged PR 6511109: Register ONNX operators for int64 in DML EP
sumitsays Sep 29, 2021
39c2d76
Merged PR 6512710: Code clean up in DmlOperatorPadding
sumitsays Sep 29, 2021
dae5b1d
Merged PR 6515621: Autopilot build ORT clamp_cast on *64-bit release
fdwr Sep 29, 2021
beab1ef
Merged PR 6516718: [DML EP] Direct INT64 support for indices tensor f…
sumitsays Sep 29, 2021
335283d
Fix merge conflicts, merge from public onnxruntime
tiagoshibata Oct 1, 2021
20b9390
Merged PR 6524907: Fix merge conflicts from public ORT to WindowsAI ORT
tiagoshibata Oct 1, 2021
21e29cf
Merge remote-tracking branch 'origin/DmlDev' into user/ticastro/fix-ri
Oct 4, 2021
ccf8ef6
Merged PR 6531168: Unsquash merge on DmlDev
Oct 4, 2021
7dad90b
Merge remote-tracking branch 'upstream/master' into HEAD
Oct 26, 2021
08dd8a0
Merged PR 6604943: RI 10/26 from github into fork
Oct 26, 2021
8dd4d20
Merged PR 6606929: RI 10/26 from github into fork #2
Oct 27, 2021
6c236fd
Merged PR 6622174: merge latest onnxruntime into dmldev
martinb35 Oct 30, 2021
6a2d709
Merge remote-tracking branch 'upstream/master' into dmldev_temp
martinb35 Oct 30, 2021
a07da45
Merged PR 6622182: add back change history that I lost with a squash …
martinb35 Oct 30, 2021
3a1b404
Merge remote-tracking branch 'upstream/master' into DmlDev
jeffbloo Nov 3, 2021
f8ecf10
Merge remote-tracking branch 'upstream/master' into user/jeffbloo/Mer…
jeffbloo Nov 7, 2021
d9c42ac
Merged PR 6646876: Merge ORT Github master to DmlDev
jeffbloo Nov 8, 2021
b9c4b2e
Merge remote-tracking branch 'upstream/master' into user/jeffbloo/Mer…
jeffbloo Nov 12, 2021
2a92081
ORT TensorShape changes to avoid build error in tools overriding GSL …
jeffbloo Nov 12, 2021
363cb23
Merged PR 6664646: Merge ORT Github and address DMLXP build error fro…
jeffbloo Nov 12, 2021
3e5d636
Merged PR 6668481: Fix Resize float16 ROI tensor
fdwr Nov 13, 2021
52203e0
Merged PR 6668707: Fix Resize float16 ROI tensor (part 2)
fdwr Nov 13, 2021
99afb87
Update DirectML 1.5.1 to 1.8.0 for ORT1.10
fdwr Nov 16, 2021
191bc51
Merged PR 6676705: Add opset 13 for ops which are unchanged
fdwr Nov 18, 2021
533b20c
Merge remote-tracking branch 'upstream/master' into dmldev_temp
nums11 Nov 18, 2021
a2787ca
Merged PR 6688023: ORT GitHub to DmlDev RI
nums11 Nov 18, 2021
e0ffc30
Update to 1.8.0
fdwr Nov 19, 2021
3241997
Merge remote-tracking branch 'origin/master' into user/dwayner/DML1.8…
fdwr Nov 19, 2021
289b1bd
Merge remote-tracking branch 'ado_wai_ort/DmlDev' into user/dwayner/D…
fdwr Nov 19, 2021
f047be5
Merge branch 'master' into user/dwayner/DML1.8forORT1.10
fdwr Nov 19, 2021
d1b772e
Mark dynamicquantizelinear as broken in DML
fdwr Nov 19, 2021
f28d7ec
Disable DML dynamicquantizelinear in backend tests DML Bug 33073263
fdwr Nov 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merged PR 5411855: Manual pull from onnxruntime upstream GitHub maste…
…r into DmlDev

I'm just doing this manually this once because some commits were squashed, and I want to be sure they merge cleanly for the nightly automatic merge. "git merge upstream/master"
  • Loading branch information
fdwr committed Nov 17, 2020
commit 502f85c8839a7b48d0984a405e6ec810e3e1841b
49 changes: 30 additions & 19 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,23 @@ These instructions are for JetPack SDK 4.4.
See more information on DNNL and MKL-ML [here](./docs/execution_providers/DNNL-ExecutionProvider.md).

#### Build Instructions
The DNNL execution provider can be built for Intel CPU or GPU. To build for Intel GPU, install [Intel SDK for OpenCL Applications](https://software.intel.com/content/www/us/en/develop/tools/opencl-sdk.html). Install the latest GPU driver - [Windows graphics driver](https://downloadcenter.intel.com/product/80939/Graphics), [Linux graphics compute runtime and OpenCL driver](https://github.com/intel/compute-runtime/releases).

##### Windows
`.\build.bat --use_dnnl`

##### Linux
`./build.sh --use_dnnl`

To build for Intel GPU, replace dnnl_opencl_root with the path of the Intel SDK for OpenCL Applications.

##### Windows

`.\build.bat --use_dnnl --dnnl_gpu_runtime ocl --dnnl_opencl_root "c:\program files (x86)\intelswtools\sw_dev_tools\opencl\sdk"`

##### Linux

DNNL: `./build.sh --use_dnnl`
`./build.sh --use_dnnl --dnnl_gpu_runtime ocl --dnnl_opencl_root "/opt/intel/sw_dev_tools/opencl-sdk"`

---

Expand Down Expand Up @@ -405,16 +419,18 @@ See more information on the OpenVINO Execution Provider [here](./docs/execution_
| <code>VAD-M_FP16</code> | Intel<sup>®</sup> Vision Accelerator Design based on 8 Movidius<sup>TM</sup> MyriadX VPUs |
| <code>VAD-F_FP32</code> | Intel<sup>®</sup> Vision Accelerator Design with an Intel<sup>®</sup> Arria<sup>®</sup> 10 FPGA |
| <code>HETERO:<DEVICE_TYPE_1>,<DEVICE_TYPE_2>,<DEVICE_TYPE_3>...</code> | All Intel<sup>®</sup> silicons mentioned above |
| <code>MULTI:<DEVICE_TYPE_1>,<DEVICE_TYPE_2>,<DEVICE_TYPE_3>...</code> | All Intel<sup>®</sup> silicons mentioned above |

Specifying Hardware Target for HETERO Build:
Specifying Hardware Target for HETERO or Multi-Device Build:

HETERO:<DEVICE_TYPE_1>,<DEVICE_TYPE_2>,<DEVICE_TYPE_3>...
MULTI:<DEVICE_TYPE_1>,<DEVICE_TYPE_2>,<DEVICE_TYPE_3>...
The <DEVICE_TYPE> can be any of these devices from this list ['CPU','GPU','MYRIAD','FPGA','HDDL']

A minimum of two DEVICE_TYPE'S should be specified for a valid HETERO Build.
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
HETERO:MYRIAD,CPU HETERO:HDDL,GPU,CPU MULTI:MYRIAD,GPU,CPU

For more information on OpenVINO Execution Provider&#39;s ONNX Layer support, Topology support, and Intel hardware enabled, please refer to the document [OpenVINO-ExecutionProvider.md](./docs/execution_providers/OpenVINO-ExecutionProvider.md) in <code>$onnxruntime_root/docs/execution_providers</code>

Expand Down Expand Up @@ -547,29 +563,24 @@ onnxruntime_perf_test
onnxruntime_test_all
```

#### Build Instructions (Jetson Nano)
#### Native Build Instructions (validated on Jetson Nano and Jetson Xavier)

1. Build ACL Library (skip if already built)
```
cd ~
git clone https://github.com/Arm-software/ComputeLibrary.git
git clone -b v20.02 https://github.com/Arm-software/ComputeLibrary.git
cd ComputeLibrary
sudo apt install scons
sudo apt install g++-arm-linux-gnueabihf
sudo apt-get install -y scons g++-arm-linux-gnueabihf
scons -j8 arch=arm64-v8a Werror=1 debug=0 asserts=0 neon=1 opencl=1 examples=1 build=native
```
2. Set environment variables to set include directory and shared object library path.
```
export CPATH=~/ComputeLibrary/include/:~/ComputeLibrary/
export LD_LIBRARY_PATH=~/ComputeLibrary/build/
```
3. Build onnxruntime with --use_acl flag
```
./build.sh --use_acl
```
To use a library outside the normal environment you can set a custom path by using --acl_home and --acl_libs tags that defines the path to the ComputeLibrary directory and the build directory respectively.

2. Cmake is needed to build ONNX Runtime. Because the minimum required version is 3.13,
it is necessary to build CMake from source. Download Unix/Linux sources from https://cmake.org/download/
and follow https://cmake.org/install/ to build from source. Version 3.17.5 and 3.18.4 have been tested on Jetson.

3. Build onnxruntime with --use_acl flag with one of the supported ACL version flags. (ACL_1902 | ACL_1905 | ACL_1908 | ACL_2002)
```
./build.sh --use_acl --acl_home /path/to/ComputeLibrary --acl_libs /path/to/build
./build.sh --config RelWithDebInfo --use_acl ACL_2002 --update --build --build_wheel --parallel --acl_home ~/ComputeLibrary --acl_libs ~/ComputeLibrary/build
```

---
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Note that if an issue isn't a high priority or has many open questions then it m
The ONNX Runtime team will review the proposal and either approve or close the issue based on whether it broadly aligns with the [Onnx Runtime Roadmap - High Level Goals section](./docs/Roadmap.md) and contribution guidelines.

4. **API Review**

If the feature adds new APIs then we'll start an API review. All new public APIs must be reviewed before merging.
For making changes to the C API refer to guidance [here](./docs/C_API_Guidelines.md).
For making changes to the Windows Machine Learning WinRT API, please label your request as *api:WinML*, and someone from the Windows ML team will work with you.
Expand Down
23 changes: 20 additions & 3 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ option(onnxruntime_ENABLE_NVTX_PROFILE "Enable NVTX profile." OFF)
option(onnxruntime_ENABLE_TRAINING "Enable training functionality." OFF)
option(onnxruntime_ENABLE_TRAINING_E2E_TESTS "Enable training end-to-end tests." OFF)
option(onnxruntime_USE_HOROVOD "Build with HOROVOD support" OFF)
option(onnxruntime_USE_NCCL "Build with NCCL support" ON)
option(onnxruntime_USE_NCCL "Build with NCCL support" OFF)
#A special option just for debugging and sanitize check. Please do not enable in option in retail builds.
#The option has no effect on Windows.
option(onnxruntime_USE_VALGRIND "Build with valgrind hacks" OFF)
Expand Down Expand Up @@ -975,8 +975,8 @@ if(onnxruntime_USE_OPENVINO)

add_definitions(-DUSE_OPENVINO=1)

if (EXISTS "$ENV{INTEL_OPENVINO_DIR}/inference_engine/version.txt")
file(READ $ENV{INTEL_OPENVINO_DIR}/inference_engine/version.txt VER)
if (EXISTS "$ENV{INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/version.txt")
file(READ $ENV{INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/version.txt VER)
endif()

if (NOT DEFINED ENV{INTEL_OPENVINO_DIR})
Expand Down Expand Up @@ -1037,6 +1037,11 @@ if(onnxruntime_USE_OPENVINO)
add_definitions(-DDEVICE_NAME="${onnxruntime_USE_OPENVINO_DEVICE}")
endif()

if(onnxruntime_USE_OPENVINO_MULTI)
add_definitions(-DOPENVINO_CONFIG_MULTI=1)
add_definitions(-DDEVICE_NAME="${onnxruntime_USE_OPENVINO_DEVICE}")
endif()

endif()

if (onnxruntime_USE_VITISAI)
Expand Down Expand Up @@ -1216,6 +1221,7 @@ if (onnxruntime_ENABLE_TRAINING)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MPI DEFAULT_MSG MPI_INCLUDE_DIR MPI_LIBRARY)

set(onnxruntime_USE_MPI ON)
if (MPI_FOUND)
if(NOT DEFINED onnxruntime_MPI_HOME)
execute_process(COMMAND mpirun --version OUTPUT_VARIABLE MPIRUN_OUTPUT)
Expand All @@ -1231,7 +1237,14 @@ if (onnxruntime_ENABLE_TRAINING)
mark_as_advanced(MPI_INCLUDE_DIRS MPI_LIBRARIES)

list(APPEND onnxruntime_EXTERNAL_LIBRARIES ${MPI_LIBRARIES} ${MPI_CXX_LINK_FLAGS})

# Enable NCCL only when using CUDA or ROCM.
if(${onnxruntime_USE_CUDA} OR ${onnxruntime_USE_ROCM})
set(onnxruntime_USE_NCCL ON)
endif()

else ()
set(onnxruntime_USE_MPI OFF)
set(onnxruntime_USE_NCCL OFF)
set(onnxruntime_USE_HOROVOD OFF)
message( WARNING "MPI is not found. Please use --mpi_home to specify the path of MPI. Otherwise, NCCL or HOROVOD will be disabled." )
Expand Down Expand Up @@ -1302,6 +1315,10 @@ if (onnxruntime_ENABLE_TRAINING)
endif()
endif()

if (onnxruntime_USE_MPI AND MPI_FOUND)
add_definitions(-DUSE_MPI=1)
endif()

if (onnxruntime_USE_HOROVOD AND MPI_FOUND)
if (WIN32)
message( FATAL_ERROR "Horovod is not supported on Windows." )
Expand Down
16 changes: 12 additions & 4 deletions cmake/external/dnnl.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include (ExternalProject)

set(DNNL_URL https://github.com/intel/mkl-dnn.git)
# If DNNL_TAG is updated, check if platform.cmake.patch need to be updated.
set(DNNL_TAG v1.1.1)
set(DNNL_URL https://github.com/oneapi-src/onednn)
# If DNNL_TAG is updated, check if MKLML_VERSION and platform.cmake.patch need to be updated.
set(DNNL_TAG v1.7)

if(WIN32)
set(MKLML_OS_VERSION_STR "win")
Expand All @@ -20,6 +20,14 @@ else()
endif()
endif()

if (onnxruntime_USE_DNNL AND onnxruntime_DNNL_GPU_RUNTIME STREQUAL "ocl" AND onnxruntime_DNNL_OPENCL_ROOT STREQUAL "")
message(FATAL_ERROR "onnxruntime_DNNL_OPENCL_ROOT required for onnxruntime_DNNL_GPU_RUNTIME")
elseif(onnxruntime_USE_DNNL AND onnxruntime_DNNL_GPU_RUNTIME STREQUAL "ocl")
file(TO_CMAKE_PATH ${onnxruntime_DNNL_OPENCL_ROOT} onnxruntime_DNNL_OPENCL_ROOT)
set(DNNL_OCL_INCLUDE_DIR ${onnxruntime_DNNL_OPENCL_ROOT}/include)
set(DNNL_GPU_CMAKE_ARGS "-DDNNL_GPU_RUNTIME=OCL " "-DOPENCLROOT=${onnxruntime_DNNL_OPENCL_ROOT}")
endif()

if (onnxruntime_USE_DNNL)
set(DNNL_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/dnnl/src/dnnl/src)
set(DNNL_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/dnnl/install)
Expand All @@ -46,7 +54,7 @@ if (onnxruntime_USE_DNNL)
GIT_TAG ${DNNL_TAG}
# PATCH_COMMAND ${MKLDNN_PATCH_DISCARD_COMMAND} COMMAND ${DNNL_PATCH_COMMAND}
SOURCE_DIR ${DNNL_SOURCE}
CMAKE_ARGS -DDNNL_BUILD_TESTS=OFF -DDNNL_BUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${DNNL_INSTALL}
CMAKE_ARGS -DDNNL_BUILD_TESTS=OFF -DDNNL_BUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${DNNL_INSTALL} ${DNNL_GPU_CMAKE_ARGS}
)
link_directories(${DNNL_LIB_DIR})
endif()
2 changes: 1 addition & 1 deletion cmake/external/onnx_minimal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ endif()

set(ONNX_SOURCE_ROOT ${PROJECT_SOURCE_DIR}/external/onnx)

add_library(onnx_proto ${ONNX_SOURCE_ROOT}/onnx/onnx-ml.proto ${ONNX_SOURCE_ROOT}/onnx/onnx-operators-ml.proto)
add_library(onnx_proto ${ONNX_SOURCE_ROOT}/onnx/onnx-ml.proto ${ONNX_SOURCE_ROOT}/onnx/onnx-operators-ml.proto ${ONNX_SOURCE_ROOT}/onnx/onnx-data.proto)

target_include_directories(onnx_proto PUBLIC $<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_INCLUDE_DIRECTORIES> "${CMAKE_CURRENT_BINARY_DIR}")
target_compile_definitions(onnx_proto PUBLIC $<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_COMPILE_DEFINITIONS>)
Expand Down
1 change: 1 addition & 0 deletions cmake/onnxruntime_mlas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ set(mlas_common_srcs
${ONNXRUNTIME_ROOT}/core/mlas/lib/quantize.cpp
${ONNXRUNTIME_ROOT}/core/mlas/lib/qladd.cpp
${ONNXRUNTIME_ROOT}/core/mlas/lib/qlmul.cpp
${ONNXRUNTIME_ROOT}/core/mlas/lib/qpostprocessor.cpp
)

if(MSVC)
Expand Down
Loading