Skip to content

Commit

Permalink
ONNX Runtimeをv1.18.1に
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Aug 4, 2024
1 parent 66dfb37 commit a278c09
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 80 deletions.
181 changes: 106 additions & 75 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
env:
ONNXRUNTIME_VERSION:
|- # releaseタグ名か、workflow_dispatchでのバージョン名が入る。無指定なら適当なバージョン
${{ github.event.release.tag_name || github.event.inputs.version || '1.17.3' }}
${{ github.event.release.tag_name || github.event.inputs.version || '1.18.1' }}
RELEASE:
|- # releaseタグ名か、workflow_dispatchでのreleaseフラグがあればリリースする
${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}
Expand All @@ -32,94 +32,113 @@ jobs:
fail-fast: false
matrix:
include:
- artifact_name: onnxruntime-win-x64
#- artifact_name: onnxruntime-win-x64
# os: windows-2022
# build_opts: --cmake_extra_defines CMAKE_SYSTEM_NAME=Windows CMAKE_SYSTEM_PROCESSOR=x86_64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib
# result_dir: build/Release
# release_config: Release
- artifact_name: onnxruntime-win-x64-gpu
os: windows-2022
build_opts: --cmake_extra_defines CMAKE_SYSTEM_NAME=Windows CMAKE_SYSTEM_PROCESSOR=x86_64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib
cuda_version: 12.5.0
# Windowsの場合デフォルトのパッケージ群では不十分であるため、必要そうなパッケージを指定する。ただしいくつかは不要かもしれない
cuda_sub_packages: '["cudart", "cuobjdump", "nvcc", "nvdisasm", "thrust", "cublas_dev", "cufft_dev", "curand_dev", "cusolver_dev", "cusparse_dev", "visual_studio_integration"]'
cudnn_url: https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/windows-x86_64/cudnn-windows-x86_64-9.3.0.75_cuda12-archive.zip
build_opts: --cmake_extra_defines CMAKE_SYSTEM_NAME=Windows CMAKE_SYSTEM_PROCESSOR=x86_64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --skip_tests --use_dml --use_cuda --cuda_version 12.5
result_dir: build/Release
release_config: Release
- artifact_name: onnxruntime-win-x64-gpu
- artifact_name: onnxruntime-win-x64-cuda
os: windows-2022
cuda_version: 12.4.1
cuda_version: 12.5.0
# Windowsの場合デフォルトのパッケージ群では不十分であるため、必要そうなパッケージを指定する。ただしいくつかは不要かもしれない
cuda_sub_packages: '["cudart", "cuobjdump", "nvcc", "nvdisasm", "thrust", "cublas_dev", "cufft_dev", "curand_dev", "cusolver_dev", "cusparse_dev", "visual_studio_integration"]'
cudnn_url: https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/windows-x86_64/cudnn-windows-x86_64-8.9.7.29_cuda12-archive.zip
build_opts: --cmake_extra_defines CMAKE_SYSTEM_NAME=Windows CMAKE_SYSTEM_PROCESSOR=x86_64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --use_dml --use_cuda --cuda_version 12.4
cudnn_url: https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/windows-x86_64/cudnn-windows-x86_64-9.3.0.75_cuda12-archive.zip
build_opts: --cmake_extra_defines CMAKE_SYSTEM_NAME=Windows CMAKE_SYSTEM_PROCESSOR=x86_64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --skip_tests --use_cuda --cuda_version 12.5
result_dir: build/Release
release_config: Release
- artifact_name: onnxruntime-win-x86
- artifact_name: onnxruntime-win-x64-dml
os: windows-2022
build_opts: --x86 --cmake_extra_defines CMAKE_SYSTEM_NAME=Windows CMAKE_SYSTEM_PROCESSOR=x86 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib
build_opts: --cmake_extra_defines CMAKE_SYSTEM_NAME=Windows CMAKE_SYSTEM_PROCESSOR=x86_64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --skip_tests --use_dml
result_dir: build/Release
release_config: Release
- artifact_name: onnxruntime-linux-x64
os: ubuntu-20.04
build_opts: --cmake_extra_defines CMAKE_SYSTEM_NAME=Linux CMAKE_SYSTEM_PROCESSOR=x86_64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib
result_dir: build
release_config: Release
- artifact_name: onnxruntime-linux-x64-gpu
os: ubuntu-20.04
cuda_version: 12.4.1
cuda_sub_packages: "[]" # デフォルト
cudnn_url: https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz
build_opts: --cmake_extra_defines CMAKE_SYSTEM_NAME=Linux CMAKE_SYSTEM_PROCESSOR=x86_64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --use_cuda
result_dir: build
release_config: Release
- artifact_name: onnxruntime-linux-armhf
os: ubuntu-20.04
cc_version: "10"
cxx_version: "10"
linux_cross_arch: arm-linux-gnueabihf
symlink_workaround: true
build_opts: --arm --cmake_extra_defines CMAKE_SYSTEM_NAME=Linux CMAKE_SYSTEM_PROCESSOR=armv7l --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib
result_dir: build
release_config: Release
- artifact_name: onnxruntime-linux-arm64
os: ubuntu-20.04
cc_version: "10"
cxx_version: "10"
linux_cross_arch: aarch64-linux-gnu
symlink_workaround: true
build_opts: --arm64 --cmake_extra_defines CMAKE_SYSTEM_NAME=Linux CMAKE_SYSTEM_PROCESSOR=aarch64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib
result_dir: build
release_config: Release
#- artifact_name: onnxruntime-win-x86
# os: windows-2022
# build_opts: --x86 --cmake_extra_defines CMAKE_SYSTEM_NAME=Windows CMAKE_SYSTEM_PROCESSOR=x86 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib
# result_dir: build/Release
# release_config: Release
#- artifact_name: onnxruntime-linux-x64
# os: ubuntu-20.04
# build_opts: --cmake_extra_defines CMAKE_SYSTEM_NAME=Linux CMAKE_SYSTEM_PROCESSOR=x86_64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib
# result_dir: build
# release_config: Release
#- artifact_name: onnxruntime-linux-x64-gpu
# os: ubuntu-20.04
# cuda_version: 12.5.0
# cuda_sub_packages: "[]" # デフォルト
# cudnn_url: https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-9.3.0.75_cuda12-archive.tar.xz
# build_opts: --cmake_extra_defines CMAKE_SYSTEM_NAME=Linux CMAKE_SYSTEM_PROCESSOR=x86_64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --use_cuda
# result_dir: build
# release_config: Release
#- artifact_name: onnxruntime-linux-armhf
# os: ubuntu-20.04
# cc_version: "10"
# cxx_version: "10"
# linux_cross_arch: arm-linux-gnueabihf
# symlink_workaround: true
# build_opts: --arm --cmake_extra_defines CMAKE_SYSTEM_NAME=Linux CMAKE_SYSTEM_PROCESSOR=armv7l --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib
# result_dir: build
# release_config: Release
#- artifact_name: onnxruntime-linux-arm64
# os: ubuntu-20.04
# cc_version: "10"
# cxx_version: "10"
# linux_cross_arch: aarch64-linux-gnu
# symlink_workaround: true
# build_opts: --arm64 --cmake_extra_defines CMAKE_SYSTEM_NAME=Linux CMAKE_SYSTEM_PROCESSOR=aarch64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib
# result_dir: build
# release_config: Release
- artifact_name: onnxruntime-osx-arm64
os: macos-12
build_opts: --cmake_extra_defines CMAKE_SYSTEM_NAME=Darwin CMAKE_OSX_ARCHITECTURES=arm64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib
result_dir: build
release_config: Release
- artifact_name: onnxruntime-osx-x86_64
os: macos-12
build_opts: --cmake_extra_defines CMAKE_SYSTEM_NAME=Darwin CMAKE_OSX_ARCHITECTURES=x86_64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib
os: macos-14
build_opts: --osx_arch arm64 --cmake_generator Ninja --cmake_extra_defines CMAKE_SYSTEM_NAME=Darwin CMAKE_OSX_ARCHITECTURES=arm64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --use_binskim_compliant_compile_flags
result_dir: build
release_config: Release
- artifact_name: onnxruntime-android-x64
os: ubuntu-20.04
build_opts: --android_abi x86_64 --cmake_extra_defines CMAKE_SYSTEM_NAME=Android CMAKE_SYSTEM_PROCESSOR=x86_64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --android
- artifact_name: onnxruntime-osx-arm64-debug
os: macos-14
build_opts: --osx_arch arm64 --cmake_generator Ninja --cmake_extra_defines CMAKE_SYSTEM_NAME=Darwin CMAKE_OSX_ARCHITECTURES=arm64 --config Debug --parallel --compile_no_warning_as_error --update --build --build_shared_lib
result_dir: build
release_config: Release
- artifact_name: onnxruntime-android-arm64
os: ubuntu-20.04
build_opts: --android_abi arm64-v8a --cmake_extra_defines CMAKE_SYSTEM_NAME=Android CMAKE_SYSTEM_PROCESSOR=aarch64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --android
result_dir: build
release_config: Release
- artifact_name: onnxruntime-ios-arm64
os: macos-12
build_opts: --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --skip_tests --use_xcode --ios --apple_sysroot iphoneos --osx_arch arm64 --apple_deploy_target 16.0
build_opts_workaround_protoc: --path_to_protoc_exe /usr/local/opt/protobuf@21/bin/protoc
result_dir: build/Release
release_config: Release-iphoneos
- artifact_name: onnxruntime-ios-sim-arm64
os: macos-12
build_opts: --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --skip_tests --use_xcode --ios --apple_sysroot iphonesimulator --osx_arch arm64 --apple_deploy_target 16.0
build_opts_workaround_protoc: --path_to_protoc_exe /usr/local/opt/protobuf@21/bin/protoc
result_dir: build/Release
release_config: Release-iphonesimulator
- artifact_name: onnxruntime-ios-sim-x86_64
os: macos-12
build_opts: --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --skip_tests --use_xcode --ios --apple_sysroot iphonesimulator --osx_arch x86_64 --apple_deploy_target 16.0
build_opts_workaround_protoc: --path_to_protoc_exe /usr/local/opt/protobuf@21/bin/protoc
result_dir: build/Release
release_config: Release-iphonesimulator
release_config: Debug
#- artifact_name: onnxruntime-osx-x86_64
# os: macos-12
# build_opts: --cmake_extra_defines CMAKE_SYSTEM_NAME=Darwin CMAKE_OSX_ARCHITECTURES=x86_64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib
# result_dir: build
# release_config: Release
#- artifact_name: onnxruntime-android-x64
# os: ubuntu-20.04
# build_opts: --android_abi x86_64 --cmake_extra_defines CMAKE_SYSTEM_NAME=Android CMAKE_SYSTEM_PROCESSOR=x86_64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --android
# result_dir: build
# release_config: Release
#- artifact_name: onnxruntime-android-arm64
# os: ubuntu-20.04
# build_opts: --android_abi arm64-v8a --cmake_extra_defines CMAKE_SYSTEM_NAME=Android CMAKE_SYSTEM_PROCESSOR=aarch64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --android
# result_dir: build
# release_config: Release
#- artifact_name: onnxruntime-ios-arm64
# os: macos-12
# build_opts: --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --skip_tests --use_xcode --ios --apple_sysroot iphoneos --osx_arch arm64 --apple_deploy_target 16.0
# build_opts_workaround_protoc: --path_to_protoc_exe /usr/local/opt/protobuf@21/bin/protoc
# result_dir: build/Release
# release_config: Release-iphoneos
#- artifact_name: onnxruntime-ios-sim-arm64
# os: macos-12
# build_opts: --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --skip_tests --use_xcode --ios --apple_sysroot iphonesimulator --osx_arch arm64 --apple_deploy_target 16.0
# build_opts_workaround_protoc: --path_to_protoc_exe /usr/local/opt/protobuf@21/bin/protoc
# result_dir: build/Release
# release_config: Release-iphonesimulator
#- artifact_name: onnxruntime-ios-sim-x86_64
# os: macos-12
# build_opts: --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --skip_tests --use_xcode --ios --apple_sysroot iphonesimulator --osx_arch x86_64 --apple_deploy_target 16.0
# build_opts_workaround_protoc: --path_to_protoc_exe /usr/local/opt/protobuf@21/bin/protoc
# result_dir: build/Release
# release_config: Release-iphonesimulator

