Skip to content

Commit

Permalink
Merge branch 'main' into tlwu/fix_transformers_issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tianleiwu committed Aug 17, 2023
2 parents f044b14 + df124c9 commit 8fd4e60
Show file tree
Hide file tree
Showing 598 changed files with 26,203 additions and 12,543 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: github/issue-labeler@v2.5
- uses: github/issue-labeler@v3.2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
sudo mv apidocs/docs/api/python _site/docs/api
- name: Upload site
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v2
with:
retention-days: 21

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Build code
env:
CAExcludePath: 'C:\Program Files;D:\b;${{ github.workspace }}\cmake'
run: python tools\ci_build\build.py --enable_training --build_java --compile_no_warning_as_error --config Debug --build_dir D:\b --skip_submodule_sync --build_csharp --update --build --parallel --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_pybind --cmake_extra_defines onnxruntime_USE_CUSTOM_STATIC_ANALYSIS_RULES=ON --cmake_extra_defines onnxruntime_ENABLE_STATIC_ANALYSIS=ON --cmake_extra_defines onnxruntime_REDIRECT_STATIC_ANALYSIS_OUTPUTS_TO_FILE=ON --use_cuda --cuda_home=${{ github.workspace }}\cuda_sdk\v11.8 --enable_cuda_profiling --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=75
run: python tools\ci_build\build.py --windows_sdk_version 10.0.22621.0 --enable_training --build_java --compile_no_warning_as_error --config Debug --build_dir D:\b --skip_submodule_sync --build_csharp --update --build --parallel --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_pybind --cmake_extra_defines onnxruntime_USE_CUSTOM_STATIC_ANALYSIS_RULES=ON --cmake_extra_defines onnxruntime_ENABLE_STATIC_ANALYSIS=ON --cmake_extra_defines onnxruntime_REDIRECT_STATIC_ANALYSIS_OUTPUTS_TO_FILE=ON --use_cuda --cuda_home=${{ github.workspace }}\cuda_sdk\v11.8 --enable_cuda_profiling --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=75

- name: Generate sarif
working-directory: D:\b
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
- name: Build code
env:
CAExcludePath: 'C:\Program Files;D:\b;${{ github.workspace }}\cmake'
run: python tools\ci_build\build.py --enable_training --build_java --compile_no_warning_as_error --config Debug --build_dir D:\b --skip_submodule_sync --build_csharp --update --build --parallel --cmake_generator "Visual Studio 17 2022" --build_shared_lib --cmake_extra_defines onnxruntime_USE_CUSTOM_STATIC_ANALYSIS_RULES=ON --cmake_extra_defines onnxruntime_ENABLE_STATIC_ANALYSIS=ON --cmake_extra_defines onnxruntime_REDIRECT_STATIC_ANALYSIS_OUTPUTS_TO_FILE=ON --ms_experimental --use_dml --use_winml --disable_rtti --enable_wcos --build_shared_lib
run: python tools\ci_build\build.py --build_java --compile_no_warning_as_error --config Debug --build_dir D:\b --skip_submodule_sync --build_csharp --update --build --parallel --cmake_generator "Visual Studio 17 2022" --build_shared_lib --cmake_extra_defines onnxruntime_USE_CUSTOM_STATIC_ANALYSIS_RULES=ON --cmake_extra_defines onnxruntime_ENABLE_STATIC_ANALYSIS=ON --cmake_extra_defines onnxruntime_REDIRECT_STATIC_ANALYSIS_OUTPUTS_TO_FILE=ON --ms_experimental --use_dml --use_winml --disable_rtti --enable_wcos --build_shared_lib

