From cf19a6f54dce3262bbbac97f4ac0e79afdc29120 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 13:29:43 -0700 Subject: [PATCH 01/42] update --- .github/workflows/windows.yml | 77 +++++++++++++++++++++++------------ 1 file changed, 50 insertions(+), 27 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 593ca85e8ea4b..e1cee85fe58c1 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,44 +1,67 @@ -name: Windows_CI +name: build_x64_asan + on: + workflow_dispatch: # Allow manual triggering push: branches: - main - - rel-* + - snnn/es + - 'rel-*' # Trigger on releases branches pull_request: + branches: + - main concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -env: - AZCOPY_AUTO_LOGIN_TYPE: MSI - AZCOPY_MSI_CLIENT_ID: 63b63039-6328-442f-954b-5a64d124e5b4 - jobs: - Windows-CUDA-12: - runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + build_x64_asan: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] # Use the specified self-hosted runner + timeout-minutes: 300 + steps: - - uses: actions/checkout@v4 - with: - submodules: false - - uses: actions/setup-python@v5 - with: - python-version: '3.11.x' - architecture: 'x64' + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x64 + + - name: Locate vcvarsall via vswhere + id: locate-vcvarsall + shell: cmd + run: | + @echo off + set vswherepath="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" + for /f "usebackq delims=" %%i in (`%vswherepath% -latest -property installationPath`) do ( + if exist "%%i\VC\Auxiliary\Build\vcvars64.bat" ( + set vcvarsall="%%i\VC\Auxiliary\Build\vcvars64.bat" + ) + ) - - uses: actions/setup-node@v4 - with: - node-version: 18 + echo "vcvarsall will be used as the VC compiler: %vcvarsall%" + echo "vcvarsall=%vcvarsall%" >> $GITHUB_ENV - - name: Download cuda - run: azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v12.2" cuda_sdk + - name: Build and Test (Combined) + shell: cmd # Use cmd for the initial environment setup + run: | + @echo off + call "%vcvarsall%" + REM Create build directory. Important to do this *before* changing directory. + if not exist "%GITHUB_WORKSPACE%\build" mkdir "%GITHUB_WORKSPACE%\build" + cd "%GITHUB_WORKSPACE%\build" - - name: Delete build folder - run: | - if (Test-Path D:\b) { Remove-Item -Recurse -Force D:\b } + REM Install Python modules *after* setting up the VC environment + python -m pip install -r "%GITHUB_WORKSPACE%\tools\ci_build\github\windows\python\requirements.txt" + REM Execute the build script, also within the VC environment. + python "%GITHUB_WORKSPACE%\tools\ci_build\build.py" --config Debug --build_dir "%GITHUB_WORKSPACE%\build" --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer - # The build machine doesn't have a GPU. So the value of CMAKE_CUDA_ARCHITECTURES doesn't matter. - - name: Build code - run: python tools\ci_build\build.py --windows_sdk_version 10.0.22621.0 --enable_training --build_java --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 --use_cuda --cuda_home=${{ github.workspace }}\cuda_sdk\v12.2 --enable_cuda_profiling --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=75 \ No newline at end of file + env: + vcvarsall: ${{ env.vcvarsall }} # Pass vcvarsall path to this combined step \ No newline at end of file From 53b8e0f0d2236b293a9bcbfef60d3f0e71f4cc00 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 13:33:27 -0700 Subject: [PATCH 02/42] update --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e1cee85fe58c1..033d1907c26e9 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -5,7 +5,7 @@ on: push: branches: - main - - snnn/es + - snnn/es1 - 'rel-*' # Trigger on releases branches pull_request: branches: From a30afb0e2b941509a87b08dd534b96aba02317f7 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 13:58:39 -0700 Subject: [PATCH 03/42] update --- .../locate-vcvarsall-and-setup-env/action.yml | 73 +++++++++++++++++++ .github/workflows/build_x64_asan.yml | 43 +++++++++++ .github/workflows/build_x86_asan.yml | 43 +++++++++++ 3 files changed, 159 insertions(+) create mode 100644 .github/actions/locate-vcvarsall-and-setup-env/action.yml create mode 100644 .github/workflows/build_x64_asan.yml create mode 100644 .github/workflows/build_x86_asan.yml diff --git a/.github/actions/locate-vcvarsall-and-setup-env/action.yml b/.github/actions/locate-vcvarsall-and-setup-env/action.yml new file mode 100644 index 0000000000000..cc586b4b8e1d3 --- /dev/null +++ b/.github/actions/locate-vcvarsall-and-setup-env/action.yml @@ -0,0 +1,73 @@ +name: 'Locate vcvarsall and Setup Environment' +description: 'Locates vcvarsall.bat, sets up the environment, and handles PATH updates.' +inputs: + architecture: + description: 'Target architecture (x64 or x86)' + required: true + default: 'x64' #It is better to make it required. +runs: + using: "composite" + steps: + - name: Locate vcvarsall and update environment + id: locate-vcvarsall + shell: cmd + run: | + @echo off + set vswherepath="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" + set vcvarsall_arch=${{ inputs.architecture }} + if "%vcvarsall_arch%" == "x86" ( + set vcvarsall_arch=x86 + ) else ( + set vcvarsall_arch=x64 + ) + + for /f "usebackq delims=" %%i in (`"%vswherepath%" -latest -property installationPath`) do ( + if exist "%%i\VC\Auxiliary\Build\vcvars%vcvarsall_arch%.bat" ( + set "vcvarsall=%%i\VC\Auxiliary\Build\vcvars%vcvarsall_arch%.bat" + ) + ) + + echo "vcvarsall will be used as the VC compiler: %vcvarsall%" + echo "::save-state name=vcvarsall::%vcvarsall%" + + REM Get initial environment variables + set > initial_env.txt + + REM Call vcvarsall.bat + call "%vcvarsall%" + + REM Get environment variables after calling vcvarsall.bat + set > final_env.txt + + REM Find new or modified environment variables using Python + python - < Date: Tue, 11 Mar 2025 13:58:48 -0700 Subject: [PATCH 04/42] update --- .github/workflows/windows.yml | 67 ----------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index 033d1907c26e9..0000000000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: build_x64_asan - -on: - workflow_dispatch: # Allow manual triggering - push: - branches: - - main - - snnn/es1 - - 'rel-*' # Trigger on releases branches - pull_request: - branches: - - main - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build_x64_asan: - runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] # Use the specified self-hosted runner - timeout-minutes: 300 - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: false - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.12' - architecture: x64 - - - name: Locate vcvarsall via vswhere - id: locate-vcvarsall - shell: cmd - run: | - @echo off - set vswherepath="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" - for /f "usebackq delims=" %%i in (`%vswherepath% -latest -property installationPath`) do ( - if exist "%%i\VC\Auxiliary\Build\vcvars64.bat" ( - set vcvarsall="%%i\VC\Auxiliary\Build\vcvars64.bat" - ) - ) - - echo "vcvarsall will be used as the VC compiler: %vcvarsall%" - echo "vcvarsall=%vcvarsall%" >> $GITHUB_ENV - - - name: Build and Test (Combined) - shell: cmd # Use cmd for the initial environment setup - run: | - @echo off - call "%vcvarsall%" - - REM Create build directory. Important to do this *before* changing directory. - if not exist "%GITHUB_WORKSPACE%\build" mkdir "%GITHUB_WORKSPACE%\build" - cd "%GITHUB_WORKSPACE%\build" - - REM Install Python modules *after* setting up the VC environment - python -m pip install -r "%GITHUB_WORKSPACE%\tools\ci_build\github\windows\python\requirements.txt" - - REM Execute the build script, also within the VC environment. - python "%GITHUB_WORKSPACE%\tools\ci_build\build.py" --config Debug --build_dir "%GITHUB_WORKSPACE%\build" --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer - - env: - vcvarsall: ${{ env.vcvarsall }} # Pass vcvarsall path to this combined step \ No newline at end of file From d6e1c7a6f5949ecb5667d0f745b770c2b650c3a3 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 14:01:05 -0700 Subject: [PATCH 05/42] update --- .github/actions/locate-vcvarsall-and-setup-env/action.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/actions/locate-vcvarsall-and-setup-env/action.yml b/.github/actions/locate-vcvarsall-and-setup-env/action.yml index cc586b4b8e1d3..9d0b1e9c7de1e 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/action.yml +++ b/.github/actions/locate-vcvarsall-and-setup-env/action.yml @@ -13,7 +13,7 @@ runs: shell: cmd run: | @echo off - set vswherepath="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" + set vswherepath="%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\\vswhere.exe" set vcvarsall_arch=${{ inputs.architecture }} if "%vcvarsall_arch%" == "x86" ( set vcvarsall_arch=x86 @@ -22,8 +22,8 @@ runs: ) for /f "usebackq delims=" %%i in (`"%vswherepath%" -latest -property installationPath`) do ( - if exist "%%i\VC\Auxiliary\Build\vcvars%vcvarsall_arch%.bat" ( - set "vcvarsall=%%i\VC\Auxiliary\Build\vcvars%vcvarsall_arch%.bat" + if exist "%%i\\VC\\Auxiliary\\Build\\vcvars%vcvarsall_arch%.bat" ( + set "vcvarsall=%%i\\VC\\Auxiliary\\Build\\vcvars%vcvarsall_arch%.bat" ) ) @@ -69,5 +69,6 @@ runs: f.write(path + os.linesep) else: value = value.replace('%', '%25').replace('\r', '%0D').replace('\n', '%0A') + print(f'Setting env name={key}::{value}') print(f'::set-env name={key}::{value}') EOF \ No newline at end of file From 97d688120778ba7229b0855dfaac7f06decd5a56 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 14:19:12 -0700 Subject: [PATCH 06/42] update --- .../locate-vcvarsall-and-setup-env/action.yml | 63 +------------------ 1 file changed, 2 insertions(+), 61 deletions(-) diff --git a/.github/actions/locate-vcvarsall-and-setup-env/action.yml b/.github/actions/locate-vcvarsall-and-setup-env/action.yml index 9d0b1e9c7de1e..238f609a638bc 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/action.yml +++ b/.github/actions/locate-vcvarsall-and-setup-env/action.yml @@ -4,7 +4,7 @@ inputs: architecture: description: 'Target architecture (x64 or x86)' required: true - default: 'x64' #It is better to make it required. + default: 'x64' runs: using: "composite" steps: @@ -12,63 +12,4 @@ runs: id: locate-vcvarsall shell: cmd run: | - @echo off - set vswherepath="%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\\vswhere.exe" - set vcvarsall_arch=${{ inputs.architecture }} - if "%vcvarsall_arch%" == "x86" ( - set vcvarsall_arch=x86 - ) else ( - set vcvarsall_arch=x64 - ) - - for /f "usebackq delims=" %%i in (`"%vswherepath%" -latest -property installationPath`) do ( - if exist "%%i\\VC\\Auxiliary\\Build\\vcvars%vcvarsall_arch%.bat" ( - set "vcvarsall=%%i\\VC\\Auxiliary\\Build\\vcvars%vcvarsall_arch%.bat" - ) - ) - - echo "vcvarsall will be used as the VC compiler: %vcvarsall%" - echo "::save-state name=vcvarsall::%vcvarsall%" - - REM Get initial environment variables - set > initial_env.txt - - REM Call vcvarsall.bat - call "%vcvarsall%" - - REM Get environment variables after calling vcvarsall.bat - set > final_env.txt - - REM Find new or modified environment variables using Python - python - < Date: Tue, 11 Mar 2025 14:27:22 -0700 Subject: [PATCH 07/42] update --- .../locate_vcvarsall.bat | 33 +++++++++++++++++++ .../update_environment.py | 29 ++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat create mode 100644 .github/actions/locate-vcvarsall-and-setup-env/update_environment.py diff --git a/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat b/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat new file mode 100644 index 0000000000000..437556bb87871 --- /dev/null +++ b/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat @@ -0,0 +1,33 @@ +@echo off +setlocal + +set vswherepath="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +set vcvarsall_arch=%1 +if "%vcvarsall_arch%" == "x86" ( + set vcvarsall_arch=x86 +) else ( + set vcvarsall_arch=x64 +) + +for /f "usebackq delims=" %%i in (`"%vswherepath%" -latest -property installationPath`) do ( + if exist "%%i\VC\Auxiliary\Build\vcvars%vcvarsall_arch%.bat" ( + set "vcvarsall=%%i\VC\Auxiliary\Build\vcvars%vcvarsall_arch%.bat" + ) +) + +echo "vcvarsall will be used as the VC compiler: %vcvarsall%" +echo "::save-state name=vcvarsall::%vcvarsall%" + +REM Get initial environment variables +set > initial_env.txt + +REM Call vcvarsall.bat +call "%vcvarsall%" + +REM Get environment variables after calling vcvarsall.bat +set > final_env.txt + +REM Call the Python script to update the GitHub Actions environment +python "%~dp0\update_environment.py" + +endlocal \ No newline at end of file diff --git a/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py b/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py new file mode 100644 index 0000000000000..186fdf646f561 --- /dev/null +++ b/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py @@ -0,0 +1,29 @@ +import os +import re + +def read_env_file(filepath): + env_vars = {} + with open(filepath, 'r') as f: + for line in f: + match = re.match(r'^(.*?)=(.*)$', line.strip()) + if match: + env_vars[match.group(1)] = match.group(2) + return env_vars + +initial_env = read_env_file('initial_env.txt') +final_env = read_env_file('final_env.txt') + +for key, value in final_env.items(): + if key not in initial_env or initial_env[key] != value: + if key.upper() == 'PATH': + new_paths = value.split(';') + initial_paths = initial_env.get('PATH','').split(';') + added_paths = [p for p in new_paths if p not in initial_paths and p] + + if added_paths: + with open(os.environ['GITHUB_PATH'], 'a') as f: + for path in added_paths: + f.write(path + os.linesep) + else: + value = value.replace('%', '%25').replace('\r', '%0D').replace('\n', '%0A') + print(f'::set-env name={key}::{value}') \ No newline at end of file From 514de883b7d8afa45c791449a6f61040ed755f09 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 14:34:55 -0700 Subject: [PATCH 08/42] update --- .../locate-vcvarsall-and-setup-env/locate_vcvarsall.bat | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat b/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat index 437556bb87871..0f273736dd85f 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat +++ b/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat @@ -9,14 +9,13 @@ if "%vcvarsall_arch%" == "x86" ( set vcvarsall_arch=x64 ) -for /f "usebackq delims=" %%i in (`"%vswherepath%" -latest -property installationPath`) do ( +for /f "usebackq delims=" %%i in (`%vswherepath% -latest -property installationPath`) do ( if exist "%%i\VC\Auxiliary\Build\vcvars%vcvarsall_arch%.bat" ( set "vcvarsall=%%i\VC\Auxiliary\Build\vcvars%vcvarsall_arch%.bat" ) ) echo "vcvarsall will be used as the VC compiler: %vcvarsall%" -echo "::save-state name=vcvarsall::%vcvarsall%" REM Get initial environment variables set > initial_env.txt From 40c077beec77f85ed8daf33f31bffda0c2649894 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 14:36:42 -0700 Subject: [PATCH 09/42] update --- .../actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat b/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat index 0f273736dd85f..a4319954071ef 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat +++ b/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat @@ -15,8 +15,6 @@ for /f "usebackq delims=" %%i in (`%vswherepath% -latest -property installationP ) ) -echo "vcvarsall will be used as the VC compiler: %vcvarsall%" - REM Get initial environment variables set > initial_env.txt From dfc4282e71d0bf3e5acbed48711c9ca0de3b4b96 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 14:55:04 -0700 Subject: [PATCH 10/42] update --- .../locate-vcvarsall-and-setup-env/action.yml | 59 ++++++++++++++++++- .../locate_vcvarsall.bat | 8 +-- 2 files changed, 60 insertions(+), 7 deletions(-) diff --git a/.github/actions/locate-vcvarsall-and-setup-env/action.yml b/.github/actions/locate-vcvarsall-and-setup-env/action.yml index 238f609a638bc..0fa7698061f21 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/action.yml +++ b/.github/actions/locate-vcvarsall-and-setup-env/action.yml @@ -5,11 +5,64 @@ inputs: description: 'Target architecture (x64 or x86)' required: true default: 'x64' +outputs: + vcvarsall_path: + description: "Path to vcvarsall.bat" + value: ${{ steps.find-vcvarsall.outputs.vcvarsall_path }} runs: using: "composite" steps: - - name: Locate vcvarsall and update environment - id: locate-vcvarsall + - name: Find vcvarsall.bat + id: find-vcvarsall + shell: python # Use Python shell + run: | + import os + import subprocess + + vswhere_path = os.path.join(os.environ["ProgramFiles(x86)"], "Microsoft Visual Studio", "Installer", "vswhere.exe") + architecture = "${{ inputs.architecture }}" + + if architecture == "x86": + vcvarsall_arch = "x86" + else: + vcvarsall_arch = "x64" + + try: + process = subprocess.run([vswhere_path, "-latest", "-property", "installationPath"], capture_output=True, text=True, check=True) + vs_install_path = process.stdout.strip() + vcvarsall_path = os.path.join(vs_install_path, "VC", "Auxiliary", "Build", f"vcvars{vcvarsall_arch}.bat") + + if os.path.exists(vcvarsall_path): + print(f"vcvarsall found at: {vcvarsall_path}") + print(f"::set-output name=vcvarsall_path::{vcvarsall_path}") + else: + print(f"vcvarsall.bat not found at expected path: {vcvarsall_path}") + # Use 'exit(1)' for Python to properly signal failure to GitHub Actions + exit(1) + + + except subprocess.CalledProcessError as e: + print(f"Error running vswhere.exe: {e}") + print(f"vswhere output: {e.stdout}") + print(f"vswhere stderr: {e.stderr}") + exit(1) # Exit with a non-zero code on error + except FileNotFoundError: + print(f"vswhere.exe not found at: {vswhere_path}") + exit(1) + + + - name: Setup Environment shell: cmd run: | - call ${{ github.action_path }}\locate_vcvarsall.bat ${{ inputs.architecture }} \ No newline at end of file + @echo off + REM Get initial environment variables + set > initial_env.txt + + REM Call vcvarsall.bat using the output from the previous step + call "${{ steps.find-vcvarsall.outputs.vcvarsall_path }}" + + REM Get environment variables after calling vcvarsall.bat + set > final_env.txt + + REM Call the Python script to update the GitHub Actions environment + python ${{ github.action_path }}\update_environment.py \ No newline at end of file diff --git a/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat b/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat index a4319954071ef..df900e5cd0995 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat +++ b/.github/actions/locate-vcvarsall-and-setup-env/locate_vcvarsall.bat @@ -15,16 +15,16 @@ for /f "usebackq delims=" %%i in (`%vswherepath% -latest -property installationP ) ) -REM Get initial environment variables +echo "Get initial environment variables" set > initial_env.txt -REM Call vcvarsall.bat +echo "Call vcvarsall.bat" call "%vcvarsall%" -REM Get environment variables after calling vcvarsall.bat +echo "Get environment variables after calling vcvarsall.bat" set > final_env.txt -REM Call the Python script to update the GitHub Actions environment +echo "Call the Python script to update the GitHub Actions environment" python "%~dp0\update_environment.py" endlocal \ No newline at end of file From 54ee8fcbe1a783f8e0c4b67b04b6657f6da61fe2 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 15:01:39 -0700 Subject: [PATCH 11/42] update --- .../actions/locate-vcvarsall-and-setup-env/action.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/actions/locate-vcvarsall-and-setup-env/action.yml b/.github/actions/locate-vcvarsall-and-setup-env/action.yml index 0fa7698061f21..454605bbaf265 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/action.yml +++ b/.github/actions/locate-vcvarsall-and-setup-env/action.yml @@ -20,17 +20,11 @@ runs: import subprocess vswhere_path = os.path.join(os.environ["ProgramFiles(x86)"], "Microsoft Visual Studio", "Installer", "vswhere.exe") - architecture = "${{ inputs.architecture }}" - - if architecture == "x86": - vcvarsall_arch = "x86" - else: - vcvarsall_arch = "x64" try: process = subprocess.run([vswhere_path, "-latest", "-property", "installationPath"], capture_output=True, text=True, check=True) vs_install_path = process.stdout.strip() - vcvarsall_path = os.path.join(vs_install_path, "VC", "Auxiliary", "Build", f"vcvars{vcvarsall_arch}.bat") + vcvarsall_path = os.path.join(vs_install_path, "VC", "Auxiliary", "Build", "vcvarsall.bat") if os.path.exists(vcvarsall_path): print(f"vcvarsall found at: {vcvarsall_path}") @@ -59,7 +53,7 @@ runs: set > initial_env.txt REM Call vcvarsall.bat using the output from the previous step - call "${{ steps.find-vcvarsall.outputs.vcvarsall_path }}" + call "${{ steps.find-vcvarsall.outputs.vcvarsall_path }}" "${{ inputs.architecture }}" REM Get environment variables after calling vcvarsall.bat set > final_env.txt From 96f2894adfda015b74785402fe5ee9d32adb3215 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 15:12:27 -0700 Subject: [PATCH 12/42] update --- .github/actions/locate-vcvarsall-and-setup-env/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/locate-vcvarsall-and-setup-env/action.yml b/.github/actions/locate-vcvarsall-and-setup-env/action.yml index 454605bbaf265..3451669f48140 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/action.yml +++ b/.github/actions/locate-vcvarsall-and-setup-env/action.yml @@ -48,7 +48,6 @@ runs: - name: Setup Environment shell: cmd run: | - @echo off REM Get initial environment variables set > initial_env.txt From 9e8ee41a3298ef4fbcb15baddab8669349aa3a6c Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 15:21:11 -0700 Subject: [PATCH 13/42] update --- .github/actions/locate-vcvarsall-and-setup-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/locate-vcvarsall-and-setup-env/action.yml b/.github/actions/locate-vcvarsall-and-setup-env/action.yml index 3451669f48140..c0a66db88acc4 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/action.yml +++ b/.github/actions/locate-vcvarsall-and-setup-env/action.yml @@ -52,7 +52,7 @@ runs: set > initial_env.txt REM Call vcvarsall.bat using the output from the previous step - call "${{ steps.find-vcvarsall.outputs.vcvarsall_path }}" "${{ inputs.architecture }}" + call "${{ steps.find-vcvarsall.outputs.vcvarsall_path }}" ${{ inputs.architecture }} REM Get environment variables after calling vcvarsall.bat set > final_env.txt From 56453234dbf263071eec85fb86059adc01846f46 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 15:25:51 -0700 Subject: [PATCH 14/42] update --- .github/actions/locate-vcvarsall-and-setup-env/action.yml | 4 +++- .../locate-vcvarsall-and-setup-env/update_environment.py | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/actions/locate-vcvarsall-and-setup-env/action.yml b/.github/actions/locate-vcvarsall-and-setup-env/action.yml index c0a66db88acc4..b1e09e7d17f9e 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/action.yml +++ b/.github/actions/locate-vcvarsall-and-setup-env/action.yml @@ -28,7 +28,9 @@ runs: if os.path.exists(vcvarsall_path): print(f"vcvarsall found at: {vcvarsall_path}") - print(f"::set-output name=vcvarsall_path::{vcvarsall_path}") + # Use GITHUB_OUTPUT environment variable + with open(os.environ['GITHUB_OUTPUT'], 'a') as f: + f.write(f"vcvarsall_path={vcvarsall_path}\n") else: print(f"vcvarsall.bat not found at expected path: {vcvarsall_path}") # Use 'exit(1)' for Python to properly signal failure to GitHub Actions diff --git a/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py b/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py index 186fdf646f561..8e0762bef3c0a 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py +++ b/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py @@ -25,5 +25,7 @@ def read_env_file(filepath): for path in added_paths: f.write(path + os.linesep) else: - value = value.replace('%', '%25').replace('\r', '%0D').replace('\n', '%0A') - print(f'::set-env name={key}::{value}') \ No newline at end of file + # Use GITHUB_ENV + with open(os.environ['GITHUB_ENV'], 'a') as f: + # No need to escape special characters when using GITHUB_ENV file + f.write(f"{key}={value}\n") \ No newline at end of file From 182023c942770ec89cb0da0b10dc29e36a06f58e Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 15:27:43 -0700 Subject: [PATCH 15/42] update --- .github/workflows/build_x86_asan.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_x86_asan.yml b/.github/workflows/build_x86_asan.yml index e248e90728dc2..9c964a6a89a8c 100644 --- a/.github/workflows/build_x86_asan.yml +++ b/.github/workflows/build_x86_asan.yml @@ -37,6 +37,7 @@ jobs: shell: cmd run: | @echo off + set if not exist "%GITHUB_WORKSPACE%\build" mkdir "%GITHUB_WORKSPACE%\build" cd "%GITHUB_WORKSPACE%\build" python -m pip install -r "%GITHUB_WORKSPACE%\tools/ci_build/github/windows\python\requirements.txt" From a77ce742ce15fb244bc65ad28894bafb04269522 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 15:37:11 -0700 Subject: [PATCH 16/42] update --- .../update_environment.py | 6 +++++- .github/workflows/build_x64_asan.yml | 11 ++++++++++- .github/workflows/build_x86_asan.yml | 10 +++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py b/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py index 8e0762bef3c0a..602259b84379a 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py +++ b/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py @@ -15,17 +15,21 @@ def read_env_file(filepath): for key, value in final_env.items(): if key not in initial_env or initial_env[key] != value: + if key.startswith("_"): + continue if key.upper() == 'PATH': new_paths = value.split(';') initial_paths = initial_env.get('PATH','').split(';') added_paths = [p for p in new_paths if p not in initial_paths and p] if added_paths: + print("Adding paths") with open(os.environ['GITHUB_PATH'], 'a') as f: for path in added_paths: + print(f"XXXXXX:Add {path}") f.write(path + os.linesep) else: # Use GITHUB_ENV with open(os.environ['GITHUB_ENV'], 'a') as f: - # No need to escape special characters when using GITHUB_ENV file + print(f"Setting {key}={value}\n") f.write(f"{key}={value}\n") \ No newline at end of file diff --git a/.github/workflows/build_x64_asan.yml b/.github/workflows/build_x64_asan.yml index 7cee69b5033aa..3261f0c706646 100644 --- a/.github/workflows/build_x64_asan.yml +++ b/.github/workflows/build_x64_asan.yml @@ -33,11 +33,20 @@ jobs: with: architecture: x64 + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Build and Test (Combined) shell: cmd + env: + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" run: | @echo off if not exist "%GITHUB_WORKSPACE%\build" mkdir "%GITHUB_WORKSPACE%\build" cd "%GITHUB_WORKSPACE%\build" python -m pip install -r "%GITHUB_WORKSPACE%\tools\ci_build/github/windows\python\requirements.txt" - python "%GITHUB_WORKSPACE%\tools\ci_build\build.py" --config Debug --build_dir "%GITHUB_WORKSPACE%\build" --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer --build_x64_asan true \ No newline at end of file + python "%GITHUB_WORKSPACE%\tools\ci_build\build.py" --config Debug --build_dir "%GITHUB_WORKSPACE%\build" --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer \ No newline at end of file diff --git a/.github/workflows/build_x86_asan.yml b/.github/workflows/build_x86_asan.yml index 9c964a6a89a8c..b33cdba8332fa 100644 --- a/.github/workflows/build_x86_asan.yml +++ b/.github/workflows/build_x86_asan.yml @@ -33,12 +33,20 @@ jobs: with: architecture: x86 + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Build and Test (Combined) shell: cmd + env: + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" run: | @echo off set if not exist "%GITHUB_WORKSPACE%\build" mkdir "%GITHUB_WORKSPACE%\build" cd "%GITHUB_WORKSPACE%\build" python -m pip install -r "%GITHUB_WORKSPACE%\tools/ci_build/github/windows\python\requirements.txt" - python "%GITHUB_WORKSPACE%\tools\ci_build\build.py" --config Debug --build_dir "%GITHUB_WORKSPACE%\build" --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer --build_x86_asan true \ No newline at end of file + python "%GITHUB_WORKSPACE%\tools\ci_build\build.py" --config Debug --build_dir "%GITHUB_WORKSPACE%\build" --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer \ No newline at end of file From f332db4d53d965ea5388d33b4a7d642ab4673a27 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 15:42:33 -0700 Subject: [PATCH 17/42] update --- .../locate-vcvarsall-and-setup-env/update_environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py b/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py index 602259b84379a..e5182010c5b27 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py +++ b/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py @@ -7,7 +7,7 @@ def read_env_file(filepath): for line in f: match = re.match(r'^(.*?)=(.*)$', line.strip()) if match: - env_vars[match.group(1)] = match.group(2) + env_vars[match.group(1).upper()] = match.group(2) return env_vars initial_env = read_env_file('initial_env.txt') From c137d03fba3351a6cf8c2f8e617baba1a89d6704 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 16:41:22 -0700 Subject: [PATCH 18/42] Convert --- .../update_environment.py | 2 +- ...64_asan.yml => windows_build_x64_asan.yml} | 7 +- ...86_asan.yml => windows_build_x86_asan.yml} | 7 +- .../windows_x64_debug_build_x64_debug.yml | 125 +++++++++++++++++ .../windows_x64_release_build_x64_release.yml | 128 +++++++++++++++++ ...ows_x64_release_dnnl_build_x64_release.yml | 127 +++++++++++++++++ ...build_x64_release_ep_generic_interface.yml | 119 ++++++++++++++++ ..._x64_release_vitisai_build_x64_release.yml | 115 ++++++++++++++++ ..._release_winml_build_x64_release_winml.yml | 128 +++++++++++++++++ .../workflows/windows_x64_release_xnnpack.yml | 128 +++++++++++++++++ .github/workflows/windows_x86.yml | 129 ++++++++++++++++++ 11 files changed, 1005 insertions(+), 10 deletions(-) rename .github/workflows/{build_x64_asan.yml => windows_build_x64_asan.yml} (78%) rename .github/workflows/{build_x86_asan.yml => windows_build_x86_asan.yml} (77%) create mode 100644 .github/workflows/windows_x64_debug_build_x64_debug.yml create mode 100644 .github/workflows/windows_x64_release_build_x64_release.yml create mode 100644 .github/workflows/windows_x64_release_dnnl_build_x64_release.yml create mode 100644 .github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml create mode 100644 .github/workflows/windows_x64_release_vitisai_build_x64_release.yml create mode 100644 .github/workflows/windows_x64_release_winml_build_x64_release_winml.yml create mode 100644 .github/workflows/windows_x64_release_xnnpack.yml create mode 100644 .github/workflows/windows_x86.yml diff --git a/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py b/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py index e5182010c5b27..7babb4cc4966a 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py +++ b/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py @@ -26,7 +26,7 @@ def read_env_file(filepath): print("Adding paths") with open(os.environ['GITHUB_PATH'], 'a') as f: for path in added_paths: - print(f"XXXXXX:Add {path}") + print(f"Adding PATH: {path}") f.write(path + os.linesep) else: # Use GITHUB_ENV diff --git a/.github/workflows/build_x64_asan.yml b/.github/workflows/windows_build_x64_asan.yml similarity index 78% rename from .github/workflows/build_x64_asan.yml rename to .github/workflows/windows_build_x64_asan.yml index 3261f0c706646..343771a94d4b2 100644 --- a/.github/workflows/build_x64_asan.yml +++ b/.github/workflows/windows_build_x64_asan.yml @@ -3,7 +3,7 @@ name: build_x64_asan on: push: - branches: [ main, 'rel-*', 'snnn/es1' ] + branches: [ main, 'rel-*'] pull_request: branches: [ main ] @@ -46,7 +46,6 @@ jobs: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" run: | @echo off - if not exist "%GITHUB_WORKSPACE%\build" mkdir "%GITHUB_WORKSPACE%\build" - cd "%GITHUB_WORKSPACE%\build" + echo %PATH% python -m pip install -r "%GITHUB_WORKSPACE%\tools\ci_build/github/windows\python\requirements.txt" - python "%GITHUB_WORKSPACE%\tools\ci_build\build.py" --config Debug --build_dir "%GITHUB_WORKSPACE%\build" --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer \ No newline at end of file + python "%GITHUB_WORKSPACE%\tools\ci_build\build.py" --config Debug --build_dir "%RUNNER_TEMP%\build" --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer \ No newline at end of file diff --git a/.github/workflows/build_x86_asan.yml b/.github/workflows/windows_build_x86_asan.yml similarity index 77% rename from .github/workflows/build_x86_asan.yml rename to .github/workflows/windows_build_x86_asan.yml index b33cdba8332fa..99fb27cd6f8d8 100644 --- a/.github/workflows/build_x86_asan.yml +++ b/.github/workflows/windows_build_x86_asan.yml @@ -3,7 +3,7 @@ name: build_x86_asan on: push: - branches: [ main, 'rel-*', 'snnn/es1' ] + branches: [ main, 'rel-*'] pull_request: branches: [ main ] @@ -45,8 +45,5 @@ jobs: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" run: | @echo off - set - if not exist "%GITHUB_WORKSPACE%\build" mkdir "%GITHUB_WORKSPACE%\build" - cd "%GITHUB_WORKSPACE%\build" python -m pip install -r "%GITHUB_WORKSPACE%\tools/ci_build/github/windows\python\requirements.txt" - python "%GITHUB_WORKSPACE%\tools\ci_build\build.py" --config Debug --build_dir "%GITHUB_WORKSPACE%\build" --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer \ No newline at end of file + python "%GITHUB_WORKSPACE%\tools\ci_build\build.py" --config Debug --build_dir "%RUNNER_TEMP%\build" --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer \ No newline at end of file diff --git a/.github/workflows/windows_x64_debug_build_x64_debug.yml b/.github/workflows/windows_x64_debug_build_x64_debug.yml new file mode 100644 index 0000000000000..7428bc6054b3e --- /dev/null +++ b/.github/workflows/windows_x64_debug_build_x64_debug.yml @@ -0,0 +1,125 @@ +name: build_x64_debug + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x64_debug: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 300 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x64 + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env # Use the composite action + with: + architecture: x64 + + - name: Install python modules + shell: cmd + run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" + working-directory: "${{ github.workspace }}\build" + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + shell: cmd + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\build\Debug\Debug + mkdir %ORT_DOXY_SRC% + mkdir %ORT_DOXY_OUT% + "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg + working-directory: ${{ github.workspace }} + + - name: Use .NET 8.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' + env: + PROCESSOR_ARCHITECTURE: x64 + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v1 # Use the official NuGet setup action + with: + nuget-version: '6.x' + + - name: NuGet restore + shell: cmd + run: | + nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\Debug -ConfigFile ${{ github.workspace }}\NuGet.config + + - name: Build and Test + shell: pwsh + run: | + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config Debug --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_java --build_nodejs --build_wheel --disable_memleak_checker --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Remove-Item "${{ github.workspace }}\build\Debug" -Include "*.obj" -Recurse + env: # Set environment variables here, applies to this step only + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + DocUpdateNeeded: 'false' # Can be set dynamically based on build output if needed + + + - name: Validate C# native delegates + shell: cmd + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\csharp + + - name: Install onnxruntime wheel + shell: pwsh + run: | + python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq + Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} + working-directory: "${{ github.workspace }}\build\Debug\Debug" + + # Publish artifacts only on failure and if DocUpdateNeeded is true (example) + - name: Publish OperatorKernels.md (Conditional) + uses: actions/upload-artifact@v3 + if: failure() && env.DocUpdateNeeded == 'true' # Use env. for step-level vars + with: + name: OperatorKernels.md + path: ${{ github.workspace }}/docs/OperatorKernels.md + + - name: Publish ContribOperators.md (Conditional) + uses: actions/upload-artifact@v3 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: ContribOperators.md + path: ${{ github.workspace }}/docs/ContribOperators.md + + # These variables will persist for the entire job + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' + TODAY: ${{ format('{0:dd}{0:MM}{0:yyyy}', github.event.head_commit.timestamp) }} # Or a different suitable date + workspace_clean: all # This seems to be unused \ No newline at end of file diff --git a/.github/workflows/windows_x64_release_build_x64_release.yml b/.github/workflows/windows_x64_release_build_x64_release.yml new file mode 100644 index 0000000000000..98a9479230d1b --- /dev/null +++ b/.github/workflows/windows_x64_release_build_x64_release.yml @@ -0,0 +1,128 @@ +name: build_x64_release + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x64_release: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 300 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x64 + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env + with: + architecture: x64 + + - name: Install python modules + shell: cmd + run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" + working-directory: "${{ github.workspace }}\build" + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + shell: cmd + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + mkdir %ORT_DOXY_SRC% + mkdir %ORT_DOXY_OUT% + "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg + working-directory: ${{ github.workspace }} + + - name: Use .NET 8.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' + env: + PROCESSOR_ARCHITECTURE: x64 + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v1 + with: + nuget-version: '6.x' + + - name: NuGet restore + shell: cmd + run: | + nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\RelWithDebInfo -ConfigFile ${{ github.workspace }}\NuGet.config + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Build and Test + shell: pwsh + run: | + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_wheel --build_java --build_nodejs --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + env: + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + DocUpdateNeeded: 'false' + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + + - name: Validate C# native delegates + shell: cmd + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\csharp + + - name: Install onnxruntime wheel + shell: pwsh + run: | + python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq + Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} + working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" + + - name: Publish OperatorKernels.md (Conditional) + uses: actions/upload-artifact@v3 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: OperatorKernels.md + path: ${{ github.workspace }}/docs/OperatorKernels.md + + - name: Publish ContribOperators.md (Conditional) + uses: actions/upload-artifact@v3 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: ContribOperators.md + path: ${{ github.workspace }}/docs/ContribOperators.md + + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' diff --git a/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml b/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml new file mode 100644 index 0000000000000..ccdb73534a998 --- /dev/null +++ b/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml @@ -0,0 +1,127 @@ +name: build_x64_release + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x64_release: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 300 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x64 + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env + with: + architecture: x64 + + - name: Install python modules + shell: cmd + run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" + working-directory: "${{ github.workspace }}\build" + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + shell: cmd + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + mkdir %ORT_DOXY_SRC% + mkdir %ORT_DOXY_OUT% + "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg + working-directory: ${{ github.workspace }} + + - name: Use .NET 8.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' + env: + PROCESSOR_ARCHITECTURE: x64 + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v1 + with: + nuget-version: '6.x' + + - name: NuGet restore + shell: cmd + run: | + nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\RelWithDebInfo -ConfigFile ${{ github.workspace }}\NuGet.config + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Build and Test + shell: pwsh + run: | + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_wheel --build_java --build_nodejs --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + env: + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + + - name: Validate C# native delegates + shell: cmd + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\csharp + + - name: Install onnxruntime wheel + shell: pwsh + run: | + python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq + Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} + working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" + + - name: Publish OperatorKernels.md (Conditional) + uses: actions/upload-artifact@v3 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: OperatorKernels.md + path: ${{ github.workspace }}/docs/OperatorKernels.md + + - name: Publish ContribOperators.md (Conditional) + uses: actions/upload-artifact@v3 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: ContribOperators.md + path: ${{ github.workspace }}/docs/ContribOperators.md + + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' \ No newline at end of file diff --git a/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml b/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml new file mode 100644 index 0000000000000..c71a18b94b69c --- /dev/null +++ b/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml @@ -0,0 +1,119 @@ +name: build_x64_release_ep_generic_interface + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x64_release_ep_generic_interface: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 300 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x64 + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env + with: + architecture: x64 + + - name: Install python modules + shell: cmd + run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" + working-directory: "${{ github.workspace }}\build" + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + shell: cmd + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + mkdir %ORT_DOXY_SRC% + mkdir %ORT_DOXY_OUT% + "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg + working-directory: ${{ github.workspace }} + + - name: Use .NET 8.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' + env: + PROCESSOR_ARCHITECTURE: x64 + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v1 + with: + nuget-version: '6.x' + + - name: NuGet restore + shell: cmd + run: | + nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\RelWithDebInfo -ConfigFile ${{ github.workspace }}\NuGet.config + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Build + shell: pwsh + run: | + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --update --build --enable_generic_interface --use_vcpkg --use_vcpkg_ms_internal_asset_cache + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + env: + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + + - name: Validate C# native delegates + shell: cmd + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\csharp + - name: Publish OperatorKernels.md (Conditional) + uses: actions/upload-artifact@v3 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: OperatorKernels.md + path: ${{ github.workspace }}/docs/OperatorKernels.md + + - name: Publish ContribOperators.md (Conditional) + uses: actions/upload-artifact@v3 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: ContribOperators.md + path: ${{ github.workspace }}/docs/ContribOperators.md + + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' diff --git a/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml b/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml new file mode 100644 index 0000000000000..5160b1ac84059 --- /dev/null +++ b/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml @@ -0,0 +1,115 @@ +name: build_x64_release_vitisai + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x64_release_vitisai: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 300 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x64 + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env + with: + architecture: x64 + + - name: Install python modules + shell: cmd + run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" + working-directory: "${{ github.workspace }}\build" + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + shell: cmd + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + mkdir %ORT_DOXY_SRC% + mkdir %ORT_DOXY_OUT% + "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg + working-directory: ${{ github.workspace }} + + - name: Use .NET 8.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' + env: + PROCESSOR_ARCHITECTURE: x64 + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v1 + with: + nuget-version: '6.x' + + - name: NuGet restore + shell: cmd + run: | + nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\RelWithDebInfo -ConfigFile ${{ github.workspace }}\NuGet.config + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Build + shell: pwsh + run: | + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --update --build --build_wheel --use_vitisai --use_vcpkg --use_vcpkg_ms_internal_asset_cache + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + env: + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + + - name: Validate C# native delegates + shell: cmd + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\csharp + + - name: Install onnxruntime wheel + shell: pwsh + run: | + python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} + working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' diff --git a/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml b/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml new file mode 100644 index 0000000000000..6772fe10a3a85 --- /dev/null +++ b/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml @@ -0,0 +1,128 @@ +name: build_x64_release_winml + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x64_release_winml: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 300 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x64 + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env + with: + architecture: x64 + + - name: Install python modules + shell: cmd + run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" + working-directory: "${{ github.workspace }}\build" + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + shell: cmd + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + mkdir %ORT_DOXY_SRC% + mkdir %ORT_DOXY_OUT% + "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg + working-directory: ${{ github.workspace }} + + - name: Use .NET 8.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' + env: + PROCESSOR_ARCHITECTURE: x64 + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v1 + with: + nuget-version: '6.x' + + - name: NuGet restore + shell: cmd + run: | + nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\RelWithDebInfo -ConfigFile ${{ github.workspace }}\NuGet.config + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Build and Test + shell: pwsh + run: | + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --use_winml --enable_wcos --disable_rtti --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + env: + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + DocUpdateNeeded: 'false' + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + + - name: Validate C# native delegates + shell: cmd + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\csharp + + - name: Install onnxruntime wheel # Keep this step, even no wheel file is built. + shell: pwsh + run: | + python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq + Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} + working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" + + - name: Publish OperatorKernels.md (Conditional) + uses: actions/upload-artifact@v3 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: OperatorKernels.md + path: ${{ github.workspace }}/docs/OperatorKernels.md + + - name: Publish ContribOperators.md (Conditional) + uses: actions/upload-artifact@v3 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: ContribOperators.md + path: ${{ github.workspace }}/docs/ContribOperators.md + + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' diff --git a/.github/workflows/windows_x64_release_xnnpack.yml b/.github/workflows/windows_x64_release_xnnpack.yml new file mode 100644 index 0000000000000..b646bc94e80c8 --- /dev/null +++ b/.github/workflows/windows_x64_release_xnnpack.yml @@ -0,0 +1,128 @@ +name: build_x64_release_winml + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x64_release_winml: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 300 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x64 + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env + with: + architecture: x64 + + - name: Install python modules + shell: cmd + run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" + working-directory: "${{ github.workspace }}\build" + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + shell: cmd + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + mkdir %ORT_DOXY_SRC% + mkdir %ORT_DOXY_OUT% + "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg + working-directory: ${{ github.workspace }} + + - name: Use .NET 8.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' + env: + PROCESSOR_ARCHITECTURE: x64 + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v1 + with: + nuget-version: '6.x' + + - name: NuGet restore + shell: cmd + run: | + nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\RelWithDebInfo -ConfigFile ${{ github.workspace }}\NuGet.config + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Build and Test + shell: pwsh + run: | + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --use_winml --enable_wcos --disable_rtti --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + env: + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + DocUpdateNeeded: 'false' + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"' + + - name: Validate C# native delegates + shell: cmd + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\csharp + + - name: Install onnxruntime wheel # Keep this step, even no wheel file is built. + shell: pwsh + run: | + python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq + Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} + working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" + + - name: Publish OperatorKernels.md (Conditional) + uses: actions/upload-artifact@v3 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: OperatorKernels.md + path: ${{ github.workspace }}/docs/OperatorKernels.md + + - name: Publish ContribOperators.md (Conditional) + uses: actions/upload-artifact@v3 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: ContribOperators.md + path: ${{ github.workspace }}/docs/ContribOperators.md + + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' diff --git a/.github/workflows/windows_x86.yml b/.github/workflows/windows_x86.yml new file mode 100644 index 0000000000000..0dd034e483573 --- /dev/null +++ b/.github/workflows/windows_x86.yml @@ -0,0 +1,129 @@ +name: build_x86_release + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x86_release: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 300 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + architecture: x86 # x86 Python + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env + with: + architecture: x86 # x86 architecture for vcvarsall + + - name: Install python modules + shell: cmd + run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" + working-directory: "${{ github.workspace }}\build" + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + architecture: x86 #Add architecture + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + architecture: x86 # x86 Java + + - name: API Documentation Check and generate + shell: cmd + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + mkdir %ORT_DOXY_SRC% + mkdir %ORT_DOXY_OUT% + "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg + working-directory: ${{ github.workspace }} + + - name: Use .NET 8.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x' + env: + PROCESSOR_ARCHITECTURE: x86 # x86 .NET + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v1 + with: + nuget-version: '6.x' + + - name: NuGet restore + shell: cmd + run: | + nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\RelWithDebInfo -ConfigFile ${{ github.workspace }}\NuGet.config + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Build and Test + shell: pwsh + run: | + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_wheel --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + env: + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + DocUpdateNeeded: 'false' + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + + - name: Validate C# native delegates + shell: cmd + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\csharp + + - name: Install onnxruntime wheel + shell: pwsh + run: | + python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq + Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} + working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" + + - name: Publish OperatorKernels.md (Conditional) + uses: actions/upload-artifact@v3 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: OperatorKernels.md + path: ${{ github.workspace }}/docs/OperatorKernels.md + + - name: Publish ContribOperators.md (Conditional) + uses: actions/upload-artifact@v3 + if: failure() && env.DocUpdateNeeded == 'true' + with: + name: ContribOperators.md + path: ${{ github.workspace }}/docs/ContribOperators.md + + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true \ No newline at end of file From 526971963044ab3d3eaec86201233036d18dd30b Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 16:42:15 -0700 Subject: [PATCH 19/42] update --- .github/workflows/windows_x86.yml | 2 +- .../azure-pipelines/win-ci-pipeline.yml | 261 ------------------ 2 files changed, 1 insertion(+), 262 deletions(-) delete mode 100644 tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml diff --git a/.github/workflows/windows_x86.yml b/.github/workflows/windows_x86.yml index 0dd034e483573..751731057bd63 100644 --- a/.github/workflows/windows_x86.yml +++ b/.github/workflows/windows_x86.yml @@ -1,4 +1,4 @@ -name: build_x86_release +name: Windows CPU CI Pipeline on: push: diff --git a/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml deleted file mode 100644 index 54c2e51c2a09b..0000000000000 --- a/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml +++ /dev/null @@ -1,261 +0,0 @@ -##### start trigger Don't edit it manually, Please do edit set-trigger-rules.py #### -### please do rerun set-trigger-rules.py ### -trigger: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -pr: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -#### end trigger #### - -parameters: -- name: RunOnnxRuntimeTests - displayName: Run Tests? - type: boolean - default: true - -stages: -- stage: x64_debug - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'Debug' - buildArch: x64 - additionalBuildFlags: --build_java --build_nodejs --build_wheel --disable_memleak_checker --msbuild_extra_options IncludeMobileTargets=false --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_debug - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - isTraining: false - ORT_EP_NAME: CPU - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022' - - - job: build_x64_asan - pool: 'onnxruntime-Win-CPU-2022' - timeoutInMinutes: 300 - steps: - - checkout: self - clean: true - submodules: none - - - template: templates/jobs/win-ci-prebuild-steps.yml - parameters: - EnvSetupScript: setup_env.bat - DownloadCUDA: false - BuildArch: x64 - BuildConfig: Debug - MachinePool: 'onnxruntime-Win-CPU-2022' - WithCache: false - Today: $(TODAY) - - - task: PythonScript@0 - displayName: 'Build and Test' - inputs: - scriptPath: '$(Build.SourcesDirectory)\tools\ci_build\build.py' - arguments: --config Debug --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer - workingDirectory: '$(Build.BinariesDirectory)' - - -- stage: x64_release - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - # Compare to our Nuget packaging pipeline, this job has "--build_wheel" but doesn't have "--enable_lto --disable_rtti --use_telemetry --enable_wcos" - # Python bindings use typeid so I can't disable RTTI here. If it causes a problem, we will need to split this job to two jobs. - additionalBuildFlags: --build_wheel --build_java --build_nodejs --msbuild_extra_options IncludeMobileTargets=false --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_release - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - isTraining: false - ORT_EP_NAME: CPU - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022' - -- stage: x64_release_dnnl - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - additionalBuildFlags: --build_wheel --use_dnnl --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_release - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - isTraining: false - ORT_EP_NAME: DNNL - GenerateDocumentation: false - WITH_CACHE: false - # Intel EPs require Intel CPUs - MachinePool: 'onnxruntime-Win2022-Intel-CPU' - -# Tests doesn't work on AMD CPUs -- stage: x64_release_xnnpack - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - additionalBuildFlags: --build_wheel --use_xnnpack --msbuild_extra_options IncludeMobileTargets=false --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_release - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - isTraining: false - ORT_EP_NAME: XNNPACK - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022' - -# Build only. Does not run any tests. -- stage: x64_release_vitisai - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - additionalBuildFlags: --build_wheel --use_vitisai --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_release - RunOnnxRuntimeTests: false - isTraining: false - ORT_EP_NAME: VITISAI - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022' - -- stage: x64_release_winml - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - additionalBuildFlags: --use_winml --enable_wcos --disable_rtti --msbuild_extra_options IncludeMobileTargets=false --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_release_winml - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - # WinML has many warnings - EnablePython: false - isTraining: false - ORT_EP_NAME: CPU - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022' - -- stage: x64_release_ep_generic_interface - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - additionalBuildFlags: --enable_generic_interface --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_release_ep_generic_interface - RunOnnxRuntimeTests: false # --enable_generic_interface does not build tests - EnablePython: false - isTraining: false - ORT_EP_NAME: CPU - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022' - -- stage: x86_release - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - EnvSetupScript: setup_env_x86.bat - buildArch: x86 - additionalBuildFlags: --build_wheel --msbuild_extra_options IncludeMobileTargets=false --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: Win32 - isX86: true - job_name_suffix: x86_release - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - isTraining: false - ORT_EP_NAME: CPU - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022' - -- stage: ort_training_apis_x64_release - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - additionalBuildFlags: --enable_training_apis --msbuild_extra_options IncludeMobileTargets=false --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: ort_training_apis_x64_release - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - EnablePython: false - isTraining: true - ORT_EP_NAME: CPU - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win2022-CPU-training-AMD' - -- stage: x64_release_azure - dependsOn: [] - jobs: - - job: x64_release_azure - steps: - - powershell: | - Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)\RelWithDebInfo\_deps\vcpkg-src\installed\x86-windows\bin" - $env:PATH - Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)\RelWithDebInfo\_deps\vcpkg-src\installed\x64-windows\bin" - $env:PATH - displayName: 'Append x64-windows and x86-windows to PATH' - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - buildArch: x64 - additionalBuildFlags: --use_azure --use_lock_free_queue --msbuild_extra_options IncludeMobileTargets=false --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_release_azure - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - EnablePython: false - isTraining: false - ORT_EP_NAME: CPU - GenerateDocumentation: false - WITH_CACHE: false - MachinePool: 'onnxruntime-Win-CPU-2022' From be1e9cebe64a22864b490c3de092b67062e8b77d Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 16:53:41 -0700 Subject: [PATCH 20/42] update --- .github/workflows/windows_x64_debug_build_x64_debug.yml | 4 ++-- .github/workflows/windows_x64_release_build_x64_release.yml | 4 ++-- .../workflows/windows_x64_release_dnnl_build_x64_release.yml | 4 ++-- ...neric_interface_build_x64_release_ep_generic_interface.yml | 4 ++-- .../windows_x64_release_winml_build_x64_release_winml.yml | 4 ++-- .github/workflows/windows_x64_release_xnnpack.yml | 4 ++-- .github/workflows/windows_x86.yml | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/windows_x64_debug_build_x64_debug.yml b/.github/workflows/windows_x64_debug_build_x64_debug.yml index 7428bc6054b3e..1539481784034 100644 --- a/.github/workflows/windows_x64_debug_build_x64_debug.yml +++ b/.github/workflows/windows_x64_debug_build_x64_debug.yml @@ -103,14 +103,14 @@ jobs: # Publish artifacts only on failure and if DocUpdateNeeded is true (example) - name: Publish OperatorKernels.md (Conditional) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' # Use env. for step-level vars with: name: OperatorKernels.md path: ${{ github.workspace }}/docs/OperatorKernels.md - name: Publish ContribOperators.md (Conditional) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' with: name: ContribOperators.md diff --git a/.github/workflows/windows_x64_release_build_x64_release.yml b/.github/workflows/windows_x64_release_build_x64_release.yml index 98a9479230d1b..84d51096e8fd7 100644 --- a/.github/workflows/windows_x64_release_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_build_x64_release.yml @@ -109,14 +109,14 @@ jobs: working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" - name: Publish OperatorKernels.md (Conditional) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' with: name: OperatorKernels.md path: ${{ github.workspace }}/docs/OperatorKernels.md - name: Publish ContribOperators.md (Conditional) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' with: name: ContribOperators.md diff --git a/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml b/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml index ccdb73534a998..8035dcfe9bea7 100644 --- a/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml @@ -108,14 +108,14 @@ jobs: working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" - name: Publish OperatorKernels.md (Conditional) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' with: name: OperatorKernels.md path: ${{ github.workspace }}/docs/OperatorKernels.md - name: Publish ContribOperators.md (Conditional) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' with: name: ContribOperators.md diff --git a/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml b/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml index c71a18b94b69c..680f16d933866 100644 --- a/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml +++ b/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml @@ -100,14 +100,14 @@ jobs: run: python tools\ValidateNativeDelegateAttributes.py working-directory: ${{ github.workspace }}\csharp - name: Publish OperatorKernels.md (Conditional) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' with: name: OperatorKernels.md path: ${{ github.workspace }}/docs/OperatorKernels.md - name: Publish ContribOperators.md (Conditional) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' with: name: ContribOperators.md diff --git a/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml b/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml index 6772fe10a3a85..15e8709d2e92a 100644 --- a/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml +++ b/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml @@ -109,14 +109,14 @@ jobs: working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" - name: Publish OperatorKernels.md (Conditional) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' with: name: OperatorKernels.md path: ${{ github.workspace }}/docs/OperatorKernels.md - name: Publish ContribOperators.md (Conditional) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' with: name: ContribOperators.md diff --git a/.github/workflows/windows_x64_release_xnnpack.yml b/.github/workflows/windows_x64_release_xnnpack.yml index b646bc94e80c8..02aa8483c865b 100644 --- a/.github/workflows/windows_x64_release_xnnpack.yml +++ b/.github/workflows/windows_x64_release_xnnpack.yml @@ -109,14 +109,14 @@ jobs: working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" - name: Publish OperatorKernels.md (Conditional) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' with: name: OperatorKernels.md path: ${{ github.workspace }}/docs/OperatorKernels.md - name: Publish ContribOperators.md (Conditional) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' with: name: ContribOperators.md diff --git a/.github/workflows/windows_x86.yml b/.github/workflows/windows_x86.yml index 751731057bd63..9decec65f03a3 100644 --- a/.github/workflows/windows_x86.yml +++ b/.github/workflows/windows_x86.yml @@ -110,14 +110,14 @@ jobs: working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" - name: Publish OperatorKernels.md (Conditional) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' with: name: OperatorKernels.md path: ${{ github.workspace }}/docs/OperatorKernels.md - name: Publish ContribOperators.md (Conditional) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' with: name: ContribOperators.md From 924523a5a41851de5078cacab0a2e6bc44d96999 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 17:13:06 -0700 Subject: [PATCH 21/42] update --- .github/workflows/windows_x64_debug_build_x64_debug.yml | 6 +++--- .github/workflows/windows_x64_release_build_x64_release.yml | 6 +++--- .../windows_x64_release_dnnl_build_x64_release.yml | 6 +++--- ...ric_interface_build_x64_release_ep_generic_interface.yml | 4 ++-- .../windows_x64_release_vitisai_build_x64_release.yml | 6 +++--- .../windows_x64_release_winml_build_x64_release_winml.yml | 6 +++--- .github/workflows/windows_x64_release_xnnpack.yml | 6 +++--- .github/workflows/windows_x86.yml | 6 +++--- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/windows_x64_debug_build_x64_debug.yml b/.github/workflows/windows_x64_debug_build_x64_debug.yml index 1539481784034..b99d76cacba18 100644 --- a/.github/workflows/windows_x64_debug_build_x64_debug.yml +++ b/.github/workflows/windows_x64_debug_build_x64_debug.yml @@ -35,7 +35,7 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\build" + working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 @@ -92,14 +92,14 @@ jobs: - name: Validate C# native delegates shell: cmd run: python tools\ValidateNativeDelegateAttributes.py - working-directory: ${{ github.workspace }}\csharp + working-directory: ${{ github.workspace }}\\csharp - name: Install onnxruntime wheel shell: pwsh run: | python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} - working-directory: "${{ github.workspace }}\build\Debug\Debug" + working-directory: "${{ github.workspace }}\\build\\Debug\\Debug" # Publish artifacts only on failure and if DocUpdateNeeded is true (example) - name: Publish OperatorKernels.md (Conditional) diff --git a/.github/workflows/windows_x64_release_build_x64_release.yml b/.github/workflows/windows_x64_release_build_x64_release.yml index 84d51096e8fd7..402416256a556 100644 --- a/.github/workflows/windows_x64_release_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_build_x64_release.yml @@ -35,7 +35,7 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\build" + working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 @@ -99,14 +99,14 @@ jobs: - name: Validate C# native delegates shell: cmd run: python tools\ValidateNativeDelegateAttributes.py - working-directory: ${{ github.workspace }}\csharp + working-directory: ${{ github.workspace }}\\csharp - name: Install onnxruntime wheel shell: pwsh run: | python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} - working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" + working-directory: "${{ github.workspace }}\\build\\RelWithDebInfo\\RelWithDebInfo" - name: Publish OperatorKernels.md (Conditional) uses: actions/upload-artifact@v4 diff --git a/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml b/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml index 8035dcfe9bea7..b5c7080191f8e 100644 --- a/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml @@ -35,7 +35,7 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\build" + working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 @@ -98,14 +98,14 @@ jobs: - name: Validate C# native delegates shell: cmd run: python tools\ValidateNativeDelegateAttributes.py - working-directory: ${{ github.workspace }}\csharp + working-directory: ${{ github.workspace }}\\csharp - name: Install onnxruntime wheel shell: pwsh run: | python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} - working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" + working-directory: "${{ github.workspace }}\\build\\RelWithDebInfo\\RelWithDebInfo" - name: Publish OperatorKernels.md (Conditional) uses: actions/upload-artifact@v4 diff --git a/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml b/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml index 680f16d933866..aae31e49ff437 100644 --- a/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml +++ b/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml @@ -35,7 +35,7 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\build" + working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 @@ -98,7 +98,7 @@ jobs: - name: Validate C# native delegates shell: cmd run: python tools\ValidateNativeDelegateAttributes.py - working-directory: ${{ github.workspace }}\csharp + working-directory: ${{ github.workspace }}\\csharp - name: Publish OperatorKernels.md (Conditional) uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' diff --git a/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml b/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml index 5160b1ac84059..e76463718eca5 100644 --- a/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml @@ -35,7 +35,7 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\build" + working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 @@ -98,7 +98,7 @@ jobs: - name: Validate C# native delegates shell: cmd run: python tools\ValidateNativeDelegateAttributes.py - working-directory: ${{ github.workspace }}\csharp + working-directory: ${{ github.workspace }}\\csharp - name: Install onnxruntime wheel shell: pwsh @@ -108,7 +108,7 @@ jobs: exit $LASTEXITCODE } Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} - working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" + working-directory: "${{ github.workspace }}\\build\\RelWithDebInfo\\RelWithDebInfo" env: OrtPackageId: Microsoft.ML.OnnxRuntime OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build diff --git a/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml b/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml index 15e8709d2e92a..24bf81195dc86 100644 --- a/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml +++ b/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml @@ -35,7 +35,7 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\build" + working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 @@ -99,14 +99,14 @@ jobs: - name: Validate C# native delegates shell: cmd run: python tools\ValidateNativeDelegateAttributes.py - working-directory: ${{ github.workspace }}\csharp + working-directory: ${{ github.workspace }}\\csharp - name: Install onnxruntime wheel # Keep this step, even no wheel file is built. shell: pwsh run: | python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} - working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" + working-directory: "${{ github.workspace }}\\build\\RelWithDebInfo\\RelWithDebInfo" - name: Publish OperatorKernels.md (Conditional) uses: actions/upload-artifact@v4 diff --git a/.github/workflows/windows_x64_release_xnnpack.yml b/.github/workflows/windows_x64_release_xnnpack.yml index 02aa8483c865b..6f3511b7528b1 100644 --- a/.github/workflows/windows_x64_release_xnnpack.yml +++ b/.github/workflows/windows_x64_release_xnnpack.yml @@ -35,7 +35,7 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\build" + working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 @@ -99,14 +99,14 @@ jobs: - name: Validate C# native delegates shell: cmd run: python tools\ValidateNativeDelegateAttributes.py - working-directory: ${{ github.workspace }}\csharp + working-directory: ${{ github.workspace }}\\csharp - name: Install onnxruntime wheel # Keep this step, even no wheel file is built. shell: pwsh run: | python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} - working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" + working-directory: "${{ github.workspace }}\\build\\RelWithDebInfo\\RelWithDebInfo" - name: Publish OperatorKernels.md (Conditional) uses: actions/upload-artifact@v4 diff --git a/.github/workflows/windows_x86.yml b/.github/workflows/windows_x86.yml index 9decec65f03a3..61cd8a798aa17 100644 --- a/.github/workflows/windows_x86.yml +++ b/.github/workflows/windows_x86.yml @@ -35,7 +35,7 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\build" + working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 @@ -100,14 +100,14 @@ jobs: - name: Validate C# native delegates shell: cmd run: python tools\ValidateNativeDelegateAttributes.py - working-directory: ${{ github.workspace }}\csharp + working-directory: ${{ github.workspace }}\\csharp - name: Install onnxruntime wheel shell: pwsh run: | python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} - working-directory: "${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo" + working-directory: "${{ github.workspace }}\\build\\RelWithDebInfo\\RelWithDebInfo" - name: Publish OperatorKernels.md (Conditional) uses: actions/upload-artifact@v4 From 42d572107675b9a2315d81fc19b10a33456ec0ee Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Wed, 12 Mar 2025 00:17:48 +0000 Subject: [PATCH 22/42] format code --- .../update_environment.py | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py b/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py index 7babb4cc4966a..9b63b26042562 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py +++ b/.github/actions/locate-vcvarsall-and-setup-env/update_environment.py @@ -1,35 +1,37 @@ import os import re + def read_env_file(filepath): env_vars = {} - with open(filepath, 'r') as f: + with open(filepath) as f: for line in f: - match = re.match(r'^(.*?)=(.*)$', line.strip()) + match = re.match(r"^(.*?)=(.*)$", line.strip()) if match: env_vars[match.group(1).upper()] = match.group(2) return env_vars -initial_env = read_env_file('initial_env.txt') -final_env = read_env_file('final_env.txt') + +initial_env = read_env_file("initial_env.txt") +final_env = read_env_file("final_env.txt") for key, value in final_env.items(): if key not in initial_env or initial_env[key] != value: if key.startswith("_"): - continue - if key.upper() == 'PATH': - new_paths = value.split(';') - initial_paths = initial_env.get('PATH','').split(';') + continue + if key.upper() == "PATH": + new_paths = value.split(";") + initial_paths = initial_env.get("PATH", "").split(";") added_paths = [p for p in new_paths if p not in initial_paths and p] if added_paths: print("Adding paths") - with open(os.environ['GITHUB_PATH'], 'a') as f: + with open(os.environ["GITHUB_PATH"], "a") as f: for path in added_paths: print(f"Adding PATH: {path}") f.write(path + os.linesep) else: # Use GITHUB_ENV - with open(os.environ['GITHUB_ENV'], 'a') as f: + with open(os.environ["GITHUB_ENV"], "a") as f: print(f"Setting {key}={value}\n") - f.write(f"{key}={value}\n") \ No newline at end of file + f.write(f"{key}={value}\n") From 3b061c178def7d3e38588614982fe25b9a338988 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 17:38:24 -0700 Subject: [PATCH 23/42] update --- .github/workflows/windows_x64_debug_build_x64_debug.yml | 1 - .github/workflows/windows_x64_release_build_x64_release.yml | 1 - .github/workflows/windows_x64_release_dnnl_build_x64_release.yml | 1 - ..._generic_interface_build_x64_release_ep_generic_interface.yml | 1 - .../workflows/windows_x64_release_vitisai_build_x64_release.yml | 1 - .../windows_x64_release_winml_build_x64_release_winml.yml | 1 - .github/workflows/windows_x64_release_xnnpack.yml | 1 - .github/workflows/windows_x86.yml | 1 - 8 files changed, 8 deletions(-) diff --git a/.github/workflows/windows_x64_debug_build_x64_debug.yml b/.github/workflows/windows_x64_debug_build_x64_debug.yml index b99d76cacba18..4f03e23605592 100644 --- a/.github/workflows/windows_x64_debug_build_x64_debug.yml +++ b/.github/workflows/windows_x64_debug_build_x64_debug.yml @@ -35,7 +35,6 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 diff --git a/.github/workflows/windows_x64_release_build_x64_release.yml b/.github/workflows/windows_x64_release_build_x64_release.yml index 402416256a556..b72888ba1bdfa 100644 --- a/.github/workflows/windows_x64_release_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_build_x64_release.yml @@ -35,7 +35,6 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 diff --git a/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml b/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml index b5c7080191f8e..fb27a9e1c0801 100644 --- a/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml @@ -35,7 +35,6 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 diff --git a/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml b/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml index aae31e49ff437..4cf4167c90b06 100644 --- a/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml +++ b/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml @@ -35,7 +35,6 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 diff --git a/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml b/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml index e76463718eca5..cb18b4a9afd2a 100644 --- a/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml @@ -35,7 +35,6 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 diff --git a/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml b/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml index 24bf81195dc86..16d34a1b5034a 100644 --- a/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml +++ b/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml @@ -35,7 +35,6 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 diff --git a/.github/workflows/windows_x64_release_xnnpack.yml b/.github/workflows/windows_x64_release_xnnpack.yml index 6f3511b7528b1..d2f4a48c00c74 100644 --- a/.github/workflows/windows_x64_release_xnnpack.yml +++ b/.github/workflows/windows_x64_release_xnnpack.yml @@ -35,7 +35,6 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 diff --git a/.github/workflows/windows_x86.yml b/.github/workflows/windows_x86.yml index 61cd8a798aa17..90b14a37eb2c0 100644 --- a/.github/workflows/windows_x86.yml +++ b/.github/workflows/windows_x86.yml @@ -35,7 +35,6 @@ jobs: - name: Install python modules shell: cmd run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - working-directory: "${{ github.workspace }}\\build" - name: Setup Node.js uses: actions/setup-node@v3 From 236e2ee843fd6dd7597715a84d8cf791ce1e0b78 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 17:43:43 -0700 Subject: [PATCH 24/42] update --- .github/workflows/windows_x64_debug_build_x64_debug.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/windows_x64_debug_build_x64_debug.yml b/.github/workflows/windows_x64_debug_build_x64_debug.yml index 4f03e23605592..c507192ecbc33 100644 --- a/.github/workflows/windows_x64_debug_build_x64_debug.yml +++ b/.github/workflows/windows_x64_debug_build_x64_debug.yml @@ -119,6 +119,4 @@ jobs: env: OrtPackageId: Microsoft.ML.OnnxRuntime OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' - TODAY: ${{ format('{0:dd}{0:MM}{0:yyyy}', github.event.head_commit.timestamp) }} # Or a different suitable date - workspace_clean: all # This seems to be unused \ No newline at end of file + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' \ No newline at end of file From 85ed8009e8fe3afabac2fe0576abc39ae5bad1f5 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 18:48:49 -0700 Subject: [PATCH 25/42] update --- ..._release_winml_build_x64_release_winml.yml | 127 ------------------ .github/workflows/windows_x86.yml | 2 +- 2 files changed, 1 insertion(+), 128 deletions(-) delete mode 100644 .github/workflows/windows_x64_release_winml_build_x64_release_winml.yml diff --git a/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml b/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml deleted file mode 100644 index 16d34a1b5034a..0000000000000 --- a/.github/workflows/windows_x64_release_winml_build_x64_release_winml.yml +++ /dev/null @@ -1,127 +0,0 @@ -name: build_x64_release_winml - -on: - push: - branches: [ main, 'rel-*'] - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build_x64_release_winml: - runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] - timeout-minutes: 300 - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: false - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.12' - architecture: x64 - - - name: Locate vcvarsall and Setup Env - uses: ./.github/actions/locate-vcvarsall-and-setup-env - with: - architecture: x64 - - - name: Install python modules - shell: cmd - run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '20.x' - - - name: Setup Java - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '17' - architecture: x64 - - - name: API Documentation Check and generate - shell: cmd - run: | - set ORT_DOXY_SRC=${{ github.workspace }} - set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo - mkdir %ORT_DOXY_SRC% - mkdir %ORT_DOXY_OUT% - "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg - working-directory: ${{ github.workspace }} - - - name: Use .NET 8.x - uses: actions/setup-dotnet@v3 - with: - dotnet-version: '8.x' - env: - PROCESSOR_ARCHITECTURE: x64 - - - name: Use Nuget 6.x - uses: nuget/setup-nuget@v1 - with: - nuget-version: '6.x' - - - name: NuGet restore - shell: cmd - run: | - nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\RelWithDebInfo -ConfigFile ${{ github.workspace }}\NuGet.config - - - name: Export GitHub Actions cache environment variables - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - - name: Build and Test - shell: pwsh - run: | - python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --use_winml --enable_wcos --disable_rtti --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache - if ($LASTEXITCODE -ne 0) { - exit $LASTEXITCODE - } - Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse - env: - ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' - DocUpdateNeeded: 'false' - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - - - name: Validate C# native delegates - shell: cmd - run: python tools\ValidateNativeDelegateAttributes.py - working-directory: ${{ github.workspace }}\\csharp - - - name: Install onnxruntime wheel # Keep this step, even no wheel file is built. - shell: pwsh - run: | - python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq - Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} - working-directory: "${{ github.workspace }}\\build\\RelWithDebInfo\\RelWithDebInfo" - - - name: Publish OperatorKernels.md (Conditional) - uses: actions/upload-artifact@v4 - if: failure() && env.DocUpdateNeeded == 'true' - with: - name: OperatorKernels.md - path: ${{ github.workspace }}/docs/OperatorKernels.md - - - name: Publish ContribOperators.md (Conditional) - uses: actions/upload-artifact@v4 - if: failure() && env.DocUpdateNeeded == 'true' - with: - name: ContribOperators.md - path: ${{ github.workspace }}/docs/ContribOperators.md - - env: - OrtPackageId: Microsoft.ML.OnnxRuntime - OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' diff --git a/.github/workflows/windows_x86.yml b/.github/workflows/windows_x86.yml index 90b14a37eb2c0..f56ff01208a6a 100644 --- a/.github/workflows/windows_x86.yml +++ b/.github/workflows/windows_x86.yml @@ -125,4 +125,4 @@ jobs: env: OrtPackageId: Microsoft.ML.OnnxRuntime OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true \ No newline at end of file + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' \ No newline at end of file From f8a91eac134a440cb9d50e758cea9563421cc7cd Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 19:07:14 -0700 Subject: [PATCH 26/42] update --- .github/workflows/windows_x64_release_xnnpack.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows_x64_release_xnnpack.yml b/.github/workflows/windows_x64_release_xnnpack.yml index d2f4a48c00c74..aa06f51334f55 100644 --- a/.github/workflows/windows_x64_release_xnnpack.yml +++ b/.github/workflows/windows_x64_release_xnnpack.yml @@ -1,4 +1,4 @@ -name: build_x64_release_winml +name: build_x64_release_xnnpack on: push: @@ -11,7 +11,7 @@ concurrency: cancel-in-progress: true jobs: - build_x64_release_winml: + build_x64_release_xnnpack: runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] timeout-minutes: 300 @@ -85,7 +85,7 @@ jobs: - name: Build and Test shell: pwsh run: | - python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --use_winml --enable_wcos --disable_rtti --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --use_xnnpack --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --disable_rtti --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } @@ -93,7 +93,7 @@ jobs: env: ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' DocUpdateNeeded: 'false' - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"' + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - name: Validate C# native delegates shell: cmd From 9042cb20c1d416cb3f1c969b6383027585f9b5b8 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 20:02:49 -0700 Subject: [PATCH 27/42] update --- tools/ci_build/build.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index db7dbed23a2d2..5d1e1db3870cb 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1069,6 +1069,10 @@ def generate_vcpkg_install_options(build_dir, args): if "AGENT_TEMPDIRECTORY" in os.environ: temp_dir = os.environ["AGENT_TEMPDIRECTORY"] vcpkg_install_options.append(f"--x-buildtrees-root={temp_dir}") + elif "RUNNER_TEMP" in os.environ: + temp_dir = os.environ["RUNNER_TEMP"] + vcpkg_install_options.append(f"--x-buildtrees-root={temp_dir}") + vcpkg_install_options.append(f"--binarysource=clear;x-gha,readwrite") # Config asset cache if args.use_vcpkg_ms_internal_asset_cache: From 2c20d2816335fb7aec4d1ff53416a18884e7f209 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 20:04:57 -0700 Subject: [PATCH 28/42] update --- .github/workflows/windows_build_x64_asan.yml | 2 - .github/workflows/windows_build_x86_asan.yml | 49 ------------------- .../windows_x64_release_build_x64_release.yml | 1 - ...ows_x64_release_dnnl_build_x64_release.yml | 1 - ...build_x64_release_ep_generic_interface.yml | 1 - ..._x64_release_vitisai_build_x64_release.yml | 1 - .../workflows/windows_x64_release_xnnpack.yml | 1 - .github/workflows/windows_x86.yml | 1 - 8 files changed, 57 deletions(-) delete mode 100644 .github/workflows/windows_build_x86_asan.yml diff --git a/.github/workflows/windows_build_x64_asan.yml b/.github/workflows/windows_build_x64_asan.yml index 343771a94d4b2..0d31678c7d6f7 100644 --- a/.github/workflows/windows_build_x64_asan.yml +++ b/.github/workflows/windows_build_x64_asan.yml @@ -42,8 +42,6 @@ jobs: - name: Build and Test (Combined) shell: cmd - env: - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" run: | @echo off echo %PATH% diff --git a/.github/workflows/windows_build_x86_asan.yml b/.github/workflows/windows_build_x86_asan.yml deleted file mode 100644 index 99fb27cd6f8d8..0000000000000 --- a/.github/workflows/windows_build_x86_asan.yml +++ /dev/null @@ -1,49 +0,0 @@ -# .github/workflows/build_x86_asan.yml -name: build_x86_asan - -on: - push: - branches: [ main, 'rel-*'] - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build_x86: - runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] - timeout-minutes: 300 - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: false - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.12' - architecture: x86 - - - name: Locate vcvarsall and Setup Env - uses: ./.github/actions/locate-vcvarsall-and-setup-env # Use the composite action - with: - architecture: x86 - - - name: Export GitHub Actions cache environment variables - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Build and Test (Combined) - shell: cmd - env: - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - run: | - @echo off - python -m pip install -r "%GITHUB_WORKSPACE%\tools/ci_build/github/windows\python\requirements.txt" - python "%GITHUB_WORKSPACE%\tools\ci_build\build.py" --config Debug --build_dir "%RUNNER_TEMP%\build" --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer \ No newline at end of file diff --git a/.github/workflows/windows_x64_release_build_x64_release.yml b/.github/workflows/windows_x64_release_build_x64_release.yml index b72888ba1bdfa..f69fa2adf0056 100644 --- a/.github/workflows/windows_x64_release_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_build_x64_release.yml @@ -93,7 +93,6 @@ jobs: env: ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' DocUpdateNeeded: 'false' - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - name: Validate C# native delegates shell: cmd diff --git a/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml b/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml index fb27a9e1c0801..d1fdac7f979d8 100644 --- a/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml @@ -92,7 +92,6 @@ jobs: Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse env: ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - name: Validate C# native delegates shell: cmd diff --git a/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml b/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml index 4cf4167c90b06..61dded165e192 100644 --- a/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml +++ b/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml @@ -92,7 +92,6 @@ jobs: Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse env: ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - name: Validate C# native delegates shell: cmd diff --git a/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml b/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml index cb18b4a9afd2a..8a96ea45f973c 100644 --- a/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml @@ -92,7 +92,6 @@ jobs: Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse env: ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - name: Validate C# native delegates shell: cmd diff --git a/.github/workflows/windows_x64_release_xnnpack.yml b/.github/workflows/windows_x64_release_xnnpack.yml index aa06f51334f55..657340ac860e3 100644 --- a/.github/workflows/windows_x64_release_xnnpack.yml +++ b/.github/workflows/windows_x64_release_xnnpack.yml @@ -93,7 +93,6 @@ jobs: env: ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' DocUpdateNeeded: 'false' - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - name: Validate C# native delegates shell: cmd diff --git a/.github/workflows/windows_x86.yml b/.github/workflows/windows_x86.yml index f56ff01208a6a..20f1bcd54cb1a 100644 --- a/.github/workflows/windows_x86.yml +++ b/.github/workflows/windows_x86.yml @@ -94,7 +94,6 @@ jobs: env: ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' DocUpdateNeeded: 'false' - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - name: Validate C# native delegates shell: cmd From 77c52abe88ad118ec864edfe72567f570ebfdd51 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 20:08:22 -0700 Subject: [PATCH 29/42] Update tools/ci_build/build.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- tools/ci_build/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 5d1e1db3870cb..2c9436c840a6b 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1072,7 +1072,7 @@ def generate_vcpkg_install_options(build_dir, args): elif "RUNNER_TEMP" in os.environ: temp_dir = os.environ["RUNNER_TEMP"] vcpkg_install_options.append(f"--x-buildtrees-root={temp_dir}") - vcpkg_install_options.append(f"--binarysource=clear;x-gha,readwrite") + vcpkg_install_options.append("--binarysource=clear;x-gha,readwrite") # Config asset cache if args.use_vcpkg_ms_internal_asset_cache: From fce632f06b7be81a0c26af3382c50d6d3a623f7f Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 20:57:58 -0700 Subject: [PATCH 30/42] update --- tools/ci_build/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 5d1e1db3870cb..a634b826f8eb4 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1072,7 +1072,7 @@ def generate_vcpkg_install_options(build_dir, args): elif "RUNNER_TEMP" in os.environ: temp_dir = os.environ["RUNNER_TEMP"] vcpkg_install_options.append(f"--x-buildtrees-root={temp_dir}") - vcpkg_install_options.append(f"--binarysource=clear;x-gha,readwrite") + vcpkg_install_options.append(f"--binarysource=clear\;x-gha,readwrite") # Config asset cache if args.use_vcpkg_ms_internal_asset_cache: From fbfcb384803a280a4d5b682d840d0db3714e0e7b Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 21:01:46 -0700 Subject: [PATCH 31/42] update --- .github/workflows/windows_build_x64_asan.yml | 2 +- .github/workflows/windows_x64_debug_build_x64_debug.yml | 2 +- .github/workflows/windows_x64_release_build_x64_release.yml | 2 +- .../workflows/windows_x64_release_dnnl_build_x64_release.yml | 2 +- ...generic_interface_build_x64_release_ep_generic_interface.yml | 2 +- .../workflows/windows_x64_release_vitisai_build_x64_release.yml | 2 +- .github/workflows/windows_x64_release_xnnpack.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/windows_build_x64_asan.yml b/.github/workflows/windows_build_x64_asan.yml index 0d31678c7d6f7..6be647c86eab8 100644 --- a/.github/workflows/windows_build_x64_asan.yml +++ b/.github/workflows/windows_build_x64_asan.yml @@ -1,5 +1,5 @@ # .github/workflows/build_x64_asan.yml -name: build_x64_asan +name: windows_x64_asan on: push: diff --git a/.github/workflows/windows_x64_debug_build_x64_debug.yml b/.github/workflows/windows_x64_debug_build_x64_debug.yml index c507192ecbc33..51dbf80636653 100644 --- a/.github/workflows/windows_x64_debug_build_x64_debug.yml +++ b/.github/workflows/windows_x64_debug_build_x64_debug.yml @@ -1,4 +1,4 @@ -name: build_x64_debug +name: windows_x64_debug on: push: diff --git a/.github/workflows/windows_x64_release_build_x64_release.yml b/.github/workflows/windows_x64_release_build_x64_release.yml index f69fa2adf0056..9f8f650e906dc 100644 --- a/.github/workflows/windows_x64_release_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_build_x64_release.yml @@ -1,4 +1,4 @@ -name: build_x64_release +name: windows_x64_release on: push: diff --git a/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml b/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml index d1fdac7f979d8..2f8f7dfff145d 100644 --- a/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml @@ -1,4 +1,4 @@ -name: build_x64_release +name: windows_x64_release on: push: diff --git a/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml b/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml index 61dded165e192..9c280da27e8bc 100644 --- a/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml +++ b/.github/workflows/windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml @@ -1,4 +1,4 @@ -name: build_x64_release_ep_generic_interface +name: windows_x64_release_ep_generic_interface on: push: diff --git a/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml b/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml index 8a96ea45f973c..ec4ccef5390d2 100644 --- a/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml @@ -1,4 +1,4 @@ -name: build_x64_release_vitisai +name: windows_x64_release_vitisai on: push: diff --git a/.github/workflows/windows_x64_release_xnnpack.yml b/.github/workflows/windows_x64_release_xnnpack.yml index 657340ac860e3..76f028a9c810b 100644 --- a/.github/workflows/windows_x64_release_xnnpack.yml +++ b/.github/workflows/windows_x64_release_xnnpack.yml @@ -1,4 +1,4 @@ -name: build_x64_release_xnnpack +name: windows_x64_release_xnnpack on: push: From e4686d910eaa32f076b40609262c9bc6df2f45a4 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 21:16:13 -0700 Subject: [PATCH 32/42] update --- tools/ci_build/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 7df5f70a77cbf..b08dc566e2e87 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1072,7 +1072,7 @@ def generate_vcpkg_install_options(build_dir, args): elif "RUNNER_TEMP" in os.environ: temp_dir = os.environ["RUNNER_TEMP"] vcpkg_install_options.append(f"--x-buildtrees-root={temp_dir}") - vcpkg_install_options.append("--binarysource=clear\;x-gha,readwrite") + vcpkg_install_options.append("--binarysource=clear\\;x-gha,readwrite") # Config asset cache if args.use_vcpkg_ms_internal_asset_cache: From beb540bfe31990a706cacedca1f6651057342f7f Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 21:34:11 -0700 Subject: [PATCH 33/42] update --- .github/workflows/windows_x64_debug_build_x64_debug.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/windows_x64_debug_build_x64_debug.yml b/.github/workflows/windows_x64_debug_build_x64_debug.yml index 51dbf80636653..081f8dc57a107 100644 --- a/.github/workflows/windows_x64_debug_build_x64_debug.yml +++ b/.github/workflows/windows_x64_debug_build_x64_debug.yml @@ -75,6 +75,13 @@ jobs: run: | nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\Debug -ConfigFile ${{ github.workspace }}\NuGet.config + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Build and Test shell: pwsh run: | From 202afef8201450a0a7a745d40038e86f0d07485a Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 22:21:02 -0700 Subject: [PATCH 34/42] update --- .github/workflows/windows_x64_release_xnnpack.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/windows_x64_release_xnnpack.yml b/.github/workflows/windows_x64_release_xnnpack.yml index 76f028a9c810b..13e830505513d 100644 --- a/.github/workflows/windows_x64_release_xnnpack.yml +++ b/.github/workflows/windows_x64_release_xnnpack.yml @@ -99,13 +99,6 @@ jobs: run: python tools\ValidateNativeDelegateAttributes.py working-directory: ${{ github.workspace }}\\csharp - - name: Install onnxruntime wheel # Keep this step, even no wheel file is built. - shell: pwsh - run: | - python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq - Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} - working-directory: "${{ github.workspace }}\\build\\RelWithDebInfo\\RelWithDebInfo" - - name: Publish OperatorKernels.md (Conditional) uses: actions/upload-artifact@v4 if: failure() && env.DocUpdateNeeded == 'true' From 93c995ff1030a74dd570eb0e9b7debc75085affa Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 22:34:46 -0700 Subject: [PATCH 35/42] update --- .github/workflows/macos_coreml.yml | 51 ++++++++++++++ .../mac-coreml-ci-pipeline.yml | 68 ------------------- 2 files changed, 51 insertions(+), 68 deletions(-) create mode 100644 .github/workflows/macos_coreml.yml delete mode 100644 tools/ci_build/github/azure-pipelines/mac-coreml-ci-pipeline.yml diff --git a/.github/workflows/macos_coreml.yml b/.github/workflows/macos_coreml.yml new file mode 100644 index 0000000000000..099d94385b6d5 --- /dev/null +++ b/.github/workflows/macos_coreml.yml @@ -0,0 +1,51 @@ +name: "CoreML CI Pipeline" + +on: + push: + branches: + - main + - rel-* + pull_request: + branches: + - main + - rel-* + +jobs: + build_with_coreml: + runs-on: macos-13 + strategy: + matrix: + use_coreml: [true, false] + + env: + MACOSX_DEPLOYMENT_TARGET: '13.3' + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install coreutils and ninja + run: brew install coreutils ninja + + - name: Use Xcode 14.3.1 + run: | + XCODE_DEVELOPER_DIR="/Applications/Xcode_14.3.1.app/Contents/Developer" + sudo xcode-select --switch "${XCODE_DEVELOPER_DIR}" + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: CoreML EP, Build and Test on macOS + run: | + python3 tools/ci_build/build.py \ + --build_dir build \ + --skip_submodule_sync \ + --cmake_generator=Ninja \ + --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --use_binskim_compliant_compile_flags \ + --build_shared_lib \ + --config Debug \ + ${{ matrix.use_coreml && '--use_coreml' || '' }} \ No newline at end of file diff --git a/tools/ci_build/github/azure-pipelines/mac-coreml-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/mac-coreml-ci-pipeline.yml deleted file mode 100644 index 42f5340730a69..0000000000000 --- a/tools/ci_build/github/azure-pipelines/mac-coreml-ci-pipeline.yml +++ /dev/null @@ -1,68 +0,0 @@ -##### start trigger Don't edit it manually, Please do edit set-trigger-rules.py #### -### please do rerun set-trigger-rules.py ### -trigger: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -pr: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -#### end trigger #### - -jobs: -- job: CoreML_CI - workspace: - clean: all - pool: - vmImage: 'macOS-13' - variables: - MACOSX_DEPLOYMENT_TARGET: '13.3' - TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] - CCACHE_DIR: '$(Pipeline.Workspace)/ccache' - timeoutInMinutes: 120 - steps: - - script: brew install coreutils ninja - displayName: Install coreutils and ninja - - - template: templates/use-xcode-version.yml - - - template: templates/mac-build-step-with-cache.yml - parameters: - WithCache: true - Today: $(TODAY) - AdditionalKey: coreml - CacheDir: $(CCACHE_DIR) - BuildStep: - - script: | - set -e - python3 tools/ci_build/build.py \ - --build_dir build \ - --skip_submodule_sync \ - --cmake_generator=Ninja \ - --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --use_binskim_compliant_compile_flags \ - --build_shared_lib \ - --config Debug \ - --use_cache \ - --use_coreml - displayName: CoreML EP, Build and Test on macOS - env: - CCACHE_COMPILERCHECK: content From caab691ededb8be9fdd600f5319ef6b61bd72b57 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 22:55:10 -0700 Subject: [PATCH 36/42] update --- .github/workflows/mac.yml | 138 +++++++++++++++++- .../azure-pipelines/mac-ci-pipeline.yml | 37 ----- 2 files changed, 137 insertions(+), 38 deletions(-) delete mode 100644 tools/ci_build/github/azure-pipelines/mac-ci-pipeline.yml diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 3218afe11edfd..db149c077df71 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -1,4 +1,4 @@ -name: Mac_CI +name: "MacOS CI Pipeline" on: push: @@ -19,6 +19,142 @@ env: python_version: 3.11 jobs: + MacOS_C_API_Packaging_CPU_x86_64: + runs-on: macos-13 + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + + - name: Use Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.python_version }} + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Install Java 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: Set version number variables for Unix + shell: bash + run: | + # Do not output ##vso[] commands with `set -x` or they may be parsed again and include a trailing quote. + set +x + + _OnnxRuntimeVersion=$(head -1 ${{ github.workspace }}/VERSION_NUMBER) + echo "OnnxRuntimeVersion=$_OnnxRuntimeVersion" + + _OnnxRuntimeGitCommitHash=$(git rev-parse HEAD) + echo "OnnxRuntimeGitCommitHash=$_OnnxRuntimeGitCommitHash" + + _OnnxRuntimeGitCommitHash=$(git rev-parse --short=8 HEAD) + echo "OnnxRuntimeGitCommitHashShort=$_OnnxRuntimeGitCommitHash" + working-directory: ${{ github.workspace }} + + - name: Use Xcode 14.3.1 + shell: bash + run: | + set -e -x + XCODE_DEVELOPER_DIR="/Applications/Xcode_14.3.1.app/Contents/Developer" + sudo xcode-select --switch "${XCODE_DEVELOPER_DIR}" + + - name: Setup environment variables + shell: bash + run: | + set -e -x + export PATH=${{ github.workspace }}/installed/bin:$PATH + export ONNX_ML=1 + export CMAKE_ARGS="-DONNX_GEN_PB_TYPE_STUBS=ON -DONNX_WERROR=OFF" + python3 -m pip install -r '${{ github.workspace }}/tools/ci_build/github/linux/docker/scripts/requirements.txt' + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Configure Build (build.py --update) + shell: bash + run: | + set -e -x + rm -rf ${{ github.workspace }}/Release + python3 ${{ github.workspace }}/tools/ci_build/build.py --update --build_objc --build_wheel --use_xnnpack --build_nodejs --build_java --use_coreml --use_webgpu --build_dir ${{ github.workspace }} --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --use_binskim_compliant_compile_flags --build_shared_lib --config Release --use_vcpkg --use_vcpkg_ms_internal_asset_cache + + - name: Build (build.py --build) + shell: bash + run: | + set -e -x + python3 ${{ github.workspace }}/tools/ci_build/build.py --build --build_objc --build_wheel --use_xnnpack --build_nodejs --build_java --use_coreml --use_webgpu --build_dir ${{ github.workspace }} --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --use_binskim_compliant_compile_flags --build_shared_lib --config Release --use_vcpkg --use_vcpkg_ms_internal_asset_cache + + - name: Install + shell: bash + run: | + set -e -x + cd ${{ github.workspace }}/Release + make install DESTDIR=${{ github.workspace }}/installed + + - name: Running Tests (build.py --test) + shell: bash + run: | + set -e -x + python3 ${{ github.workspace }}/tools/ci_build/build.py --test --build_objc --build_wheel --use_xnnpack --build_nodejs --build_java --use_coreml --use_webgpu --build_dir ${{ github.workspace }} --skip_submodule_sync --parallel --use_binskim_compliant_compile_flags --build_shared_lib --config Release --use_vcpkg --use_vcpkg_ms_internal_asset_cache + + - name: Copy build artifacts for zipping + uses: ./tools/ci_build/github/linux/copy_strip_binary.sh + with: + args: -r ${{ github.workspace }} -a onnxruntime-osx-x86_64-${{ env.OnnxRuntimeVersion }} -l libonnxruntime.${{ env.OnnxRuntimeVersion }}.dylib -c Release -s ${{ github.workspace }} -t ${{ env.OnnxRuntimeGitCommitHash }} + working-directory: ${{ github.workspace }}/Release + + - name: Archive build artifacts + uses: actions/upload-artifact@v4 + with: + name: onnxruntime-osx-x86_64 + path: ${{ github.workspace }}/onnxruntime-osx-x86_64-${{ env.OnnxRuntimeVersion }} + + - name: Copy libcustom_op_library.dylib to ArtifactStagingDirectory + shell: bash + run: | + set -e -x + mkdir -p ${{ runner.temp }}/testdata + cp ${{ github.workspace }}/Release/libcustom_op_library.dylib ${{ runner.temp }}/testdata + + - name: Upload libcustom_op_library + uses: actions/upload-artifact@v4 + with: + name: onnxruntime-osx-x86_64-extra-libs + path: ${{ runner.temp }}/testdata + + - name: Copy build artifacts for zipping + uses: ./tools/ci_build/github/linux/java_copy_strip_binary.sh + with: + args: -r ${{ github.workspace }} -c Release -a onnxruntime-java-osx-x86_64 -l libonnxruntime.dylib -n libonnxruntime4j_jni.dylib -v ${{ env.OnnxRuntimeVersion }} -h osx-x86_64 + working-directory: ${{ github.workspace }}/Release + - name: Upload java build artifacts + uses: actions/upload-artifact@v4 + with: + name: drop-onnxruntime-java-osx-x86_64 + path: ${{ github.workspace }}/onnxruntime-java-osx-x86_64 + + - name: Upload nodejs build artifacts + uses: actions/upload-artifact@v4 + with: + name: drop-onnxruntime-nodejs-osx-x86_64 + path: ${{ github.workspace }}/js/node/bin/napi-v3/darwin/x64/onnxruntime_binding.node + timeout-minutes: 300 + env: + MACOSX_DEPLOYMENT_TARGET: '13.3' + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + ARM64-Xcode16: runs-on: macos-15 diff --git a/tools/ci_build/github/azure-pipelines/mac-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/mac-ci-pipeline.yml deleted file mode 100644 index f3465a8eea8b5..0000000000000 --- a/tools/ci_build/github/azure-pipelines/mac-ci-pipeline.yml +++ /dev/null @@ -1,37 +0,0 @@ -##### start trigger Don't edit it manually, Please do edit set-trigger-rules.py #### -### please do rerun set-trigger-rules.py ### -trigger: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -pr: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -#### end trigger #### - -stages: -- template: templates/mac-cpu-packaging-pipeline.yml - parameters: - AllowReleasedOpsetOnly: 0 - BuildForAllArchs: false - AdditionalBuildFlags: --build_objc --build_wheel --use_xnnpack - WithCache: true From 450c22de4349924ac5d46ef11bb553bbbc057e8c Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 22:57:20 -0700 Subject: [PATCH 37/42] update --- .github/workflows/mac.yml | 42 --------------------------------------- 1 file changed, 42 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index db149c077df71..eb4befaa34244 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -108,48 +108,6 @@ jobs: run: | set -e -x python3 ${{ github.workspace }}/tools/ci_build/build.py --test --build_objc --build_wheel --use_xnnpack --build_nodejs --build_java --use_coreml --use_webgpu --build_dir ${{ github.workspace }} --skip_submodule_sync --parallel --use_binskim_compliant_compile_flags --build_shared_lib --config Release --use_vcpkg --use_vcpkg_ms_internal_asset_cache - - - name: Copy build artifacts for zipping - uses: ./tools/ci_build/github/linux/copy_strip_binary.sh - with: - args: -r ${{ github.workspace }} -a onnxruntime-osx-x86_64-${{ env.OnnxRuntimeVersion }} -l libonnxruntime.${{ env.OnnxRuntimeVersion }}.dylib -c Release -s ${{ github.workspace }} -t ${{ env.OnnxRuntimeGitCommitHash }} - working-directory: ${{ github.workspace }}/Release - - - name: Archive build artifacts - uses: actions/upload-artifact@v4 - with: - name: onnxruntime-osx-x86_64 - path: ${{ github.workspace }}/onnxruntime-osx-x86_64-${{ env.OnnxRuntimeVersion }} - - - name: Copy libcustom_op_library.dylib to ArtifactStagingDirectory - shell: bash - run: | - set -e -x - mkdir -p ${{ runner.temp }}/testdata - cp ${{ github.workspace }}/Release/libcustom_op_library.dylib ${{ runner.temp }}/testdata - - - name: Upload libcustom_op_library - uses: actions/upload-artifact@v4 - with: - name: onnxruntime-osx-x86_64-extra-libs - path: ${{ runner.temp }}/testdata - - - name: Copy build artifacts for zipping - uses: ./tools/ci_build/github/linux/java_copy_strip_binary.sh - with: - args: -r ${{ github.workspace }} -c Release -a onnxruntime-java-osx-x86_64 -l libonnxruntime.dylib -n libonnxruntime4j_jni.dylib -v ${{ env.OnnxRuntimeVersion }} -h osx-x86_64 - working-directory: ${{ github.workspace }}/Release - - name: Upload java build artifacts - uses: actions/upload-artifact@v4 - with: - name: drop-onnxruntime-java-osx-x86_64 - path: ${{ github.workspace }}/onnxruntime-java-osx-x86_64 - - - name: Upload nodejs build artifacts - uses: actions/upload-artifact@v4 - with: - name: drop-onnxruntime-nodejs-osx-x86_64 - path: ${{ github.workspace }}/js/node/bin/napi-v3/darwin/x64/onnxruntime_binding.node timeout-minutes: 300 env: MACOSX_DEPLOYMENT_TARGET: '13.3' From 29675e5b690c8025ffcbd1cfe844ea1bcecdea97 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 23:34:59 -0700 Subject: [PATCH 38/42] update --- .github/workflows/ios.yml | 59 ++++++++++++++ .github/workflows/macos_coreml.yml | 12 +-- .../azure-pipelines/mac-ios-ci-pipeline.yml | 81 ------------------- 3 files changed, 65 insertions(+), 87 deletions(-) create mode 100644 .github/workflows/ios.yml delete mode 100644 tools/ci_build/github/azure-pipelines/mac-ios-ci-pipeline.yml diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml new file mode 100644 index 0000000000000..b4cb0adc47b66 --- /dev/null +++ b/.github/workflows/ios.yml @@ -0,0 +1,59 @@ +name: iOS_CI_on_Mac + +on: + push: + branches: [ main, 'rel-*'] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + iOS_CI_on_Mac: + runs-on: macos-13 + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: false + - name: Use Xcode ${{ env.XCODE_VERSION }} + shell: bash + run: | + set -e -x + XCODE_DEVELOPER_DIR="/Applications/Xcode_${{ env.XCODE_VERSION }}.app/Contents/Developer" + sudo xcode-select --switch "${XCODE_DEVELOPER_DIR}" + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: (CPU, CoreML, XNNPACK EPs) Build onnxruntime for iOS x86_64 and run tests using simulator + shell: bash + run: | + python3 ${{ github.workspace }}/tools/ci_build/build.py \ + --skip_submodule_sync \ + --build_dir ${{ github.workspace }}/iOS \ + --build_shared_lib \ + --use_coreml \ + --use_xnnpack \ + --ios \ + --apple_sysroot iphonesimulator \ + --osx_arch x86_64 \ + --apple_deploy_target=15.1 \ + --use_xcode \ + --config RelWithDebInfo \ + --build_apple_framework \ + --parallel \ + --use_binskim_compliant_compile_flags + env: + ORT_GET_SIMULATOR_DEVICE_INFO_REQUESTED_RUNTIME_VERSION: ${{ env.IOS_SIMULATOR_RUNTIME_VERSION }} + + timeout-minutes: 150 + env: + XCODE_VERSION: 14.3.1 + IOS_SIMULATOR_RUNTIME_VERSION: 16.4 \ No newline at end of file diff --git a/.github/workflows/macos_coreml.yml b/.github/workflows/macos_coreml.yml index 099d94385b6d5..42b9ec702661b 100644 --- a/.github/workflows/macos_coreml.yml +++ b/.github/workflows/macos_coreml.yml @@ -2,13 +2,13 @@ name: "CoreML CI Pipeline" on: push: - branches: - - main - - rel-* + branches: [ main, 'rel-*'] pull_request: - branches: - - main - - rel-* + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: build_with_coreml: diff --git a/tools/ci_build/github/azure-pipelines/mac-ios-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/mac-ios-ci-pipeline.yml deleted file mode 100644 index 26b072ed55b04..0000000000000 --- a/tools/ci_build/github/azure-pipelines/mac-ios-ci-pipeline.yml +++ /dev/null @@ -1,81 +0,0 @@ -##### start trigger Don't edit it manually, Please do edit set-trigger-rules.py #### -### please do rerun set-trigger-rules.py ### -trigger: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -pr: - branches: - include: - - main - - rel-* - paths: - exclude: - - docs/** - - README.md - - CONTRIBUTING.md - - BUILD.md - - 'js/web' - - 'onnxruntime/core/providers/js' -#### end trigger #### - -jobs: -- job: iOS_CI_on_Mac - pool: - vmImage: 'macOS-13' - variables: - PROTO_CACHE_DIR: $(Pipeline.Workspace)/proto_ccache - ORT_CACHE_DIR: $(Pipeline.Workspace)/ort_ccache - TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] - # Note: Keep the Xcode version and iOS simulator version compatible. - # Check the table here to see what iOS simulator versions are supported by a particular Xcode version: - # https://developer.apple.com/support/xcode/ - XCODE_VERSION: 14.3.1 - IOS_SIMULATOR_RUNTIME_VERSION: 16.4 - timeoutInMinutes: 150 - steps: - - template: templates/use-xcode-version.yml - parameters: - xcodeVersion: $(XCODE_VERSION) - - - template: templates/mac-build-step-with-cache.yml - parameters: - WithCache: true - Today: $(TODAY) - AdditionalKey: onnxruntime - CacheDir: $(ORT_CACHE_DIR) - ChangeEveryCommit: true - BuildStep: - - script: | - python3 $(Build.SourcesDirectory)/tools/ci_build/build.py \ - --skip_submodule_sync \ - --build_dir $(Build.BinariesDirectory)/iOS \ - --build_shared_lib \ - --use_coreml \ - --use_xnnpack \ - --ios \ - --apple_sysroot iphonesimulator \ - --osx_arch x86_64 \ - --apple_deploy_target=15.1 \ - --use_xcode \ - --config RelWithDebInfo \ - --build_apple_framework \ - --parallel --use_binskim_compliant_compile_flags - displayName: (CPU, CoreML, XNNPACK EPs) Build onnxruntime for iOS x86_64 and run tests using simulator - env: - CC: clang - CXX: clang++ - CCACHE_CPP2: 1 - CCACHE_DEPEND: 1 - CCACHE_SLOPPINESS: modules - CCACHE_DIR: $(ORT_CACHE_DIR) - ORT_GET_SIMULATOR_DEVICE_INFO_REQUESTED_RUNTIME_VERSION: $(IOS_SIMULATOR_RUNTIME_VERSION) From 8012037586a1e9aad17516a19e3f60d3c10fccc8 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 23:49:43 -0700 Subject: [PATCH 39/42] fix --- .../workflows/windows_x64_release_dnnl_build_x64_release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml b/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml index 2f8f7dfff145d..af5ad4b68b6dc 100644 --- a/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml @@ -1,4 +1,4 @@ -name: windows_x64_release +name: windows_x64_dnnl_release on: push: @@ -85,7 +85,7 @@ jobs: - name: Build and Test shell: pwsh run: | - python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_wheel --build_java --build_nodejs --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache + python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_wheel --build_java --build_nodejs --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache --use_dnnl if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } From c922a6857a5e034a7686120d59f580237050c028 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 11 Mar 2025 23:54:13 -0700 Subject: [PATCH 40/42] update --- .github/workflows/windows_x64_release_build_x64_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows_x64_release_build_x64_release.yml b/.github/workflows/windows_x64_release_build_x64_release.yml index 9f8f650e906dc..77b7aa261ffcb 100644 --- a/.github/workflows/windows_x64_release_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_build_x64_release.yml @@ -12,7 +12,7 @@ concurrency: jobs: build_x64_release: - runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + runs-on: ${{ github.repository == 'microsoft/onnxruntime' ? ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] : 'ubuntu-latest' }} timeout-minutes: 300 steps: From 2c952a01f96cbf35fffc14f97ce2a7f28d9b8e61 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Wed, 12 Mar 2025 00:05:03 -0700 Subject: [PATCH 41/42] revert --- .github/workflows/windows_x64_release_build_x64_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows_x64_release_build_x64_release.yml b/.github/workflows/windows_x64_release_build_x64_release.yml index 77b7aa261ffcb..9f8f650e906dc 100644 --- a/.github/workflows/windows_x64_release_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_build_x64_release.yml @@ -12,7 +12,7 @@ concurrency: jobs: build_x64_release: - runs-on: ${{ github.repository == 'microsoft/onnxruntime' ? ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] : 'ubuntu-latest' }} + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] timeout-minutes: 300 steps: From dd62738cb3a77d0d5b3c3e3fda67cd6dc19192e7 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Wed, 12 Mar 2025 09:23:23 -0700 Subject: [PATCH 42/42] update --- ...ows_x64_release_dnnl_build_x64_release.yml | 125 ------------------ 1 file changed, 125 deletions(-) delete mode 100644 .github/workflows/windows_x64_release_dnnl_build_x64_release.yml diff --git a/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml b/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml deleted file mode 100644 index af5ad4b68b6dc..0000000000000 --- a/.github/workflows/windows_x64_release_dnnl_build_x64_release.yml +++ /dev/null @@ -1,125 +0,0 @@ -name: windows_x64_dnnl_release - -on: - push: - branches: [ main, 'rel-*'] - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build_x64_release: - runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] - timeout-minutes: 300 - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: false - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.12' - architecture: x64 - - - name: Locate vcvarsall and Setup Env - uses: ./.github/actions/locate-vcvarsall-and-setup-env - with: - architecture: x64 - - - name: Install python modules - shell: cmd - run: python -m pip install -r "${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt" - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '20.x' - - - name: Setup Java - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '17' - architecture: x64 - - - name: API Documentation Check and generate - shell: cmd - run: | - set ORT_DOXY_SRC=${{ github.workspace }} - set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo - mkdir %ORT_DOXY_SRC% - mkdir %ORT_DOXY_OUT% - "C:\Program Files\doxygen\bin\doxygen.exe" ${{ github.workspace }}\tools\ci_build\github\Doxyfile_csharp.cfg - working-directory: ${{ github.workspace }} - - - name: Use .NET 8.x - uses: actions/setup-dotnet@v3 - with: - dotnet-version: '8.x' - env: - PROCESSOR_ARCHITECTURE: x64 - - - name: Use Nuget 6.x - uses: nuget/setup-nuget@v1 - with: - nuget-version: '6.x' - - - name: NuGet restore - shell: cmd - run: | - nuget restore ${{ github.workspace }}\packages.config -PackagesDirectory ${{ github.workspace }}\build\RelWithDebInfo -ConfigFile ${{ github.workspace }}\NuGet.config - - - name: Export GitHub Actions cache environment variables - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - - name: Build and Test - shell: pwsh - run: | - python.exe "${{ github.workspace }}\tools\ci_build\build.py" --config RelWithDebInfo --build_dir "${{ github.workspace }}\build" --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_wheel --build_java --build_nodejs --msbuild_extra_options "IncludeMobileTargets=false" --build_nuget --use_vcpkg --use_vcpkg_ms_internal_asset_cache --use_dnnl - if ($LASTEXITCODE -ne 0) { - exit $LASTEXITCODE - } - Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse - env: - ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' - - - name: Validate C# native delegates - shell: cmd - run: python tools\ValidateNativeDelegateAttributes.py - working-directory: ${{ github.workspace }}\\csharp - - - name: Install onnxruntime wheel - shell: pwsh - run: | - python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq - Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} - working-directory: "${{ github.workspace }}\\build\\RelWithDebInfo\\RelWithDebInfo" - - - name: Publish OperatorKernels.md (Conditional) - uses: actions/upload-artifact@v4 - if: failure() && env.DocUpdateNeeded == 'true' - with: - name: OperatorKernels.md - path: ${{ github.workspace }}/docs/OperatorKernels.md - - - name: Publish ContribOperators.md (Conditional) - uses: actions/upload-artifact@v4 - if: failure() && env.DocUpdateNeeded == 'true' - with: - name: ContribOperators.md - path: ${{ github.workspace }}/docs/ContribOperators.md - - env: - OrtPackageId: Microsoft.ML.OnnxRuntime - OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' \ No newline at end of file