env:
# prefix usage: "", "arm-linux-gnueabihf-" => "gcc-8", "arm-linux-gnueabihf-gcc-8" (command name)
Expand Down Expand Up @@ -157,7 +176,7 @@ jobs:

- name: Apply patch
run: |
git apply --ignore-whitespace --reject --whitespace=fix --verbose ./builder/1_17_3_android_arm64_build.patch
git apply --ignore-whitespace --reject --whitespace=fix --verbose ./builder/1_18_1_android_arm64_build.patch
- name: Dump matrix context
env:
Expand Down Expand Up @@ -207,6 +226,10 @@ jobs:
# Workaround for protoc https://github.com/microsoft/onnxruntime/issues/16238#issuecomment-1590398821
brew install protobuf@21
- name: Install Ninja
if: steps.cache-build-result.outputs.cache-hit != 'true' && startsWith(matrix.artifact_name, 'onnxruntime-osx-arm64')
run: brew install ninja

# ONNX Runtime v1.16.1 requires CMake 3.27 or higher.
- name: Install CMake
if: steps.cache-build-result.outputs.cache-hit != 'true' && startsWith(matrix.os, 'ubuntu')
Expand Down Expand Up @@ -252,6 +275,14 @@ jobs:
echo "CUDNN_HOME=$cudnn_path" >> "$GITHUB_ENV"
#- name: Install DirectML
# if: steps.cache-build-result.outputs.cache-hit != 'true' && runner.os == 'Windows' && contains(matrix.build_opts, '--use_dml')
# run: |
# version=1.13.1
# curl -fO "https://api.nuget.org/v3-flatcontainer/microsoft.ai.directml/$version/microsoft.ai.directml.$version.nupkg"
# unzip "./microsoft.ai.directml.$version.nupkg" -d ./dml
# cygpath -wa ./dml/bin/x64-win >> "$GITHUB_PATH"