- name: Generate sarif
working-directory: D:\b
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
- name: Build code
env:
CAExcludePath: 'C:\Program Files;D:\b;${{ github.workspace }}\cmake'
run: python tools\ci_build\build.py --enable_training --compile_no_warning_as_error --config Debug --build_dir D:\b --skip_submodule_sync --build_csharp --update --build --parallel --cmake_generator "Visual Studio 17 2022" --build_shared_lib --cmake_extra_defines onnxruntime_USE_CUSTOM_STATIC_ANALYSIS_RULES=ON --cmake_extra_defines onnxruntime_ENABLE_STATIC_ANALYSIS=ON --cmake_extra_defines onnxruntime_REDIRECT_STATIC_ANALYSIS_OUTPUTS_TO_FILE=ON --ms_experimental --use_dml --use_winml --disable_rtti --enable_wcos --build_shared_lib
run: python tools\ci_build\build.py --compile_no_warning_as_error --config Debug --build_dir D:\b --skip_submodule_sync --build_csharp --update --build --parallel --cmake_generator "Visual Studio 17 2022" --build_shared_lib --cmake_extra_defines onnxruntime_USE_CUSTOM_STATIC_ANALYSIS_RULES=ON --cmake_extra_defines onnxruntime_ENABLE_STATIC_ANALYSIS=ON --cmake_extra_defines onnxruntime_REDIRECT_STATIC_ANALYSIS_OUTPUTS_TO_FILE=ON --ms_experimental --use_dml --use_winml --disable_rtti --enable_wcos --build_shared_lib

- name: Generate sarif
working-directory: D:\b
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[submodule "cmake/external/emsdk"]
path = cmake/external/emsdk
url = https://github.com/emscripten-core/emsdk.git
branch = 3.1.37
branch = 3.1.44
[submodule "cmake/external/onnxruntime-extensions"]
path = cmake/external/onnxruntime-extensions
url = https://github.com/microsoft/onnxruntime-extensions.git
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@
"-build/include_subdir",
"-runtime/references"
]
}
4 changes: 4 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
:: Licensed under the MIT License.

@echo off

setlocal
set PATH=C:\Program Files\Git\usr\bin;%PATH%

