From 32f302aafdd78ea01a67ec57f251964e084be24f Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Sat, 27 Jul 2024 04:57:31 +0900 Subject: [PATCH 1/2] =?UTF-8?q?add:=20`onnxruntime-win-x64-gpu-without-cud?= =?UTF-8?q?a`=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 132 +++++++++++++++++++++++++++++++++++- 1 file changed, 130 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6dfed5b..9c266fc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,6 +39,11 @@ 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-without-cuda + 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-x64-gpu os: windows-2022 cuda_version: 12.4.1 @@ -340,10 +345,55 @@ jobs: path: artifact/* - name: Generate RELEASE_NAME - if: env.RELEASE == 'true' run: | echo "RELEASE_NAME=${{ matrix.artifact_name }}-${{ env.ONNXRUNTIME_VERSION }}" >> $GITHUB_ENV + - name: Generate specifications + run: | + build_opts=(${{ matrix.build_opts }}) + + for arg in "${build_opts[@]}"; do + case "$arg" in + CMAKE_SYSTEM_NAME=Windows) os=Windows ;; + CMAKE_SYSTEM_NAME=Linux) os=Linux ;; + CMAKE_SYSTEM_NAME=Darwin) os=macOS ;; + --android) os=Android ;; + --ios) os=iOS ;; + + CMAKE_SYSTEM_PROCESSOR=x86_64 | CMAKE_OSX_ARCHITECTURES=x86_64 | x86_64) arch=x86_64 ;; + --x86) arch=x86 ;; + CMAKE_OSX_ARCHITECTURES=arm64 | --arm64 | arm64 | arm64-v8a) arch=AArch64 ;; + --arm) arch=ARMv7 ;; + + --use_cuda) use_cuda=1 ;; + --use_dml) use_dml=1 ;; + esac + done + + # ONNX Runtimeが示す順番に従う + if [ "$use_cuda" = 1 ]; then + devices=/CUDA + fi + if [ "$use_dml" = 1 ]; then + devices+=/DirectML + fi + devices+=/CPU + devices=${devices:1} + + specs="" + specs+="$os" + specs+="$arch" + specs+="$devices" + specs+="$RELEASE_NAME.tgz" + specs+='' + cat <<< "$specs" > "$RELEASE_NAME.html" + + - name: Upload specifications + uses: actions/upload-artifact@v4 + with: + name: specs-${{ matrix.artifact_name }} + path: ${{ env.RELEASE_NAME }}.html + - name: Rearchive artifact if: env.RELEASE == 'true' run: | @@ -361,10 +411,15 @@ jobs: build-xcframework: needs: build-onnxruntime runs-on: macos-12 + outputs: + release-name: ${{ steps.gen-envs.outputs.release-name }} steps: - name: Generate RELEASE_NAME and ONNXRUNTIME_BASENAME + id: gen-envs run: | - echo "RELEASE_NAME=onnxruntime-ios-xcframework-${{ env.ONNXRUNTIME_VERSION }}" >> $GITHUB_ENV + RELEASE_NAME=onnxruntime-ios-xcframework-${{ env.ONNXRUNTIME_VERSION }} + echo "release-name=$RELEASE_NAME" >> "$GITHUB_OUTPUT" + echo "RELEASE_NAME=$RELEASE_NAME" >> "$GITHUB_ENV" echo "ONNXRUNTIME_BASENAME=libonnxruntime.${{ env.ONNXRUNTIME_VERSION }}.dylib" >> "$GITHUB_ENV" - uses: actions/checkout@v3 @@ -442,3 +497,76 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ env.ONNXRUNTIME_VERSION }} # ==> github.event.release.tag_name file: ${{ env.RELEASE_NAME }}.zip + + build-spec-table: + needs: [build-onnxruntime, build-xcframework] + runs-on: ubuntu-22.04 + steps: + - name: Download specifications + uses: actions/download-artifact@v4 + with: + path: specs + pattern: specs-* + merge-multiple: true + + - name: Construct release notes + run: | + onnxruntime_version_hyphenated=$(tr . - <<< "$ONNXRUNTIME_VERSION") + release_notes=$( + cat < + + + OS + アーキテクチャ + デバイス + 名前 + + + + EOF + ) + release_notes+=$'\n' + for body in specs/*.html; do + release_notes+=$' ' + release_notes+=$(< "$body") + release_notes+=$'\n' + done + release_notes+=$( + cat < + + + ## XCFramework + + + + + + + + + + + + + + + + + + +
OSアーキテクチャデバイス名前
iOSAArch64/x86_64CPU${{ needs.build-xcframework.outputs.release-name }}.zip
+ EOF + ) + tee release-notes.md >&2 <<< "$release_notes" + + - name: Update release notes + if: env.RELEASE == 'true' + uses: softprops/action-gh-release@v2 + with: + body_path: release-notes.md + prerelease: true + tag_name: ${{ env.ONNXRUNTIME_VERSION }} From 8806892a3c50ba2f2e926798632750aa8f144edf Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Mon, 5 Aug 2024 03:06:24 +0900 Subject: [PATCH 2/2] [skip ci] `onnxruntime-win-x64-gpu-cuda` Co-authored-by: Hiroshiba --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad4f55d..0c83d03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ 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-without-cuda + - artifact_name: onnxruntime-win-x64-gpu-cuda 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