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 15, 2024
1 parent 66dfb37 commit 12a9044
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 94 deletions.
1 change: 1 addition & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
jobs:
actionlint:
runs-on: ubuntu-22.04
if: false

steps:
- name: Checkout
Expand Down
217 changes: 128 additions & 89 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,104 @@ jobs:
fail-fast: false
matrix:
include:
- 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
cuda_version: 12.4.1
# 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
result_dir: build/Release
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.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-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-cuda
# os: windows-2022
# 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_cuda --cuda_version 12.5
# result_dir: build/Release
# release_config: Release
#- artifact_name: onnxruntime-win-x64-dml
# 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 --skip_tests --use_dml
# result_dir: build/Release
# 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
os: macos-14
build_opts: --osx_arch arm64 --cmake_extra_defines CMAKE_SYSTEM_NAME=Darwin 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-debug
os: macos-14
build_opts: --osx_arch arm64 --cmake_extra_defines CMAKE_SYSTEM_NAME=Darwin CMAKE_SYSTEM_PROCESSOR=aarch64 --config Debug --parallel --compile_no_warning_as_error --update --build --build_shared_lib
result_dir: build
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
build_opts: --osx_arch x86_64 --cmake_extra_defines CMAKE_SYSTEM_NAME=Darwin --config Release --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
#- 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 @@ -150,26 +160,43 @@ jobs:
repository: microsoft/onnxruntime
submodules: true
ref: v${{ env.ONNXRUNTIME_VERSION }}
#ref: b8c90beef2b1c9d9297365a9a8f49bb779c84147 # 2024-04-19+09:00 : windows: error, macos: error
#ref: 80f274ca6f2f4572d827edd6dc7f736d7a8c036a # 2024-01-17+09:00 : windows: ? , macos: ok
#ref: 19ff4a6d6c420d4d43c92d57ff45313f00b49336 # 2024-03-21+09:00 : windows: ? , macos: error
#ref: 1508c2ee39023274417417b290303cf058ceedd6 # 2024-02-15+09:00 : windows: ? , macos: ok
#ref: 2a857d9a86ca3049829256df3347521069ccd6b4 # 2024-03-01+09:00 : windows: ? , macos: ok
#ref: efad5bbc5aed1717200d3e8f6ddd253394af4b99 # 2024-03-10+09:00 : windows: ok , macos: error
#ref: e93a860819545ea64acfe36e19e2b954389d48bf # 2024-03-06+09:00 : windows: ? , macos: error
#ref: a0521f899e9d495d57ae044bd4a1fe4d17155782 # 2024-03-02+09:00 : windows: ? , macos: error
#ref: f06164ef8b8de42dd67ca2137f6996cdc87a3f72 # 2024-03-02+09:00 : windows: ok , macos: ok
#ref: e1e292f94c4f125bfd95703961f32718a032f921 # 2024-04-01+09:00 : windows: ok , macos: error
#ref: e4c0cb2b9a0dde05c066556aa73bf6ffdfa8013d # 2024-04-19+09:00 : windows: error, macos: ?
#ref: 50bd4571ace1b9b78a832015e75677f1b31ede8b # 2024-04-12+09:00 : windows: ok , macos: ?
#ref: 01acc25d9dd695255ae5c44ec377576408e1081c # 2024-04-13+09:00 : windows: ok , macos: ?
#ref: 6bd6d879a351e2ed4df84357f826d3df60539f34 # 2024-04-19+09:00 : windows: ok , macos: ?
#ref: f664f912980ac7adce2cf3ecaade6a70cfb97401 # 2024-04-19+09:00 : windows: error, macos: ?
#ref: 76434907fb7d9dc6ae5debc225959b666eb409f7 # 2024-04-19+09:00 : windows: error, macos: ?
#ref: c47f446f25cf4dc97931f9e3326cf0d3545ed02b # 2024-04-18+09:00 : windows: ok , macos: ?
- name: Checkout builder
uses: actions/checkout@v4
with:
path: builder

- 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:
MATRIX_CONTEXT: ${{ toJSON(matrix) }}
run: echo "$MATRIX_CONTEXT" > matrix.json

- name: Cache build result
id: cache-build-result
uses: actions/cache@v3
with:
path: build/
key: ${{ matrix.artifact_name }}-v${{ env.ONNXRUNTIME_VERSION }}-cache-${{ hashFiles('matrix.json') }}
#- name: Cache build result
# id: cache-build-result
# uses: actions/cache@v3
# with:
# path: build/
# key: ${{ matrix.artifact_name }}-v${{ env.ONNXRUNTIME_VERSION }}-cache-${{ hashFiles('matrix.json') }}

- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
Expand Down Expand Up @@ -207,6 +234,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 +283,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 12a9044

Please sign in to comment.