rem Requires a Python install to be available in your PATH
python "%~dp0\tools\ci_build\build.py" --build_dir "%~dp0\build\Windows" %*
14 changes: 2 additions & 12 deletions cgmanifests/generated/cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"component": {
"type": "git",
"git": {
"commitHash": "b113f24842c6e97fe3e352084db09a6e278593ae",
"commitHash": "a896e3d066448b3530dbcaa48869fafefd738f57",
"repositoryUrl": "https://github.com/emscripten-core/emsdk.git"
},
"comments": "git submodule at cmake/external/emsdk"
Expand All @@ -102,22 +102,12 @@
"component": {
"type": "git",
"git": {
"commitHash": "a0d77f18516d2da7468a96b0de3b737266f23176",
"commitHash": "e2525550194ce3d8a2c4a3af451c9d9b3ae6650e",
"repositoryUrl": "https://github.com/onnx/onnx.git"
},
"comments": "git submodule at cmake/external/onnx"
}
},
{
"component": {
"type": "git",
"git": {
"commitHash": "81e7799c69044c745239202085eb0a98f102937b",
"repositoryUrl": "https://github.com/microsoft/onnxruntime-extensions.git"
},
"comments": "git submodule at cmake/external/onnxruntime-extensions"
}
},
{
"component": {
"type": "git",
Expand Down
43 changes: 25 additions & 18 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
# Licensed under the MIT License.

# Minimum CMake required
if(WIN32)
# TODO: actually we need cmake 3.26+ on Windows but QNN EP's build machine doesn't have it
cmake_minimum_required(VERSION 3.25)
else()
cmake_minimum_required(VERSION 3.26)
endif()
cmake_minimum_required(VERSION 3.26)

cmake_policy(SET CMP0069 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
Expand All @@ -19,13 +14,7 @@ cmake_policy(SET CMP0117 NEW)
cmake_policy(SET CMP0104 OLD)

# Enable Hot Reload for MSVC compilers if supported.
if (POLICY CMP0141)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.26.0")
cmake_policy(SET CMP0141 NEW)
else()
cmake_policy(SET CMP0141 OLD)
endif()
endif()
cmake_policy(SET CMP0141 NEW)

# Project
project(onnxruntime C CXX ASM)
Expand Down Expand Up @@ -257,15 +246,21 @@ option(onnxruntime_USE_LOCK_FREE_QUEUE "Build with lock-free task queue for thre
# Some features are only enabled when onnxruntime_ENABLE_PYTHON is ON as they are only relevant
# when using python env
if (onnxruntime_ENABLE_TRAINING)
set(onnxruntime_ENABLE_TRAINING_OPS ON)
set(onnxruntime_ENABLE_TRAINING_APIS ON)
set(onnxruntime_ENABLE_TRAINING_TORCH_INTEROP ON)
set(onnxruntime_ENABLE_TRAINING_OPS ON)
set(onnxruntime_ENABLE_ATEN ON)
set(onnxruntime_ENABLE_TRITON ON)
if (NOT APPLE)
set(onnxruntime_ENABLE_TRAINING_TORCH_INTEROP ON)
endif()
endif()

if (onnxruntime_ENABLE_TRAINING_APIS)
set(onnxruntime_ENABLE_TRAINING_OPS ON)
if (onnxruntime_ENABLE_PYTHON AND NOT onnxruntime_ENABLE_TRAINING)
message(FATAL_ERROR "Standalone On-Device Training build is not supported with Python bindings! "
"Please use the --enable_training flag instead of the --enable_training_apis flag.")
endif()
endif()

if (onnxruntime_USE_CUDA)
Expand Down Expand Up @@ -306,7 +301,15 @@ if (onnxruntime_USE_ROCM)
add_compile_options("$<$<COMPILE_LANGUAGE:HIP>:SHELL:-x hip>")

if (NOT onnxruntime_HIPIFY_PERL)
set(onnxruntime_HIPIFY_PERL ${onnxruntime_ROCM_HOME}/hip/bin/hipify-perl)
find_path(HIPIFY_PERL_PATH
NAMES hipify-perl
HINTS
${onnxruntime_ROCM_HOME}/bin
${onnxruntime_ROCM_HOME}/hip/bin)
if (HIPIFY_PERL_PATH-NOTFOUND)
MESSAGE(FATAL_ERROR "hipify-perl not found")
endif()
set(onnxruntime_HIPIFY_PERL ${HIPIFY_PERL_PATH}/hipify-perl)
endif()

# replicate strategy used by pytorch to get ROCM_VERSION
Expand Down Expand Up @@ -1230,9 +1233,12 @@ if (onnxruntime_USE_OPENVINO)
elseif ($ENV{INTEL_OPENVINO_DIR} MATCHES "2023.0")
set(OPENVINO_VERSION "2023.0")
add_definitions(-DOPENVINO_2023_0=1)
elseif ($ENV{INTEL_OPENVINO_DIR} MATCHES "2023.1")
set(OPENVINO_VERSION "2023.1")
add_definitions(-DOPENVINO_2023_1=1)
elseif ($ENV{INTEL_OPENVINO_DIR} MATCHES "openvino")
set(OPENVINO_VERSION "2023.0")
add_definitions(-DOPENVINO_2023_0=1)
set(OPENVINO_VERSION "2023.1")
add_definitions(-DOPENVINO_2023_1=1)
else()
message(FATAL_ERROR "Unsupported OpenVINO version: ${INTEL_OPENVINO_DIR}")
endif()
Expand Down Expand Up @@ -1480,6 +1486,7 @@ if (UNIX AND onnxruntime_USE_MPI)
find_path(NCCL_INCLUDE_DIR
NAMES ${NCCL_LIBNAME}.h
HINTS
${onnxruntime_NCCL_HOME}/include/rccl
${onnxruntime_NCCL_HOME}/include
$ENV{CUDA_ROOT}/include)

Expand Down
23 changes: 5 additions & 18 deletions cmake/adjust_global_compile_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -220,33 +220,20 @@ endmacro()
#Set global compile flags for all the source code(including third_party code like protobuf)
#This section must be before any add_subdirectory, otherwise build may fail because /MD,/MT mismatch
if (MSVC)
if (CMAKE_GENERATOR_PLATFORM)
if (CMAKE_VS_PLATFORM_NAME)
# Multi-platform generator
set(onnxruntime_target_platform ${CMAKE_GENERATOR_PLATFORM})
set(onnxruntime_target_platform ${CMAKE_VS_PLATFORM_NAME})
else()
set(onnxruntime_target_platform ${CMAKE_SYSTEM_PROCESSOR})
endif()
if (onnxruntime_target_platform STREQUAL "ARM64")
set(onnxruntime_target_platform "ARM64")
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.26.0")
enable_language(ASM_MARMASM)
else()
enable_language(ASM_MASM)
endif()
enable_language(ASM_MARMASM)
elseif (onnxruntime_target_platform STREQUAL "ARM64EC")
set(onnxruntime_target_platform "ARM64EC")
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.26.0")
enable_language(ASM_MARMASM)
else()
enable_language(ASM_MASM)
endif()
enable_language(ASM_MARMASM)
elseif (onnxruntime_target_platform STREQUAL "ARM" OR CMAKE_GENERATOR MATCHES "ARM")
set(onnxruntime_target_platform "ARM")
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.26.0")
enable_language(ASM_MARMASM)
else()
enable_language(ASM_MASM)
endif()
enable_language(ASM_MARMASM)
elseif (onnxruntime_target_platform STREQUAL "x64" OR onnxruntime_target_platform STREQUAL "x86_64" OR onnxruntime_target_platform STREQUAL "AMD64" OR CMAKE_GENERATOR MATCHES "Win64")
set(onnxruntime_target_platform "x64")
enable_language(ASM_MASM)
Expand Down
8 changes: 4 additions & 4 deletions cmake/deps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ microsoft_gsl;https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.zip;cf36
microsoft_wil;https://github.com/microsoft/wil/archive/5f4caba4e7a9017816e47becdd918fcc872039ba.zip;fd119887d0d17c37adf1fc227b054befa28158ad
mimalloc;https://github.com/microsoft/mimalloc/archive/refs/tags/v2.1.1.zip;d5ee7d34223d0567892db5179849939c8769dc41
mp11;https://github.com/boostorg/mp11/archive/refs/tags/boost-1.79.0.zip;c8f04e378535ededbe5af52c8f969d2dedbe73d5
onnx;https://github.com/onnx/onnx/archive/refs/tags/v1.14.0.zip;3c6e43a36f94addc15afe939860127a1d74a9488
#use the last commit of 8.6-GA branch (https://github.com/onnx/onnx-tensorrt/commit/6ba67d3428e05f690145373ca87fb8d32f98df45)
onnx_tensorrt;https://github.com/onnx/onnx-tensorrt/archive/6ba67d3428e05f690145373ca87fb8d32f98df45.zip;805902b4f03f09f07151e03b5ccc49968c9cc896
onnx;https://github.com/onnx/onnx/archive/e2525550194ce3d8a2c4a3af451c9d9b3ae6650e.zip;782f23d788185887f520a90535513e244218e928
#use the commit of supporting all the plugins and TRT 8.6-GA (https://github.com/onnx/onnx-tensorrt/commit/0462dc31ae78f48744b6141ae376df1f96d3f459)
onnx_tensorrt;https://github.com/onnx/onnx-tensorrt/archive/0462dc31ae78f48744b6141ae376df1f96d3f459.zip;5ff086361956cceb81ed17453a1fd8db2aa4328d
protobuf;https://github.com/protocolbuffers/protobuf/archive/refs/tags/v21.12.zip;7cf2733949036c7d52fda017badcab093fe73bfa
protoc_win64;https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-win64.zip;b4521f7ada5b260380f94c4bd7f1b7684c76969a
protoc_win32;https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-win32.zip;3688010318192c46ce73213cdfb6b3e5656da874
Expand All @@ -42,4 +42,4 @@ safeint;https://github.com/dcleblanc/SafeInt/archive/ff15c6ada150a5018c5ef217240
tensorboard;https://github.com/tensorflow/tensorboard/archive/373eb09e4c5d2b3cc2493f0949dc4be6b6a45e81.zip;67b833913605a4f3f499894ab11528a702c2b381
cutlass;https://github.com/NVIDIA/cutlass/archive/refs/tags/v3.0.0.zip;0f95b3c1fc1bd1175c4a90b2c9e39074d1bccefd
extensions;https://github.com/microsoft/onnxruntime-extensions/archive/94142d8391c9791ec71c38336436319a2d4ac7a0.zip;4365ac5140338b4cb75a39944a4be276e3829b3c
eigen;https://gitlab.com/libeigen/eigen/-/archive/3.4/eigen-3.4.zip;ee201b07085203ea7bd8eb97cbcb31b07cfa3efb
eigen;https://gitlab.com/libeigen/eigen/-/archive/3.4/eigen-3.4.zip;ee201b07085203ea7bd8eb97cbcb31b07cfa3efb
Loading

0 comments on commit 8fd4e60

Please sign in to comment.