- name: Configure build environment for non-x86_64 Linux
if: steps.cache-build-result.outputs.cache-hit != 'true' && startsWith(matrix.os, 'ubuntu') && matrix.linux_cross_arch
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py
index 85583e11f5..3db1ee8b7b 100644
index 0d2ad51482..a343988d06 100644
--- a/tools/ci_build/build.py
+++ b/tools/ci_build/build.py
@@ -987,6 +987,8 @@ def generate_build_tree(
@@ -1000,6 +1000,8 @@ def generate_build_tree(
disable_optional_type = "optional" in types_to_disable
disable_sparse_tensors = "sparsetensor" in types_to_disable

Expand All @@ -11,12 +11,12 @@ index 85583e11f5..3db1ee8b7b 100644
cmake_args += [
"-Donnxruntime_RUN_ONNX_TESTS=" + ("ON" if args.enable_onnx_tests else "OFF"),
"-Donnxruntime_GENERATE_TEST_REPORTS=ON",
@@ -1571,7 +1573,7 @@ def generate_build_tree(
@@ -1631,7 +1633,7 @@ def generate_build_tree(
"-pipe",
"-ggdb3",
]
- if is_linux() and platform.machine() == "x86_64":
+ if is_linux() and is_x86_64_build:
# The following flags needs GCC 8 and newer
cflags += ["-fstack-clash-protection", "-fcf-protection"]
cxxflags = cflags.copy()
cflags += ["-fstack-clash-protection"]
if not args.rv64:

0 comments on commit a278c09

Please sign in to comment.