From e683e268e40656556eb34574abfc36da9ac779e0 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Sat, 3 Aug 2024 17:21:10 +0900 Subject: [PATCH] =?UTF-8?q?ONNX=20Runtime=E3=82=92v1.18.1=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 30 +++++++++++-------- ....patch => 1_18_1_android_arm64_build.patch | 10 +++---- 2 files changed, 23 insertions(+), 17 deletions(-) rename 1_17_3_android_arm64_build.patch => 1_18_1_android_arm64_build.patch (76%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cd06c8f..a7c5bc2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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' }} @@ -37,13 +37,19 @@ jobs: 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 + # CUDAとDirectMLを両方有効化したビルドは作らない (v1.18.1時点でビルドが何故かできないのと、あっても多分あまり嬉しくないため) + - 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 --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 --use_dml result_dir: build/Release release_config: Release - artifact_name: onnxruntime-win-x86 @@ -58,9 +64,9 @@ jobs: release_config: Release - artifact_name: onnxruntime-linux-x64-gpu os: ubuntu-20.04 - cuda_version: 12.4.1 + 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-8.9.7.29_cuda12-archive.tar.xz + 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 @@ -84,12 +90,12 @@ jobs: 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 + 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-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 + 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-x64 @@ -157,7 +163,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: @@ -361,9 +367,9 @@ jobs: --android) os=Android ;; --ios) os=iOS ;; - CMAKE_SYSTEM_PROCESSOR=x86_64 | CMAKE_OSX_ARCHITECTURES=x86_64 | x86_64) arch=x86_64 ;; + CMAKE_SYSTEM_PROCESSOR=x86_64 | x86_64) arch=x86_64 ;; --x86) arch=x86 ;; - CMAKE_OSX_ARCHITECTURES=arm64 | --arm64 | arm64 | arm64-v8a) arch=AArch64 ;; + --arm64 | arm64 | arm64-v8a) arch=AArch64 ;; --arm) arch=ARMv7 ;; --use_cuda) use_cuda=1 ;; diff --git a/1_17_3_android_arm64_build.patch b/1_18_1_android_arm64_build.patch similarity index 76% rename from 1_17_3_android_arm64_build.patch rename to 1_18_1_android_arm64_build.patch index dc92a86..ec7da34 100644 --- a/1_17_3_android_arm64_build.patch +++ b/1_18_1_android_arm64_build.patch @@ -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 @@ -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: