diff --git a/.github/actions/locate-vcvarsall-and-setup-env/action.yml b/.github/actions/locate-vcvarsall-and-setup-env/action.yml index fba855f14b487..6826f514ec558 100644 --- a/.github/actions/locate-vcvarsall-and-setup-env/action.yml +++ b/.github/actions/locate-vcvarsall-and-setup-env/action.yml @@ -5,6 +5,9 @@ inputs: description: 'Target architecture (x64 or x86)' required: true default: 'x64' + cache_key: + description: 'a workflow & job qualified unique key to distinguish a cache. used as a suffix for subcaches.' + required: true outputs: vcvarsall_path: description: "Path to vcvarsall.bat" @@ -13,68 +16,106 @@ runs: using: "composite" steps: - - name: Setup VCPKG - uses: microsoft/onnxruntime-github-actions/setup-build-tools@v0.0.9 - with: - vcpkg-version: '2025.08.27' - vcpkg-hash: '9a4b32849792e13bee1d24726f073b3881acae4165206ddf1a6378e44a4ddd05b3ee93f55ff46d8e8873b3cbcd06606212989e248f0bd615a5bf365070074079' - cmake-version: '3.31.6' - cmake-hash: '0f1584e8666cf4a65ec514bd02afe281caabf1d45d2c963f3151c41484f457386aa03273ab25776a670be02725354ce0b46f3a5121857416da37366342a833a0' - add-cmake-to-path: 'true' - disable-terrapin: 'false' - - - name: Verify vcpkg setup - shell: pwsh # Use powershell to easily access env var - run: | - Write-Host "VCPKG_INSTALLATION_ROOT is set to: $env:VCPKG_INSTALLATION_ROOT" - & "$env:VCPKG_INSTALLATION_ROOT/vcpkg" version - - - 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") - - 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", "vcvarsall.bat") - - if os.path.exists(vcvarsall_path): - print(f"vcvarsall found at: {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 - 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: | - 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 }}" ${{ inputs.architecture }} - - 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 + - name: Setup VCPKG + uses: microsoft/onnxruntime-github-actions/build/setup-build-tools@dev/sanaahamel/download-ninja + with: + ccache-version: 4.13.1 + ccache-hash: fe678d8e82f35e1d5f13c7bcd86447c08b67b0831dec8c772ef1257090a0f51678e296bb6d3ea38433f472d0fded52da96445cbc6fa8f945ecf94351d2c149d8 + cmake-version: '3.31.6' + cmake-hash: '0f1584e8666cf4a65ec514bd02afe281caabf1d45d2c963f3151c41484f457386aa03273ab25776a670be02725354ce0b46f3a5121857416da37366342a833a0' + ninja-version: 1.13.0 + ninja-hash: cffea62711b5a89ec494b48ae5e8df32f24cab0e642363ac20cc250c7d7f75ad43258f8d3721c68b23413e401d42630945c534ff95355cfe664e5da1d36569bf + vcpkg-version: '2025.08.27' + vcpkg-hash: '9a4b32849792e13bee1d24726f073b3881acae4165206ddf1a6378e44a4ddd05b3ee93f55ff46d8e8873b3cbcd06606212989e248f0bd615a5bf365070074079' + add-cmake-to-path: 'true' + disable-terrapin: 'true' # ccache isn't on terrapin + + - name: Verify vcpkg setup + shell: pwsh # Use powershell to easily access env var + run: | + Write-Host "VCPKG_INSTALLATION_ROOT is set to: $env:VCPKG_INSTALLATION_ROOT" + & "$env:VCPKG_INSTALLATION_ROOT/vcpkg" version + + - 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") + + 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", "vcvarsall.bat") + + if os.path.exists(vcvarsall_path): + print(f"vcvarsall found at: {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 + 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: | + 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 }}" ${{ inputs.architecture }} + + 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 + + - name: Set cache dir env vars + env: + github_runner_temp: ${{ runner.temp }} + shell: pwsh + run: | + echo "CCACHE_DIR=${env:github_runner_temp}/.ccache" >> "${env:GITHUB_ENV}" + echo "VCPKG_DEFAULT_BINARY_CACHE=${env:github_runner_temp}/.vcpkg-cache" >> "${env:GITHUB_ENV}" + + # vcpkg will error/exit if `VCPKG_DEFAULT_BINARY_CACHE` does not exist as a directory. + # c.f. ccache happily creates the cache dir if it does not exist. + # Don't create ccache's dir so that `action/cache` skips if ccache isn't populated. + New-Item -ItemType Directory -Path "${env:github_runner_temp}/.vcpkg-cache" -Force + + # HACK: `actions/cache` will somehow pick up `tar` from the git installation. This bin dir is not on the PATH. + # `tar` tries to find `gzip` (which is right next to it), and fails b/c the git bin dir isn't on the PATH. + # This breaks attempts to download/upload caches. + # Add git's bin dir to the PATH so that `actions/cache`'s invoke of `tar` can find `gzip`. + echo "PATH=${env:PATH};C:\\Program Files\\Git\\usr\\bin" >> "${env:GITHUB_ENV}" + + # n.b. Caller is responsible for building w/ ccache enabled via `--use_cache` + # We could set the env var `ORT_BUILD_WITH_CACHE` to indirectly enable it, but this hack seems deprecated. + # Ideally ccache should be auto-enabled by the build system if ccache/sccache is detected on the PATH. + - name: Setup CCache + uses: actions/cache@v5 + with: + # Fully qualify by `cache_key`. `actions/cache` does not isolate by workflow, unlike ADO cache actions. + key: ccache | ${{ inputs.cache_key }} + path: ${{ runner.temp }}/.ccache # ensure this is coordinated/matches w/ env-vars step above + + - name: Setup VCPKG Cache + uses: actions/cache@v5 + with: + key: vcpkg-cache | ${{ inputs.cache_key }} + path: ${{ runner.temp }}/.vcpkg-cache diff --git a/.github/workflows/linux-wasm-ci-build-and-test-workflow.yml b/.github/workflows/linux-wasm-ci-build-and-test-workflow.yml index c53c61242e6bc..6d2dac4068da6 100644 --- a/.github/workflows/linux-wasm-ci-build-and-test-workflow.yml +++ b/.github/workflows/linux-wasm-ci-build-and-test-workflow.yml @@ -45,21 +45,22 @@ jobs: env: buildArch: x64 common_build_args: >- - --parallel - --use_cache - ${{ inputs.use_vcpkg == true && '--use_vcpkg --use_vcpkg_ms_internal_asset_cache' || '' }} - --config ${{ inputs.build_config }} - --skip_submodule_sync --build_wasm + --config '${{ inputs.build_config }}' --enable_wasm_simd + --parallel + --skip_submodule_sync + --use_cache ${{ inputs.enable_wasm_threads == true && '--enable_wasm_threads' || '' }} + ${{ inputs.use_vcpkg == true && '--use_vcpkg --use_vcpkg_ms_internal_asset_cache' || '' }} ${{ inputs.extra_build_args }} + reduced_size_build_args: >- - --disable_ml_ops --disable_generation_ops + --disable_ml_ops --disable_types string float4 float8 optional sparsetensor - --include_ops_by_config onnxruntime/wasm/reduced_types.config --enable_reduced_operator_type_support + --include_ops_by_config onnxruntime/wasm/reduced_types.config steps: - name: Checkout code @@ -106,20 +107,24 @@ jobs: disable-terrapin: 'true' - name: Build (simd + threads) + shell: bash run: | + set -euo pipefail python ./tools/ci_build/build.py \ ${{ env.common_build_args }} \ - --build_dir ${{ github.workspace }}/build/wasm_inferencing \ + --build_dir "${GITHUB_WORKSPACE}/build/wasm_inferencing" \ ${{ inputs.build_config == 'Release' && '--enable_wasm_api_exception_catching' || '' }} \ --skip_tests working-directory: ${{ github.workspace }} - name: Build (simd + threads + JSEP) if: ${{ inputs.build_jsep == true }} + shell: bash run: | + set -euo pipefail python ./tools/ci_build/build.py \ ${{ env.common_build_args }} \ - --build_dir ${{ github.workspace }}/build/wasm_inferencing_jsep \ + --build_dir "${GITHUB_WORKSPACE}/build/wasm_inferencing_jsep" \ --use_jsep \ --use_webnn \ --target onnxruntime_webassembly \ @@ -129,10 +134,12 @@ jobs: - name: Build (simd + threads + WebGPU experimental) if: ${{ inputs.build_webgpu == true }} + shell: bash run: | + set -euo pipefail python ./tools/ci_build/build.py \ ${{ env.common_build_args }} \ - --build_dir ${{ github.workspace }}/build/wasm_inferencing_webgpu \ + --build_dir "${GITHUB_WORKSPACE}/build/wasm_inferencing_webgpu" \ --use_webgpu \ --use_webnn \ --target onnxruntime_webassembly \ @@ -143,10 +150,12 @@ jobs: - name: Build (simd + threads + WebGPU experimental, JSPI) if: ${{ inputs.build_webgpu == true }} + shell: bash run: | + set -euo pipefail python ./tools/ci_build/build.py \ ${{ env.common_build_args }} \ - --build_dir ${{ github.workspace }}/build/wasm_inferencing_webgpu_jspi \ + --build_dir "${GITHUB_WORKSPACE}/build/wasm_inferencing_webgpu_jspi" \ --use_webgpu \ --use_webnn \ --enable_wasm_jspi \ @@ -157,21 +166,25 @@ jobs: - name: Create Artifacts if: ${{ inputs.skip_publish != true }} + shell: bash + env: + build_cfg: ${{ inputs.build_config }} run: | - mkdir -p ${{ github.workspace }}/artifacts/wasm/ - cp ${{ github.workspace }}/build/wasm_inferencing/${{ inputs.build_config }}/ort-wasm-simd-threaded.wasm ${{ github.workspace }}/artifacts/wasm/ - cp ${{ github.workspace }}/build/wasm_inferencing/${{ inputs.build_config }}/ort-wasm-simd-threaded.mjs ${{ github.workspace }}/artifacts/wasm/ - if [ -d ${{ github.workspace }}/build/wasm_inferencing_jsep ]; then - cp ${{ github.workspace }}/build/wasm_inferencing_jsep/${{ inputs.build_config }}/ort-wasm-simd-threaded.jsep.wasm ${{ github.workspace }}/artifacts/wasm/ - cp ${{ github.workspace }}/build/wasm_inferencing_jsep/${{ inputs.build_config }}/ort-wasm-simd-threaded.jsep.mjs ${{ github.workspace }}/artifacts/wasm/ + set -euo pipefail + mkdir -p "${GITHUB_WORKSPACE}/artifacts/wasm/" + cp "${GITHUB_WORKSPACE}/build/wasm_inferencing/${build_cfg}/ort-wasm-simd-threaded.wasm" "${GITHUB_WORKSPACE}/artifacts/wasm/" + cp "${GITHUB_WORKSPACE}/build/wasm_inferencing/${build_cfg}/ort-wasm-simd-threaded.mjs" "${GITHUB_WORKSPACE}/artifacts/wasm/" + if [ -d "${GITHUB_WORKSPACE}/build/wasm_inferencing_jsep" ]; then + cp "${GITHUB_WORKSPACE}/build/wasm_inferencing_jsep/${build_cfg}/ort-wasm-simd-threaded.jsep.wasm" "${GITHUB_WORKSPACE}/artifacts/wasm/" + cp "${GITHUB_WORKSPACE}/build/wasm_inferencing_jsep/${build_cfg}/ort-wasm-simd-threaded.jsep.mjs" "${GITHUB_WORKSPACE}/artifacts/wasm/" fi - if [ -d ${{ github.workspace }}/build/wasm_inferencing_webgpu ]; then - cp ${{ github.workspace }}/build/wasm_inferencing_webgpu/${{ inputs.build_config }}/ort-wasm-simd-threaded.asyncify.wasm ${{ github.workspace }}/artifacts/wasm/ - cp ${{ github.workspace }}/build/wasm_inferencing_webgpu/${{ inputs.build_config }}/ort-wasm-simd-threaded.asyncify.mjs ${{ github.workspace }}/artifacts/wasm/ + if [ -d "${GITHUB_WORKSPACE}/build/wasm_inferencing_webgpu" ]; then + cp "${GITHUB_WORKSPACE}/build/wasm_inferencing_webgpu/${build_cfg}/ort-wasm-simd-threaded.asyncify.wasm" "${GITHUB_WORKSPACE}/artifacts/wasm/" + cp "${GITHUB_WORKSPACE}/build/wasm_inferencing_webgpu/${build_cfg}/ort-wasm-simd-threaded.asyncify.mjs" "${GITHUB_WORKSPACE}/artifacts/wasm/" fi - if [ -d ${{ github.workspace }}/build/wasm_inferencing_webgpu_jspi ]; then - cp ${{ github.workspace }}/build/wasm_inferencing_webgpu_jspi/${{ inputs.build_config }}/ort-wasm-simd-threaded.jspi.wasm ${{ github.workspace }}/artifacts/wasm/ - cp ${{ github.workspace }}/build/wasm_inferencing_webgpu_jspi/${{ inputs.build_config }}/ort-wasm-simd-threaded.jspi.mjs ${{ github.workspace }}/artifacts/wasm/ + if [ -d "${GITHUB_WORKSPACE}/build/wasm_inferencing_webgpu_jspi" ]; then + cp "${GITHUB_WORKSPACE}/build/wasm_inferencing_webgpu_jspi/${build_cfg}/ort-wasm-simd-threaded.jspi.wasm" "${GITHUB_WORKSPACE}/artifacts/wasm/" + cp "${GITHUB_WORKSPACE}/build/wasm_inferencing_webgpu_jspi/${build_cfg}/ort-wasm-simd-threaded.jspi.mjs" "${GITHUB_WORKSPACE}/artifacts/wasm/" fi - name: Upload WASM artifacts @@ -184,20 +197,24 @@ jobs: - name: Test (Node.js) (simd + threads) # unit tests are currently only supported in Debug builds because they require exceptions, which are disabled in Release builds. if: ${{ inputs.build_config == 'Debug' }} + shell: bash run: | + set -euo pipefail python ./tools/ci_build/build.py \ ${{ env.common_build_args }} \ - --build_dir ${{ github.workspace }}/build/wasm_inferencing \ + --build_dir build/wasm_inferencing \ --test working-directory: ${{ github.workspace }} - name: Test (browser) (simd + threads) # unit tests are currently only supported in Debug builds because they require exceptions, which are disabled in Release builds. if: ${{ inputs.build_config == 'Debug' }} + shell: bash run: | + set -euo pipefail python ./tools/ci_build/build.py \ ${{ env.common_build_args }} \ - --build_dir ${{ github.workspace }}/build/wasm_inferencing \ + --build_dir build/wasm_inferencing \ --wasm_run_tests_in_browser \ --targets onnxruntime_test_all onnxruntime_provider_test \ --update --build --test diff --git a/.github/workflows/macos-ci-build-and-test-workflow.yml b/.github/workflows/macos-ci-build-and-test-workflow.yml index 76198c7f5c1ce..34bf5321e63fa 100644 --- a/.github/workflows/macos-ci-build-and-test-workflow.yml +++ b/.github/workflows/macos-ci-build-and-test-workflow.yml @@ -52,7 +52,8 @@ jobs: # see also: https://github.com/actions/runner-images/blob/main/README.md runs-on: ${{ matrix.machine == 'x86_64' && 'macos-13' || 'macos-15' }} env: - build_flags: > + CCACHE_DIR: ~/.cache/ccache # be explicit. must match `action/cache` below. + build_flags: >- --build_dir ./build --skip_submodule_sync --parallel @@ -66,7 +67,9 @@ jobs: ${{ inputs.use_webgpu && '--use_webgpu' || '' }} ${{ inputs.use_xnnpack && '--use_xnnpack' || '' }} ${{ inputs.use_coreml && '--use_coreml --skip_onnx_tests' || '' }} - --use_vcpkg --use_vcpkg_ms_internal_asset_cache + --use_cache + --use_vcpkg + --use_vcpkg_ms_internal_asset_cache --config ${{ matrix.build_config }} --osx_arch ${{ matrix.target }} @@ -76,13 +79,15 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v6 - - uses: microsoft/onnxruntime-github-actions/setup-build-tools@v0.0.9 + + - uses: microsoft/onnxruntime-github-actions/setup-build-tools@8bad63a3c05d448311dfa8e5f531171c97471aa1 # v0.0.12 with: + ccache-version: 4.13.1 + ccache-hash: d831cbd84ac1efb32441c5bfbc7cc662830c0c22e96c5b5b27a6ce4746c81d6076261cf61217fb67ff4585fbd6cbd91ea817aa4ed904b81fcba621bb60881f56 vcpkg-version: '2025.08.27' vcpkg-hash: 9a4b32849792e13bee1d24726f073b3881acae4165206ddf1a6378e44a4ddd05b3ee93f55ff46d8e8873b3cbcd06606212989e248f0bd615a5bf365070074079 cmake-version: '3.31.8' cmake-hash: 99cc9c63ae49f21253efb5921de2ba84ce136018abf08632c92c060ba91d552e0f6acc214e9ba8123dee0cf6d1cf089ca389e321879fd9d719a60d975bcffcc8 - add-cmake-to-path: 'true' disable-terrapin: 'true' - name: macOS CI pipeline prepare steps @@ -93,6 +98,18 @@ jobs: xcode_version: ${{ env.xcode_version }} use_cache: true + - name: Setup CCache + uses: actions/cache@v5 + with: + key: ccache | macos-ci-build-and-test-workflow.yml | build-and-test | ${{ matrix.machine }}-${{ matrix.target }}-${{ matrix.build_config }} + path: ~/.cache/ccache + + - name: Setup VCPKG Cache + uses: actions/cache@v5 + with: + key: vcpkg-cache | macos-ci-build-and-test-workflow.yml | build-and-test | ${{ matrix.machine }}-${{ matrix.target }}-${{ matrix.build_config }} + path: ~/.cache/vcpkg + - uses: actions/cache@v5 id: onnx-node-tests-cache with: @@ -102,7 +119,7 @@ jobs: - name: Setup environment variables shell: bash run: | - set -e -x + set -xeuo pipefail export PATH=${{ github.workspace }}/build/installed/bin:$PATH export ONNX_ML=1 export CMAKE_ARGS="-DONNX_GEN_PB_TYPE_STUBS=ON -DONNX_WERROR=OFF" @@ -112,6 +129,8 @@ jobs: shell: bash working-directory: ${{ github.workspace }} run: | + set -euo pipefail + ccache --zero-stats rm -rf ${{ github.workspace }}/build/${{ matrix.build_config }} python ./tools/ci_build/build.py --update ${{ env.build_flags }} @@ -119,12 +138,20 @@ jobs: shell: bash working-directory: ${{ github.workspace }} run: | + set -euo pipefail python ./tools/ci_build/build.py --build ${{ env.build_flags }} + - name: CCache stats + shell: bash + working-directory: ${{ github.workspace }} + run: | + set -euo pipefail + ccache --show-stats -vv + - name: Install shell: bash run: | - set -e -x + set -xeuo pipefail rm -rf ${{ github.workspace }}/build/installed cd ${{ github.workspace }}/build/${{ matrix.build_config }} make install DESTDIR=${{ github.workspace }}/build/installed @@ -135,4 +162,5 @@ jobs: shell: bash working-directory: ${{ github.workspace }} run: | + set -euo pipefail python ./tools/ci_build/build.py --test ${{ env.build_flags }} diff --git a/.github/workflows/windows_build_x64_asan.yml b/.github/workflows/windows_build_x64_asan.yml index 265ea2bf8dcab..3dddb6e5e38d5 100644 --- a/.github/workflows/windows_build_x64_asan.yml +++ b/.github/workflows/windows_build_x64_asan.yml @@ -37,11 +37,30 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env # Use the composite action with: architecture: x64 + cache_key: windows_build_x64_asan.yml | build_x64 - name: Build and Test (Combined) - shell: cmd + shell: pwsh run: | - @echo off - 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 "%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 + ccache --zero-stats + + echo ${env:PATH} + python -m pip install -r "${env:GITHUB_WORKSPACE}\tools\ci_build\github\windows\python\requirements.txt" + python "${env:GITHUB_WORKSPACE}\tools\ci_build\build.py" ` + --build_dir "${env:RUNNER_TEMP}\build" ` + --cmake_generator "Ninja" ` + --config Debug ` + --disable_memleak_checker ` + --enable_address_sanitizer ` + --parallel ` + --skip_submodule_sync ` + --use_cache ` + --use_vcpkg ` + --use_vcpkg_ms_internal_asset_cache + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + - name: CCache Stats + shell: pwsh + run: ccache --show-stats -vv diff --git a/.github/workflows/windows_cuda.yml b/.github/workflows/windows_cuda.yml index 852d0164083c4..28c2e03c93137 100644 --- a/.github/workflows/windows_cuda.yml +++ b/.github/workflows/windows_cuda.yml @@ -39,6 +39,7 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env with: architecture: x64 + cache_key: windows_cuda.yml | build - name: Install python modules run: python -m pip install -r .\tools\ci_build\github\windows\python\requirements.txt @@ -79,7 +80,7 @@ jobs: - name: API Documentation Check and generate run: | set ORT_DOXY_SRC=${{ github.workspace }} - set ORT_DOXY_OUT=${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo + set ORT_DOXY_OUT=${{ runner.temp }}\build\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 @@ -109,19 +110,45 @@ jobs: - name: Build and Clean Binaries working-directory: ${{ runner.temp }} + shell: pwsh run: | + ccache --zero-stats + npm install -g typescript if ($lastExitCode -ne 0) { exit $lastExitCode } + # Execute the build process - python.exe ${{ github.workspace }}\tools\ci_build\build.py --update --build --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --nvcc_threads 1 --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --build_wheel --build_java --use_cuda --cuda_home="$env:RUNNER_TEMP\v12.8" --enable_cuda_profiling --use_vcpkg --use_vcpkg_ms_internal_asset_cache --enable_transformers_tool_test --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON + python.exe ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py ` + --build ` + --build_csharp ` + --build_dir build ` + --build_java ` + --build_shared_lib ` + --build_wheel ` + --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 ` + --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON ` + --cmake_generator "Ninja" ` + --config RelWithDebInfo ` + --cuda_home="$env:RUNNER_TEMP\v12.8" ` + --enable_cuda_profiling ` + --enable_transformers_tool_test ` + --nvcc_threads 1 ` + --parallel ` + --skip_submodule_sync ` + --update ` + --use_binskim_compliant_compile_flags ` + --use_cache ` + --use_cuda ` + --use_vcpkg ` + --use_vcpkg_ms_internal_asset_cache if ($lastExitCode -ne 0) { exit $lastExitCode } # Clean up the output directory before uploading artifacts - $outputDir = "${{ runner.temp }}\build\RelWithDebInfo" + $outputDir = "$env:RUNNER_TEMP\build\RelWithDebInfo" Write-Host "Cleaning up files from $outputDir..." Remove-Item -Path "$outputDir\onnxruntime" -Recurse -Force -ErrorAction SilentlyContinue @@ -133,7 +160,10 @@ jobs: Remove-Item -Path "$outputDir\CMakeFiles" -Recurse -Force -ErrorAction SilentlyContinue # Remove intermediate object files as in the original script Remove-Item -Path $outputDir -Include "*.obj" -Recurse + + - name: CCache Stats shell: pwsh + run: ccache --show-stats -vv - name: Upload build artifacts uses: actions/upload-artifact@v6 @@ -190,6 +220,7 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env with: architecture: x64 + cache_key: windows_cuda.yml | build # reuse build's caches. we do not expect this stage to modify them. - name: Install python modules run: python -m pip install -r .\tools\ci_build\github\windows\python\requirements.txt @@ -220,9 +251,10 @@ jobs: - name: Install ONNX Runtime Wheel uses: ./.github/actions/install-onnxruntime-wheel with: - whl-directory: ${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo\dist + whl-directory: ${{ runner.temp }}\build\RelWithDebInfo\dist - name: Run Tests + shell: pwsh working-directory: ${{ runner.temp }} run: | npm install -g typescript @@ -230,16 +262,36 @@ jobs: exit $lastExitCode } - python.exe ${{ github.workspace }}\tools\python\update_ctest_path.py "${{ runner.temp }}\build\RelWithDebInfo\CTestTestfile.cmake" "${{ runner.temp }}\build\RelWithDebInfo" + python.exe ${env:GITHUB_WORKSPACE}\tools\python\update_ctest_path.py "${env:RUNNER_TEMP}\build\RelWithDebInfo\CTestTestfile.cmake" "${env:RUNNER_TEMP}\build\RelWithDebInfo" if ($lastExitCode -ne 0) { exit $lastExitCode } - python.exe ${{ github.workspace }}\tools\ci_build\build.py --test --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --nvcc_threads 1 --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --build_wheel --build_java --use_cuda --cuda_home="$env:RUNNER_TEMP\v12.8" --enable_cuda_profiling --use_vcpkg --use_vcpkg_ms_internal_asset_cache --enable_transformers_tool_test --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON + python.exe ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py ` + --build_csharp ` + --build_dir build ` + --build_java ` + --build_shared_lib ` + --build_wheel ` + --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 ` + --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON ` + --cmake_generator "Ninja" ` + --config RelWithDebInfo ` + --cuda_home "${env:RUNNER_TEMP}\v12.8" ` + --enable_cuda_profiling ` + --enable_transformers_tool_test ` + --nvcc_threads 1 ` + --parallel ` + --skip_submodule_sync ` + --test ` + --use_binskim_compliant_compile_flags ` + --use_cache ` + --use_cuda ` + --use_vcpkg ` + --use_vcpkg_ms_internal_asset_cache if ($lastExitCode -ne 0) { exit $lastExitCode } - shell: pwsh - name: Validate C# native delegates run: python tools\ValidateNativeDelegateAttributes.py diff --git a/.github/workflows/windows_dml.yml b/.github/workflows/windows_dml.yml index de5eebdc86da0..c6d010a716c2c 100644 --- a/.github/workflows/windows_dml.yml +++ b/.github/workflows/windows_dml.yml @@ -45,6 +45,7 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env with: architecture: x64 + cache_key: windows_dml.yml | build_x64_RelWithDebInfo - name: Install python modules run: python -m pip install -r .\tools\ci_build\github\windows\python\requirements.txt @@ -64,7 +65,7 @@ jobs: - name: API Documentation Check and generate run: | set ORT_DOXY_SRC=${{ github.workspace }} - set ORT_DOXY_OUT=${{ github.workspace }}\RelWithDebInfo\RelWithDebInfo + set ORT_DOXY_OUT=${{ github.workspace }}\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 @@ -93,14 +94,35 @@ jobs: echo "OnnxRuntimeBuildDirectory=$buildDir" >> $env:GITHUB_ENV - name: Build and Test + shell: pwsh working-directory: ${{ runner.temp }} run: | - python.exe ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --skip_onnx_tests --build_wheel --use_dml --enable_wcos --use_vcpkg --use_vcpkg_ms_internal_asset_cache + ccache --zero-stats + + python.exe ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py ` + --build_csharp ` + --build_dir build ` + --build_shared_lib ` + --build_wheel ` + --cmake_generator "Ninja" ` + --config RelWithDebInfo ` + --enable_wcos ` + --parallel ` + --skip_onnx_tests ` + --skip_submodule_sync ` + --use_binskim_compliant_compile_flags ` + --use_cache ` + --use_dml ` + --use_vcpkg ` + --use_vcpkg_ms_internal_asset_cache if ($lastExitCode -ne 0) { exit $lastExitCode } - Remove-Item "${{ github.workspace }}\RelWithDebInfo" -Include "*.obj" -Recurse + Remove-Item "${env:GITHUB_WORKSPACE}\RelWithDebInfo" -Include "*.obj" -Recurse + + - name: CCache Stats shell: pwsh + run: ccache --show-stats -vv - name: Validate C# native delegates run: python tools\ValidateNativeDelegateAttributes.py @@ -110,4 +132,4 @@ jobs: - name: Install ONNX Runtime Wheel uses: ./.github/actions/install-onnxruntime-wheel with: - whl-directory: ${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo\dist + whl-directory: ${{ runner.temp }}\build\RelWithDebInfo\dist diff --git a/.github/workflows/windows_openvino.yml b/.github/workflows/windows_openvino.yml index 8ff7a7071a755..040293a125380 100644 --- a/.github/workflows/windows_openvino.yml +++ b/.github/workflows/windows_openvino.yml @@ -50,6 +50,7 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env with: architecture: x64 + cache_key: windows_openvino.yml | BUILD_OPENVINO_EP - name: Download OpenVINO Toolkit v2025.4.1 env: @@ -142,28 +143,62 @@ jobs: - - name: Generate onnxruntime.sln + - name: Generate build files shell: pwsh + env: + build_cfg: ${{ env.BuildConfig }} working-directory: ${{ runner.temp }} run: | - python.exe ${{ github.workspace }}\tools\ci_build\build.py --config ${{ env.BuildConfig }} --build_dir build --cmake_generator "Visual Studio 17 2022" --build_shared_lib --use_openvino CPU --use_binskim_compliant_compile_flags --update --parallel + python.exe ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py ` + --build_dir build ` + --build_shared_lib ` + --cmake_generator "Ninja" ` + --config ${env:build_cfg} ` + --parallel ` + --update ` + --use_binskim_compliant_compile_flags ` + --use_cache ` + --use_openvino CPU - name: Build shell: pwsh + env: + build_cfg: ${{ env.BuildConfig }} working-directory: ${{ runner.temp }} run: | - python.exe ${{ github.workspace }}\tools\ci_build\build.py --config ${{ env.BuildConfig }} --build_dir build --cmake_generator "Visual Studio 17 2022" --build_shared_lib --use_openvino CPU --use_binskim_compliant_compile_flags --build --parallel + ccache --zero-stats + + python.exe ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py ` + --build ` + --build_dir build ` + --build_shared_lib ` + --cmake_generator "Ninja" ` + --config ${env:build_cfg} ` + --parallel ` + --use_binskim_compliant_compile_flags ` + --use_cache ` + --use_openvino CPU + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + - name: CCache Stats + shell: pwsh + run: ccache --show-stats -vv - name: Run unit tests shell: pwsh + env: + build_cfg: ${{ env.BuildConfig }} working-directory: ${{ runner.temp }} run: | - python "${{ github.workspace }}\tools\ci_build\build.py" ` - --config "${{ env.BuildConfig }}" ` + python "${env:GITHUB_WORKSPACE}\tools\ci_build\build.py" ` --build_dir build ` - --cmake_generator "Visual Studio 17 2022" ` --build_shared_lib ` - --use_openvino CPU ` + --cmake_generator "Ninja" ` + --config "${env:build_cfg}" ` + --enable_onnx_tests ` + --test ` --use_binskim_compliant_compile_flags ` - --test --enable_onnx_tests + --use_cache ` + --use_openvino CPU diff --git a/.github/workflows/windows_qnn_x64.yml b/.github/workflows/windows_qnn_x64.yml index 7175b81e227c9..ca44de881a50c 100644 --- a/.github/workflows/windows_qnn_x64.yml +++ b/.github/workflows/windows_qnn_x64.yml @@ -47,6 +47,7 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env with: architecture: x64 + cache_key: windows_qnn_x64.yml | build_test_qnn_ep_${{ matrix.QnnLibKind }} - name: Download QNN SDK working-directory: ${{ runner.temp }} @@ -64,19 +65,44 @@ jobs: dir $qnn_sdk_path - name: Build and Test - shell: cmd + shell: pwsh + env: + qnn_kind: ${{ matrix.QnnLibKind }} run: | - python ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --build_dir ${{ runner.temp }}\build --cmake_generator "Visual Studio 17 2022" --build_java --build_shared_lib --use_qnn ${{ matrix.QnnLibKind }} --qnn_home %QNN_SDK_ROOT% --use_binskim_compliant_compile_flags --update --build --test --enable_onnx_tests --parallel + ccache --zero-stats + + python.exe ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py ` + --build ` + --build_dir "${env:RUNNER_TEMP}\build" ` + --build_java ` + --build_shared_lib ` + --cmake_generator "Ninja" ` + --config RelWithDebInfo ` + --enable_onnx_tests ` + --parallel ` + --qnn_home "${env:QNN_SDK_ROOT}" ` + --test ` + --update ` + --use_binskim_compliant_compile_flags ` + --use_cache ` + --use_qnn ${env:qnn_kind} + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + - name: CCache Stats + shell: pwsh + run: ccache --show-stats -vv - name: Run ONNX Tests shell: cmd - working-directory: ${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo + working-directory: ${{ runner.temp }}\build\RelWithDebInfo run: | .\onnx_test_runner -j 1 -e qnn -i "backend_path|%QNN_SDK_ROOT%\lib\x86_64-windows-msvc\QnnCpu.dll" ${{ github.workspace }}\cmake\external\onnx\onnx\backend\test\data\node - name: Run float32 model tests shell: cmd - working-directory: ${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo + working-directory: ${{ runner.temp }}\build\RelWithDebInfo run: | rem This step assumes the model data exists at C:\data\float32_models on the runner if exist C:\data\float32_models ( diff --git a/.github/workflows/windows_tensorrt.yml b/.github/workflows/windows_tensorrt.yml index 0a47f46aa8516..185a721e2fde6 100644 --- a/.github/workflows/windows_tensorrt.yml +++ b/.github/workflows/windows_tensorrt.yml @@ -39,6 +39,7 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env with: architecture: x64 + cache_key: windows_tensorrt.yml | build - name: Install python modules run: python -m pip install -r .\tools\ci_build\github\windows\python\requirements.txt @@ -85,7 +86,7 @@ jobs: - name: API Documentation Check and generate run: | set ORT_DOXY_SRC=${{ github.workspace }} - set ORT_DOXY_OUT=${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo + set ORT_DOXY_OUT=${{ runner.temp }}\build\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 @@ -115,19 +116,40 @@ jobs: - name: Build and Clean Binaries working-directory: ${{ runner.temp }} + shell: pwsh run: | + ccache --zero-stats + npm install -g typescript if ($lastExitCode -ne 0) { exit $lastExitCode } # Execute the build process - python ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --parallel --nvcc_threads 1 --use_binskim_compliant_compile_flags --build_dir build --skip_submodule_sync --build_shared_lib --build --update --cmake_generator "Visual Studio 17 2022" --build_wheel --enable_onnx_tests --use_tensorrt --tensorrt_home="${{ runner.temp }}\TensorRT-10.14.1.48.Windows.win10.cuda-12.9" --cuda_home="${{ runner.temp }}\v12.8" --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 + python ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py ` + --build ` + --build_dir "${env:RUNNER_TEMP}\build" ` + --build_shared_lib ` + --build_wheel ` + --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 ` + --cmake_generator "Ninja" ` + --config RelWithDebInfo ` + --cuda_home "${env:RUNNER_TEMP}\v12.8" ` + --enable_onnx_tests ` + --nvcc_threads 1 ` + --parallel ` + --skip_submodule_sync ` + --tensorrt_home "${env:RUNNER_TEMP}\TensorRT-10.14.1.48.Windows.win10.cuda-12.9" ` + --update ` + --use_binskim_compliant_compile_flags ` + --use_tensorrt ` + --use_vcpkg ` + --use_vcpkg_ms_internal_asset_cache if ($lastExitCode -ne 0) { exit $lastExitCode } # Clean up the output directory before uploading artifacts - $outputDir = "${{ runner.temp }}\build\RelWithDebInfo" + $outputDir = "${env:RUNNER_TEMP}\build\RelWithDebInfo" Write-Host "Cleaning up files from $outputDir..." Remove-Item -Path "$outputDir\onnxruntime" -Recurse -Force -ErrorAction SilentlyContinue @@ -139,7 +161,10 @@ jobs: Remove-Item -Path "$outputDir\CMakeFiles" -Recurse -Force -ErrorAction SilentlyContinue # Remove intermediate object files as in the original script Remove-Item -Path $outputDir -Include "*.obj" -Recurse + + - name: CCache Stats shell: pwsh + run: ccache --show-stats -vv - name: Upload build artifacts uses: actions/upload-artifact@v6 @@ -196,6 +221,7 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env with: architecture: x64 + cache_key: windows_tensorrt.yml | build # re-use build's caches, we do not expect to modify/extend them. - name: Install python modules run: python -m pip install -r .\tools\ci_build\github\windows\python\requirements.txt @@ -232,26 +258,44 @@ jobs: - name: Install ONNX Runtime Wheel uses: ./.github/actions/install-onnxruntime-wheel with: - whl-directory: ${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo\dist + whl-directory: ${{ runner.temp }}\build\RelWithDebInfo\dist - name: Run Tests working-directory: ${{ runner.temp }} + shell: pwsh run: | npm install -g typescript if ($lastExitCode -ne 0) { exit $lastExitCode } - python.exe ${{ github.workspace }}\tools\python\update_ctest_path.py "${{ runner.temp }}\build\RelWithDebInfo\CTestTestfile.cmake" "${{ runner.temp }}\build\RelWithDebInfo" + python.exe ${env:GITHUB_WORKSPACE}\tools\python\update_ctest_path.py "${env:RUNNER_TEMP}\build\RelWithDebInfo\CTestTestfile.cmake" "${env:RUNNER_TEMP}\build\RelWithDebInfo" if ($lastExitCode -ne 0) { exit $lastExitCode } - python ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --use_binskim_compliant_compile_flags --parallel --nvcc_threads 1 --build_dir build --skip_submodule_sync --build_shared_lib --test --cmake_generator "Visual Studio 17 2022" --build_wheel --enable_onnx_tests --use_tensorrt --tensorrt_home="${{ runner.temp }}\TensorRT-10.14.1.48.Windows.win10.cuda-12.9" --cuda_home="${{ runner.temp }}\v12.8" --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 + python ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py ` + --build_dir build ` + --build_shared_lib ` + --build_wheel ` + --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 ` + --cmake_generator "Ninja" ` + --config RelWithDebInfo ` + --cuda_home "${env:RUNNER_TEMP}\v12.8" ` + --enable_onnx_tests ` + --nvcc_threads 1 ` + --parallel ` + --skip_submodule_sync ` + --tensorrt_home "${env:RUNNER_TEMP}\TensorRT-10.14.1.48.Windows.win10.cuda-12.9" ` + --test ` + --use_binskim_compliant_compile_flags ` + --use_cache ` + --use_tensorrt ` + --use_vcpkg ` + --use_vcpkg_ms_internal_asset_cache if ($lastExitCode -ne 0) { exit $lastExitCode } - shell: pwsh - name: Validate C# native delegates run: python tools\ValidateNativeDelegateAttributes.py diff --git a/.github/workflows/windows_webgpu.yml b/.github/workflows/windows_webgpu.yml index e67eda41d2e0e..4904ecc79e365 100644 --- a/.github/workflows/windows_webgpu.yml +++ b/.github/workflows/windows_webgpu.yml @@ -53,6 +53,7 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env with: architecture: x64 + cache_key: windows_webgpu.yml | webgpu_build_x64_RelWithDebInfo_${{ matrix.vcpkg_option }}_${{ matrix.wgsl_template }} - name: Install python modules run: python -m pip install -r tools\ci_build\github\windows\python\requirements.txt @@ -74,7 +75,7 @@ jobs: - name: API Documentation Check and generate run: | set ORT_DOXY_SRC=${{ github.workspace }} - set ORT_DOXY_OUT=${{ github.workspace }}\RelWithDebInfo\RelWithDebInfo + set ORT_DOXY_OUT=${{ github.workspace }}\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 @@ -107,29 +108,31 @@ jobs: - name: Build and Test shell: pwsh + env: + wgsl_template: ${{ matrix.wgsl_template }} run: | - python.exe ${{ github.workspace }}\tools\ci_build\build.py ` - --config RelWithDebInfo ` - --build_dir ${{ github.workspace }} ` - --skip_submodule_sync ` + python.exe "${env:GITHUB_WORKSPACE}\tools\ci_build\build.py" ` --build_csharp ` - --parallel ` - --use_binskim_compliant_compile_flags ` - --cmake_generator "Visual Studio 17 2022" ` + --build_dir "${env:GITHUB_WORKSPACE}" ` + --build_java ` + --build_nodejs ` --build_shared_lib ` + --cmake_extra_defines onnxruntime_BUILD_DAWN_SHARED_LIBRARY=ON ` + --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=ON ` + --cmake_generator "Ninja" ` + --config RelWithDebInfo ` --enable_onnx_tests ` - --build_nodejs ` - --build_java ` + --parallel ` + --skip_submodule_sync ` + --use_binskim_compliant_compile_flags ` + --use_cache ` --use_webgpu ` - --wgsl_template ${{ matrix.wgsl_template }} ` - ${{ matrix.vcpkg_option == 'vcpkg' && '--use_vcpkg --use_vcpkg_ms_internal_asset_cache' || '' }} ` - --cmake_extra_defines ` - onnxruntime_BUILD_UNIT_TESTS=ON ` - onnxruntime_BUILD_DAWN_SHARED_LIBRARY=ON + --wgsl_template "${env:wgsl_template}" ` + ${{ matrix.vcpkg_option == 'vcpkg' && '--use_vcpkg --use_vcpkg_ms_internal_asset_cache' || '' }} if ($lastExitCode -ne 0) { exit $lastExitCode } - Remove-Item "${{ github.workspace }}\RelWithDebInfo" -Include "*.obj" -Recurse + Remove-Item "${env:GITHUB_WORKSPACE}\RelWithDebInfo" -Include "*.obj" -Recurse - name: Run tests (onnxruntime_test_all, onnxruntime_provider_test) with verbose logging shell: pwsh @@ -137,17 +140,17 @@ jobs: $env:ORT_UNIT_TEST_MAIN_LOG_LEVEL = "0" .\onnxruntime_test_all.exe 2> .\onnxruntime_test_stderr.log .\onnxruntime_provider_test.exe 2>> .\onnxruntime_test_stderr.log - working-directory: ${{ github.workspace }}\RelWithDebInfo\RelWithDebInfo + working-directory: ${{ github.workspace }}\RelWithDebInfo - name: Check log file shell: cmd run: | - dir ${{ github.workspace }}\RelWithDebInfo\RelWithDebInfo\onnxruntime_test_stderr.log + dir ${{ github.workspace }}\RelWithDebInfo\onnxruntime_test_stderr.log - name: Validate shader keys uses: ./.github/actions/webgpu-validate-shader-key with: - log_file_path: ${{ github.workspace }}\RelWithDebInfo\RelWithDebInfo\onnxruntime_test_stderr.log + log_file_path: ${{ github.workspace }}\RelWithDebInfo\onnxruntime_test_stderr.log - name: Validate C# native delegates run: python tools\ValidateNativeDelegateAttributes.py @@ -186,6 +189,7 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env with: architecture: x64 + cache_key: windows_webgpu.yml | webgpu_plugin_build_x64_RelWithDebInfo - name: Install python modules run: python -m pip install -r tools\ci_build\github\windows\python\requirements.txt @@ -212,7 +216,7 @@ jobs: --skip_submodule_sync ` --parallel ` --use_binskim_compliant_compile_flags ` - --cmake_generator "Visual Studio 17 2022" ` + --cmake_generator "Ninja" ` --enable_onnx_tests ` --use_webgpu shared_lib ` --wgsl_template static ` @@ -259,31 +263,60 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env with: architecture: x64 + cache_key: windows_webgpu.yml | webgpu_external_dawn_build_x64_RelWithDebInfo - name: Install python modules run: python -m pip install -r tools\ci_build\github\windows\python\requirements.txt shell: cmd working-directory: ${{ github.workspace }} - - name: Generate onnxruntime.sln + - name: Generate build files shell: pwsh run: | - python.exe ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --build_dir ${{ github.workspace }} --skip_submodule_sync --update --parallel --cmake_generator "Visual Studio 17 2022" --use_webgpu --use_external_dawn --skip_tests --target onnxruntime_webgpu_external_dawn_test + python.exe ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py ` + --build_dir ${env:GITHUB_WORKSPACE} ` + --cmake_generator "Ninja" ` + --config RelWithDebInfo ` + --parallel ` + --skip_submodule_sync ` + --skip_tests ` + --target onnxruntime_webgpu_external_dawn_test ` + --update ` + --use_cache ` + --use_external_dawn ` + --use_webgpu - name: Build shell: pwsh run: | - python.exe ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --build_dir ${{ github.workspace }} --skip_submodule_sync --build --parallel --cmake_generator "Visual Studio 17 2022" --use_webgpu --use_external_dawn --skip_tests --target onnxruntime_webgpu_external_dawn_test + ccache --zero-stats + + python.exe ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py ` + --build ` + --build_dir ${env:GITHUB_WORKSPACE} ` + --cmake_generator "Ninja" ` + --config RelWithDebInfo ` + --parallel ` + --skip_submodule_sync ` + --skip_tests ` + --target onnxruntime_webgpu_external_dawn_test ` + --use_cache ` + --use_external_dawn ` + --use_webgpu + + - name: CCache Stats + shell: pwsh + run: ccache --show-stats -vv - name: Run tests (onnxruntime_webgpu_external_dawn_test) run: onnxruntime_webgpu_external_dawn_test.exe shell: cmd - working-directory: ${{ github.workspace }}\RelWithDebInfo\RelWithDebInfo + working-directory: ${{ github.workspace }}\RelWithDebInfo - name: Run tests (onnxruntime_webgpu_external_dawn_test) - no_proc_table run: onnxruntime_webgpu_external_dawn_test.exe --no_proc_table shell: cmd - working-directory: ${{ github.workspace }}\RelWithDebInfo\RelWithDebInfo + working-directory: ${{ github.workspace }}\RelWithDebInfo webgpu_minimal_build_edge_build_x64_RelWithDebInfo: runs-on: [ @@ -316,6 +349,7 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env with: architecture: x64 + cache_key: windows_webgpu.yml | webgpu_minimal_build_edge_build_x64_RelWithDebInfo - name: Install python modules run: python -m pip install -r tools\ci_build\github\windows\python\requirements.txt @@ -337,7 +371,7 @@ jobs: - name: API Documentation Check and generate run: | set ORT_DOXY_SRC=${{ github.workspace }} - set ORT_DOXY_OUT=${{ github.workspace }}\RelWithDebInfo\RelWithDebInfo + set ORT_DOXY_OUT=${{ github.workspace }}\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 @@ -365,11 +399,32 @@ jobs: - name: Build shell: pwsh run: | - python.exe ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --build_dir ${{ github.workspace }} --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --update --build --build_shared_lib --disable_exceptions --disable_rtti --enable_msvc_static_runtime --enable_reduced_operator_type_support --skip_tests --use_binskim_compliant_compile_flags --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF onnxruntime_DISABLE_SPARSE_TENSORS=ON onnxruntime_DISABLE_OPTIONAL_TYPE=ON --minimal_build extended --use_webgpu + python.exe ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py ` + --build ` + --build_csharp ` + --build_dir ${env:GITHUB_WORKSPACE} ` + --build_shared_lib ` + --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF ` + --cmake_extra_defines onnxruntime_DISABLE_OPTIONAL_TYPE=ON ` + --cmake_extra_defines onnxruntime_DISABLE_SPARSE_TENSORS=ON ` + --cmake_generator "Ninja" ` + --config RelWithDebInfo ` + --disable_exceptions ` + --disable_rtti ` + --enable_msvc_static_runtime ` + --enable_reduced_operator_type_support ` + --minimal_build extended ` + --parallel ` + --skip_submodule_sync ` + --skip_tests ` + --update ` + --use_binskim_compliant_compile_flags ` + --use_cache ` + --use_webgpu if ($lastExitCode -ne 0) { exit $lastExitCode } - Remove-Item "${{ github.workspace }}\RelWithDebInfo" -Include "*.obj" -Recurse + Remove-Item "${env:GITHUB_WORKSPACE}\RelWithDebInfo" -Include "*.obj" -Recurse - name: Validate C# native delegates run: python tools\ValidateNativeDelegateAttributes.py diff --git a/.github/workflows/windows_x64_debug_build_x64_debug.yml b/.github/workflows/windows_x64_debug_build_x64_debug.yml index 134326b8f57de..19ef393dada15 100644 --- a/.github/workflows/windows_x64_debug_build_x64_debug.yml +++ b/.github/workflows/windows_x64_debug_build_x64_debug.yml @@ -36,6 +36,7 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env # Use the composite action with: architecture: x64 + cache_key: windows_x64_debug_build_x64_debug.yml | build_x64_debug - name: Install python modules shell: cmd @@ -57,7 +58,7 @@ jobs: shell: cmd run: | set ORT_DOXY_SRC=${{ github.workspace }} - set ORT_DOXY_OUT=${{ github.workspace }}\build\Debug\Debug + set ORT_DOXY_OUT=${{ github.workspace }}\build\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 @@ -89,16 +90,33 @@ jobs: - 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 + python.exe "${env:GITHUB_WORKSPACE}\tools\ci_build\build.py" ` + --build_csharp ` + --build_dir "${env:GITHUB_WORKSPACE}\build" ` + --build_java ` + --build_nodejs ` + --build_nuget ` + --build_shared_lib ` + --build_wheel ` + --cmake_generator "Ninja" ` + --config Debug ` + --disable_memleak_checker ` + --enable_onnx_tests ` + --msbuild_extra_options "IncludeMobileTargets=false" ` + --parallel ` + --skip_submodule_sync ` + --use_binskim_compliant_compile_flags ` + --use_cache ` + --use_vcpkg ` + --use_vcpkg_ms_internal_asset_cache if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - Remove-Item "${{ github.workspace }}\build\Debug" -Include "*.obj" -Recurse + Remove-Item "${env: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 @@ -109,7 +127,7 @@ jobs: 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" # 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 7acbdcd404ad3..6977d4493f8b2 100644 --- a/.github/workflows/windows_x64_release_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_build_x64_release.yml @@ -36,6 +36,7 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env with: architecture: x64 + cache_key: windows_x64_release_build_x64_release.yml | build_x64_release - name: Install python modules shell: cmd @@ -57,7 +58,7 @@ jobs: shell: cmd run: | set ORT_DOXY_SRC=${{ github.workspace }} - set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + set ORT_DOXY_OUT=${{ github.workspace }}\build\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 @@ -89,15 +90,38 @@ 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 + ccache --zero-stats + + python.exe "${env:GITHUB_WORKSPACE}\tools\ci_build\build.py" ` + --build_csharp ` + --build_dir "${env:GITHUB_WORKSPACE}\build" ` + --build_java ` + --build_nodejs ` + --build_nuget ` + --build_shared_lib ` + --build_wheel ` + --cmake_generator "Ninja" ` + --config RelWithDebInfo ` + --enable_onnx_tests ` + --msbuild_extra_options "IncludeMobileTargets=false" ` + --parallel ` + --skip_submodule_sync ` + --use_binskim_compliant_compile_flags ` + --use_cache ` + --use_vcpkg ` + --use_vcpkg_ms_internal_asset_cache if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + Remove-Item "${env:GITHUB_WORKSPACE}\build\RelWithDebInfo" -Include "*.obj" -Recurse env: ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' DocUpdateNeeded: 'false' + - name: CCache Stats + shell: pwsh + run: ccache --show-stats -vv + - name: Run onnxruntime_provider_test with example_plugin_ep shell: pwsh run: | @@ -124,7 +148,7 @@ jobs: "@ .\onnxruntime_provider_test.exe - working-directory: ${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + working-directory: ${{ github.workspace }}\build\RelWithDebInfo - name: Validate C# native delegates shell: cmd @@ -136,7 +160,7 @@ jobs: 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" - name: Publish OperatorKernels.md (Conditional) uses: actions/upload-artifact@v6 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 8cb5bad664921..74fb24274d046 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 @@ -36,6 +36,7 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env with: architecture: x64 + cache_key: windows_x64_release_ep_generic_interface_build_x64_release_ep_generic_interface.yml | build_x64_release_ep_generic_interface - name: Install python modules shell: cmd @@ -57,7 +58,7 @@ jobs: shell: cmd run: | set ORT_DOXY_SRC=${{ github.workspace }} - set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + set ORT_DOXY_OUT=${{ github.workspace }}\build\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 @@ -83,14 +84,35 @@ 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 --update --build --test --enable_generic_interface --use_vcpkg --use_vcpkg_ms_internal_asset_cache + ccache --zero-stats + + python.exe "${env:GITHUB_WORKSPACE}\tools\ci_build\build.py" ` + --build ` + --build_csharp ` + --build_dir "${env:GITHUB_WORKSPACE}\build" ` + --build_shared_lib ` + --cmake_generator "Ninja" ` + --config RelWithDebInfo ` + --enable_generic_interface ` + --parallel ` + --skip_submodule_sync ` + --test ` + --update ` + --use_binskim_compliant_compile_flags ` + --use_cache ` + --use_vcpkg ` + --use_vcpkg_ms_internal_asset_cache if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + Remove-Item "${env:GITHUB_WORKSPACE}\build\RelWithDebInfo" -Include "*.obj" -Recurse env: ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + - name: CCache Stats + shell: pwsh + run: ccache --show-stats -vv + - name: Validate C# native delegates shell: cmd run: python tools\ValidateNativeDelegateAttributes.py 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 a3200b21cf658..c433aa9f64973 100644 --- a/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml +++ b/.github/workflows/windows_x64_release_vitisai_build_x64_release.yml @@ -57,7 +57,7 @@ jobs: shell: cmd run: | set ORT_DOXY_SRC=${{ github.workspace }} - set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + set ORT_DOXY_OUT=${{ github.workspace }}\build\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 @@ -83,14 +83,35 @@ jobs: - 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 + ccache --zero-stats + + python.exe "${env:GITHUB_WORKSPACE}\tools\ci_build\build.py" ` + --build ` + --build_csharp ` + --build_dir "${env:GITHUB_WORKSPACE}\build" ` + --build_shared_lib ` + --build_wheel ` + --cmake_generator "Ninja" ` + --config RelWithDebInfo ` + --parallel ` + --skip_submodule_sync ` + --update ` + --use_binskim_compliant_compile_flags ` + --use_vcpkg ` + --use_vcpkg_ms_internal_asset_cache ` + --use_vitisai if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + Remove-Item "${env:GITHUB_WORKSPACE}\build\RelWithDebInfo" -Include "*.obj" -Recurse + ccache --show-stats -vv env: ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + - name: CCache Stats + shell: pwsh + run: ccache --show-stats -vv + - name: Validate C# native delegates shell: cmd run: python tools\ValidateNativeDelegateAttributes.py @@ -104,7 +125,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" env: OrtPackageId: Microsoft.ML.OnnxRuntime OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build diff --git a/.github/workflows/windows_x64_release_xnnpack.yml b/.github/workflows/windows_x64_release_xnnpack.yml index 1e55bd376a7e5..503dc7dad0694 100644 --- a/.github/workflows/windows_x64_release_xnnpack.yml +++ b/.github/workflows/windows_x64_release_xnnpack.yml @@ -36,6 +36,7 @@ jobs: uses: ./.github/actions/locate-vcvarsall-and-setup-env with: architecture: x64 + cache_key: windows_x64_release_xnnpack.yml | build_x64_release_xnnpack - name: Install python modules shell: cmd @@ -57,7 +58,7 @@ jobs: shell: cmd run: | set ORT_DOXY_SRC=${{ github.workspace }} - set ORT_DOXY_OUT=${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo + set ORT_DOXY_OUT=${{ github.workspace }}\build\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 @@ -83,15 +84,37 @@ jobs: - name: Build and Test shell: pwsh run: | - 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 + ccache --zero-stats + + python.exe "${env:GITHUB_WORKSPACE}\tools\ci_build\build.py" ` + --build_csharp ` + --build_dir "${env:GITHUB_WORKSPACE}\build" ` + --build_nuget ` + --build_shared_lib ` + --cmake_generator "Ninja" ` + --config RelWithDebInfo ` + --disable_rtti ` + --enable_onnx_tests ` + --msbuild_extra_options "IncludeMobileTargets=false" ` + --parallel ` + --skip_submodule_sync ` + --use_binskim_compliant_compile_flags ` + --use_cache ` + --use_vcpkg ` + --use_vcpkg_ms_internal_asset_cache ` + --use_xnnpack if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - Remove-Item "${{ github.workspace }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + Remove-Item "${env:GITHUB_WORKSPACE}\build\RelWithDebInfo" -Include "*.obj" -Recurse env: ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' DocUpdateNeeded: 'false' + - name: CCache Stats + shell: pwsh + run: ccache --show-stats -vv + - name: Validate C# native delegates shell: cmd run: python tools\ValidateNativeDelegateAttributes.py diff --git a/.github/workflows/windows_x86.yml b/.github/workflows/windows_x86.yml deleted file mode 100644 index 897b4f712ffdd..0000000000000 --- a/.github/workflows/windows_x86.yml +++ /dev/null @@ -1,164 +0,0 @@ -name: Windows CPU CI Pipeline - -on: - push: - branches: [main, 'rel-*'] - pull_request: - branches: [main] - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }} - cancel-in-progress: true - -jobs: - build_x86_release: - runs-on: [ - "self-hosted", - "1ES.Pool=onnxruntime-github-vs2022-latest", - "JobId=windows-x86-release-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" - ] - timeout-minutes: 300 - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - with: - submodules: false - - - name: Setup Python - uses: actions/setup-python@v6 - 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" - - - name: Setup Node.js - uses: actions/setup-node@v6 - with: - node-version: '20.x' - architecture: x86 #Add architecture - - - name: Setup Java - uses: actions/setup-java@v5 - 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@v5 - with: - dotnet-version: '8.x' - env: - PROCESSOR_ARCHITECTURE: x86 # x86 .NET - - - name: Prefer x86 dotnet on PATH - shell: pwsh - run: | - $x86DotnetDir = 'C:\Program Files (x86)\dotnet' - $x64DotnetDir = 'C:\Program Files\dotnet' - $machinePath = [Environment]::GetEnvironmentVariable('Path', 'Machine') - Write-Host "Machine PATH: $machinePath" - - $pathEntries = @($env:PATH -split ';' | Where-Object { $_ }) - $reorderedPathEntries = @( - $x86DotnetDir - $pathEntries | Where-Object { $_ -ne $x86DotnetDir } - ) - - $env:PATH = ($reorderedPathEntries -join ';') - - # Only add the x86 dotnet directory to GITHUB_PATH if it is not already on PATH (after normalization) - $normalizedX86DotnetDir = $x86DotnetDir.TrimEnd('\') - $normalizedPathEntries = $pathEntries | ForEach-Object { $_.TrimEnd('\') } - if (-not ($normalizedPathEntries -contains $normalizedX86DotnetDir)) { - Add-Content -Path $env:GITHUB_PATH -Value $x86DotnetDir - } - $dotnetPaths = @(Get-Command dotnet -All | Select-Object -ExpandProperty Source -Unique) - Write-Host 'Resolved dotnet executables:' - $dotnetPaths | ForEach-Object { Write-Host $_ } - - $x86DotnetExe = "$x86DotnetDir\dotnet.exe" - $x64DotnetExe = "$x64DotnetDir\dotnet.exe" - $x86Index = $dotnetPaths.IndexOf($x86DotnetExe) - $x64Index = $dotnetPaths.IndexOf($x64DotnetExe) - - if ($x86Index -lt 0) { - throw "Expected x86 dotnet executable was not found: $x86DotnetExe" - } - - if ($x64Index -ge 0 -and $x86Index -gt $x64Index) { - throw "x86 dotnet must appear before x64 dotnet on PATH. Found $x86DotnetExe after $x64DotnetExe." - } - - - name: Use Nuget 6.x - uses: nuget/setup-nuget@v2 - 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: 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 --compile_no_warning_as_error --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' - - - 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@v6 - if: failure() && env.DocUpdateNeeded == 'true' - with: - name: OperatorKernels.md - path: ${{ github.workspace }}/docs/OperatorKernels.md - - - name: Publish ContribOperators.md (Conditional) - uses: actions/upload-artifact@v6 - 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/cmake/onnxruntime.cmake b/cmake/onnxruntime.cmake index ff06ae91bead9..fc285f528a413 100644 --- a/cmake/onnxruntime.cmake +++ b/cmake/onnxruntime.cmake @@ -268,6 +268,11 @@ if (onnxruntime_USE_EXTENSIONS) ) endif() +if(WIN32) + # required if we're delay loading anything + list(APPEND onnxruntime_EXTERNAL_LIBRARIES delayimp.lib) +endif() + # If you are linking a new library, please add it to the list onnxruntime_INTERNAL_LIBRARIES or onnxruntime_EXTERNAL_LIBRARIES, # Please do not add a library directly to the target_link_libraries command if (onnxruntime_BUILD_SHARED_LIB) @@ -285,6 +290,7 @@ endif() if(WIN32) target_link_options(onnxruntime PRIVATE ${onnxruntime_DELAYLOAD_FLAGS}) endif() + #See: https://cmake.org/cmake/help/latest/prop_tgt/SOVERSION.html if(NOT APPLE AND NOT WIN32) if(CMAKE_SYSTEM_NAME MATCHES "AIX") diff --git a/csharp/OnnxRuntime.CSharp.proj b/csharp/OnnxRuntime.CSharp.proj index 6779fd60bcd0a..a3180c7d0e4a4 100644 --- a/csharp/OnnxRuntime.CSharp.proj +++ b/csharp/OnnxRuntime.CSharp.proj @@ -43,7 +43,7 @@ CMake creates a target to this project ..\build\Windows $(OnnxRuntimeBuildDirectory)\packages - $(OnnxRuntimeBuildDirectory)\$(Configuration)\$(Configuration) + $(OnnxRuntimeBuildDirectory)\$(Configuration) python diff --git a/csharp/sample/InferenceSample/Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp/Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp.csproj b/csharp/sample/InferenceSample/Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp/Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp.csproj index 2f81e52d0464d..b532583386c0b 100644 --- a/csharp/sample/InferenceSample/Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp/Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp.csproj +++ b/csharp/sample/InferenceSample/Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp/Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp.csproj @@ -6,9 +6,9 @@ AnyCPU;x86 $(ProjectDir)..\..\.. Debug;Release;RelWithDebInfo - true - true - true + true + true + true @@ -20,13 +20,13 @@ $(OnnxRuntimeCsharpRoot)\..\build\Windows - $(OnnxRuntimeBuildDirectory)\$(Configuration)\$(Configuration) + $(OnnxRuntimeBuildDirectory)\$(Configuration) $(OnnxRuntimeCsharpRoot)\..\build\MacOS - $(OnnxRuntimeBuildDirectory)\$(Configuration) + $(OnnxRuntimeBuildDirectory)\$(Configuration) diff --git a/csharp/src/Microsoft.AI.MachineLearning.Interop/Microsoft.AI.MachineLearning.Interop.csproj b/csharp/src/Microsoft.AI.MachineLearning.Interop/Microsoft.AI.MachineLearning.Interop.csproj index 5e727372d0276..db647abe6f5bf 100644 --- a/csharp/src/Microsoft.AI.MachineLearning.Interop/Microsoft.AI.MachineLearning.Interop.csproj +++ b/csharp/src/Microsoft.AI.MachineLearning.Interop/Microsoft.AI.MachineLearning.Interop.csproj @@ -9,7 +9,7 @@ Debug ..\..\..\build\Windows - $(OnnxRuntimeBuildDirectory)\$(Configuration)\$(Configuration) + $(OnnxRuntimeBuildDirectory)\$(Configuration) $(BuildOutputDir)\Microsoft.AI.MachineLearning.Interop $(WindowsAIInteropOutputDir) diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj b/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj index 193be042ae420..e22b7fe1c62fb 100644 --- a/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj +++ b/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj @@ -136,7 +136,7 @@ Properties that are used when creating the managed package using the Pack target. --> - $(OnnxRuntimeBuildDirectory)\$(Configuration)\$(Configuration) + $(OnnxRuntimeBuildDirectory)\$(Configuration) $(OnnxRuntimeBuildDirectory)\$(Configuration) diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj b/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj index 4da9b5ffae3e4..e3e9b9897da2c 100644 --- a/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj +++ b/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj @@ -27,7 +27,7 @@ $(OnnxRuntimeCsharpRoot)\..\build\Windows - $(OnnxRuntimeBuildDirectory)\$(Configuration)\$(Configuration) + $(OnnxRuntimeBuildDirectory)\$(Configuration) diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/NativeLibraryInclude.props b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/NativeLibraryInclude.props index 3daab21dbcbac..d9f4da4d7081e 100644 --- a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/NativeLibraryInclude.props +++ b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/NativeLibraryInclude.props @@ -66,7 +66,7 @@ test project only targets net8 and netstandard2.0. $(OnnxRuntimeRoot)\build\Windows - $(OnnxRuntimeBuildDirectory)\$(Configuration)\$(Configuration) + $(OnnxRuntimeBuildDirectory)\$(Configuration) diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp.csproj b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp.csproj index 54b9925710296..8497b92fe1fc6 100644 --- a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp.csproj +++ b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp.csproj @@ -45,7 +45,7 @@ $(OnnxRuntimeRoot)\build\Windows - $(OnnxRuntimeBuildDirectory)\$(Configuration)\$(Configuration) + $(OnnxRuntimeBuildDirectory)\$(Configuration) diff --git a/csharp/tools/Microsoft.ML.OnnxRuntime.PerfTool/Microsoft.ML.OnnxRuntime.PerfTool.csproj b/csharp/tools/Microsoft.ML.OnnxRuntime.PerfTool/Microsoft.ML.OnnxRuntime.PerfTool.csproj index f3e070044ad6f..582662e6cedbc 100644 --- a/csharp/tools/Microsoft.ML.OnnxRuntime.PerfTool/Microsoft.ML.OnnxRuntime.PerfTool.csproj +++ b/csharp/tools/Microsoft.ML.OnnxRuntime.PerfTool/Microsoft.ML.OnnxRuntime.PerfTool.csproj @@ -26,7 +26,7 @@ $(OnnxRuntimeCsharpRoot)\..\build\Windows - $(OnnxRuntimeBuildDirectory)\$(Configuration)\$(Configuration) + $(OnnxRuntimeBuildDirectory)\$(Configuration) $(OnnxRuntimeBuildDirectory)\$(Configuration)\external\protobuf\cmake\$(Configuration) $(ProtocDirectory)\protoc.exe diff --git a/onnxruntime/python/tools/quantization/README.md b/onnxruntime/python/tools/quantization/README.md index 16d6f3f2fd346..50c229566b4e2 100644 --- a/onnxruntime/python/tools/quantization/README.md +++ b/onnxruntime/python/tools/quantization/README.md @@ -57,7 +57,7 @@ Install the python tools built in onnxruntime cd work_dir python -m venv ort_env ort_env\Scripts\activate -python -m pip install \RelWithDebInfo\RelWithDebInfo\dist\.whl +python -m pip install \RelWithDebInfo\dist\.whl # The following command yields model_quant.onnx under the same directory "resnet18-v1-7" python -m onnxruntime.quantization.static_quantize_runner -i resnet18-v1-7\model.onnx -o resnet18-v1-7\model_quant.onnx diff --git a/onnxruntime/test/platform/windows/logging/HowToValidateEtwSinkOutput.md b/onnxruntime/test/platform/windows/logging/HowToValidateEtwSinkOutput.md index 309b474c016c9..d496636d0c13b 100644 --- a/onnxruntime/test/platform/windows/logging/HowToValidateEtwSinkOutput.md +++ b/onnxruntime/test/platform/windows/logging/HowToValidateEtwSinkOutput.md @@ -29,7 +29,7 @@ Run the ETW sink unit tests * Run the tests in etw_sink_test.cc and then stop WPR. * This can be done by executing the specific tests in Visual Studio, * or by running the exe with all the tests from the platform library - * Assuming debug build on Windows run `\build\Windows\Debug\Debug\onnxruntime_test_framework.exe` + * Assuming debug build on Windows run `\build\Windows\Debug\onnxruntime_test_framework.exe` Stop the ETW tracing `\onnxruntime\test\platform\windows\logging> wpr -stop TraceCaptureFile.etl EtwSinkTest` diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 7eeb9cb59d0b2..04ea1f518ec6e 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -722,7 +722,12 @@ def generate_build_tree( if args.use_cuda: nvcc_threads = number_of_nvcc_threads(args) cmake_args.append("-Donnxruntime_NVCC_THREADS=" + str(nvcc_threads)) - cmake_args.append(f"-DCMAKE_CUDA_COMPILER={cuda_home}/bin/nvcc") + if is_windows(): + # be explicit and use the entire filename name + cmake_args.append(f"-DCMAKE_CUDA_COMPILER={cuda_home}/bin/nvcc.exe") + else: + cmake_args.append(f"-DCMAKE_CUDA_COMPILER={cuda_home}/bin/nvcc") + add_default_definition(cmake_extra_defines, "onnxruntime_USE_CUDA", "ON") if args.cuda_version: add_default_definition(cmake_extra_defines, "onnxruntime_CUDA_VERSION", args.cuda_version) @@ -1745,7 +1750,7 @@ def run_onnxruntime_tests(args, source_dir, ctest_path, build_dir, configs): if is_reduced_ops_build(args) or args.minimal_build is not None: return - if is_windows(): + if is_windows() and args.cmake_generator != "Ninja": cwd = os.path.join(cwd, config) if not args.skip_pip_install and args.enable_transformers_tool_test and not args.disable_contrib_ops: diff --git a/tools/ci_build/github/azure-pipelines/dml-nuget-packaging.yml b/tools/ci_build/github/azure-pipelines/dml-nuget-packaging.yml index 3cf28655c36e7..17d0151992fb7 100644 --- a/tools/ci_build/github/azure-pipelines/dml-nuget-packaging.yml +++ b/tools/ci_build/github/azure-pipelines/dml-nuget-packaging.yml @@ -80,10 +80,10 @@ extends: if errorlevel 1 exit /b 1 copy $(Build.SourcesDirectory)\csharp\src\Microsoft.ML.OnnxRuntime\bin\RelWithDebInfo\*.nupkg $(Build.ArtifactStagingDirectory) if errorlevel 1 exit /b 1 - powershell -ExecutionPolicy Bypass -File $(Build.SourcesDirectory)\tools\ci_build\github\windows\select_dml_package.ps1 -SourceDir "$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo" -IsReleaseBuild "${{ parameters.IsReleaseBuild }}" -Action copy -DestinationDir "$(Build.ArtifactStagingDirectory)" + powershell -ExecutionPolicy Bypass -File $(Build.SourcesDirectory)\tools\ci_build\github\windows\select_dml_package.ps1 -SourceDir "$(Build.BinariesDirectory)\RelWithDebInfo" -IsReleaseBuild "${{ parameters.IsReleaseBuild }}" -Action copy -DestinationDir "$(Build.ArtifactStagingDirectory)" if errorlevel 1 exit /b 1 mkdir $(Build.ArtifactStagingDirectory)\testdata - copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\custom_op_library.* $(Build.ArtifactStagingDirectory)\testdata + copy $(Build.BinariesDirectory)\RelWithDebInfo\custom_op_library.* $(Build.ArtifactStagingDirectory)\testdata - template: nuget/templates/dml-vs-2022.yml parameters: @@ -101,12 +101,12 @@ extends: python -m pip install setuptools msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /p:TargetArchitecture=arm64 /t:CreatePackage /p:OrtPackageId=Microsoft.ML.OnnxRuntime.DirectML /p:IsReleaseBuild=${{ parameters.IsReleaseBuild }} if errorlevel 1 exit /b 1 - powershell -ExecutionPolicy Bypass -File $(Build.SourcesDirectory)\tools\ci_build\github\windows\select_dml_package.ps1 -SourceDir "$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo" -IsReleaseBuild "${{ parameters.IsReleaseBuild }}" -Action rename -NewName "win-dml-arm64.zip" + powershell -ExecutionPolicy Bypass -File $(Build.SourcesDirectory)\tools\ci_build\github\windows\select_dml_package.ps1 -SourceDir "$(Build.BinariesDirectory)\RelWithDebInfo" -IsReleaseBuild "${{ parameters.IsReleaseBuild }}" -Action rename -NewName "win-dml-arm64.zip" if errorlevel 1 exit /b 1 - copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\win-dml-arm64.zip $(Build.ArtifactStagingDirectory) + copy $(Build.BinariesDirectory)\RelWithDebInfo\win-dml-arm64.zip $(Build.ArtifactStagingDirectory) if errorlevel 1 exit /b 1 mkdir $(Build.ArtifactStagingDirectory)\testdata - copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\custom_op_library.* $(Build.ArtifactStagingDirectory)\testdata + copy $(Build.BinariesDirectory)\RelWithDebInfo\custom_op_library.* $(Build.ArtifactStagingDirectory)\testdata - template: stages/nuget_dml_packaging_stage.yml parameters: diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/dml-vs-2022.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/dml-vs-2022.yml index 2548eebeb9d42..6aea5c372d40b 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/dml-vs-2022.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/dml-vs-2022.yml @@ -138,5 +138,5 @@ stages: symbolProject: 'ONNX Runtime' subscription: 'OnnxrunTimeCodeSign_20240611' searchPattern: | - $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\onnxruntime.pdb - $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\onnxruntime_providers_*.pdb + $(Build.BinariesDirectory)\RelWithDebInfo\onnxruntime.pdb + $(Build.BinariesDirectory)\RelWithDebInfo\onnxruntime_providers_*.pdb diff --git a/tools/ci_build/github/azure-pipelines/stages/nuget-cuda-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/nuget-cuda-packaging-stage.yml index a0f578e22f910..ca47d12c0a659 100644 --- a/tools/ci_build/github/azure-pipelines/stages/nuget-cuda-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/nuget-cuda-packaging-stage.yml @@ -149,19 +149,19 @@ stages: displayName: 'Add TensorRT header file to the native nuGet package' inputs: filename: $(Build.SourcesDirectory)\tools\ci_build\github\windows\bundle_nuget_with_native_headers.bat - workingFolder: $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo + workingFolder: $(Build.BinariesDirectory)\RelWithDebInfo - task: CopyFiles@2 displayName: 'Copy nuget packages to: $(Build.ArtifactStagingDirectory)' inputs: - SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo' + SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo' Contents: '*.snupkg' TargetFolder: '$(Build.ArtifactStagingDirectory)' - task: CopyFiles@2 displayName: 'Copy nuget packages to: $(Build.ArtifactStagingDirectory)' inputs: - SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo' + SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo' Contents: '*.nupkg' TargetFolder: '$(Build.ArtifactStagingDirectory)' diff --git a/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml b/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml index 448dbafcaaaac..5a20564606d47 100644 --- a/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml @@ -371,14 +371,14 @@ stages: - task: CopyFiles@2 displayName: 'Copy native nuget package to: $(Build.ArtifactStagingDirectory)' inputs: - SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo' + SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo' Contents: '*.nupkg' TargetFolder: '$(Build.ArtifactStagingDirectory)' - task: CopyFiles@2 displayName: 'Copy native nuget symbols package to: $(Build.ArtifactStagingDirectory)' inputs: - SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo' + SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo' Contents: '*.snupkg' TargetFolder: '$(Build.ArtifactStagingDirectory)' diff --git a/tools/ci_build/github/azure-pipelines/templates/py-win-arm64-qnn.yml b/tools/ci_build/github/azure-pipelines/templates/py-win-arm64-qnn.yml index 50229d91fbf03..fc1437e2c1699 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-win-arm64-qnn.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-win-arm64-qnn.yml @@ -111,7 +111,7 @@ jobs: # Esrp signing - template: win-esrp-dll.yml parameters: - FolderPath: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\onnxruntime\capi' + FolderPath: '$(Build.BinariesDirectory)\RelWithDebInfo\onnxruntime\capi' DisplayName: 'ESRP - Sign Native dlls' DoEsrp: true Pattern: '*.pyd' @@ -121,11 +121,11 @@ jobs: inputs: scriptPath: '$(Build.SourcesDirectory)\setup.py' arguments: 'bdist_wheel $(NightlyBuildOption) --wheel_name_suffix=qnn' - workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo' + workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo' - task: CopyFiles@2 displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)' inputs: - SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\dist' + SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\dist' Contents: '*.whl' TargetFolder: '$(Build.ArtifactStagingDirectory)' diff --git a/tools/ci_build/github/azure-pipelines/templates/py-win-arm64ec-qnn.yml b/tools/ci_build/github/azure-pipelines/templates/py-win-arm64ec-qnn.yml index c350c56758a3b..97f8b4517f3ce 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-win-arm64ec-qnn.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-win-arm64ec-qnn.yml @@ -91,7 +91,7 @@ jobs: # Esrp signing - template: win-esrp-dll.yml parameters: - FolderPath: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\onnxruntime\capi' + FolderPath: '$(Build.BinariesDirectory)\RelWithDebInfo\onnxruntime\capi' DisplayName: 'ESRP - Sign Native dlls' DoEsrp: true Pattern: '*.pyd' @@ -101,12 +101,12 @@ jobs: inputs: scriptPath: '$(Build.SourcesDirectory)\setup.py' arguments: 'bdist_wheel $(NightlyBuildOption) --wheel_name_suffix=qnn' - workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo' + workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo' - task: CopyFiles@2 displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)' inputs: - SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\dist' + SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\dist' Contents: '*.whl' TargetFolder: '$(Build.ArtifactStagingDirectory)' diff --git a/tools/ci_build/github/azure-pipelines/templates/py-win-x64-qnn.yml b/tools/ci_build/github/azure-pipelines/templates/py-win-x64-qnn.yml index 0363f2a5ffa0d..6cb1d1c9a2ab3 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-win-x64-qnn.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-win-x64-qnn.yml @@ -94,7 +94,7 @@ jobs: # Esrp signing - template: win-esrp-dll.yml parameters: - FolderPath: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\onnxruntime\capi' + FolderPath: '$(Build.BinariesDirectory)\RelWithDebInfo\onnxruntime\capi' DisplayName: 'ESRP - Sign Native dlls' DoEsrp: true Pattern: '*.pyd' @@ -104,12 +104,12 @@ jobs: inputs: scriptPath: '$(Build.SourcesDirectory)\setup.py' arguments: 'bdist_wheel $(NightlyBuildOption) --wheel_name_suffix=qnn' - workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo' + workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo' - task: CopyFiles@2 displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)' inputs: - SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\dist' + SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\dist' Contents: '*.whl' TargetFolder: '$(Build.ArtifactStagingDirectory)' diff --git a/tools/ci_build/github/azure-pipelines/templates/win-ci.yml b/tools/ci_build/github/azure-pipelines/templates/win-ci.yml index 8a5584c111525..52e9253926d02 100644 --- a/tools/ci_build/github/azure-pipelines/templates/win-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/win-ci.yml @@ -279,6 +279,6 @@ stages: displayName: 'Copy custom_op_library to: $(Build.ArtifactStagingDirectory)' condition: and(succeeded(), eq('${{ parameters.packageName}}', 'x64')) inputs: - SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo' + SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo' Contents: 'custom_op_library.dll' TargetFolder: '$(Build.ArtifactStagingDirectory)/testdata' diff --git a/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-cuda-minimal-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-cuda-minimal-ci-pipeline.yml index 6aba9d3d9ac63..ac38accada797 100644 --- a/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-cuda-minimal-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-cuda-minimal-ci-pipeline.yml @@ -88,4 +88,4 @@ jobs: inputs: scriptPath: '$(Build.SourcesDirectory)\setup.py' arguments: 'bdist_wheel' - workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo' + workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo' diff --git a/tools/ci_build/github/windows/extract_nuget_files.ps1 b/tools/ci_build/github/windows/extract_nuget_files.ps1 index 20d6c1f2b63a5..e551b288df079 100644 --- a/tools/ci_build/github/windows/extract_nuget_files.ps1 +++ b/tools/ci_build/github/windows/extract_nuget_files.ps1 @@ -4,7 +4,7 @@ # This file is used by Zip-Nuget-Java Packaging Pipeline # Define the directory for NuGet artifacts. -$nuget_artifacts_dir = "$Env:BUILD_BINARIESDIRECTORY\RelWithDebInfo\RelWithDebInfo\nuget-artifacts" +$nuget_artifacts_dir = "$Env:BUILD_BINARIESDIRECTORY\RelWithDebInfo\nuget-artifacts" # Create the directory if it doesn't exist. New-Item -Path $nuget_artifacts_dir -ItemType directory -ErrorAction SilentlyContinue @@ -92,7 +92,7 @@ if ($is_training_pipeline) { } # Copy onnxruntime and protoc binaries required by tests. -$destinationDir = "$Env:BUILD_BINARIESDIRECTORY\RelWithDebInfo\RelWithDebInfo" +$destinationDir = "$Env:BUILD_BINARIESDIRECTORY\RelWithDebInfo" if ($is_training_pipeline) { Copy-Item -Path "$nuget_artifacts_dir\onnxruntime-training-win-x64-*\lib\*" -Destination $destinationDir -Recurse } @@ -116,4 +116,4 @@ Get-ChildItem -Directory -Path "$nuget_artifacts_dir\onnxruntime-*" | ForEach-Ob # List the final artifacts. Write-Output "Post-copy artifacts:" -Get-ChildItem -Recurse $nuget_artifacts_dir \ No newline at end of file +Get-ChildItem -Recurse $nuget_artifacts_dir diff --git a/tools/ci_build/github/windows/extract_nuget_files_gpu.ps1 b/tools/ci_build/github/windows/extract_nuget_files_gpu.ps1 index 29946dcb73f8a..c3e473ae18e3f 100644 --- a/tools/ci_build/github/windows/extract_nuget_files_gpu.ps1 +++ b/tools/ci_build/github/windows/extract_nuget_files_gpu.ps1 @@ -3,7 +3,7 @@ # This file is used by Zip-Nuget-Java Packaging Pipeline # Define the directory for NuGet artifacts. -$nuget_artifacts_dir = "$Env:BUILD_BINARIESDIRECTORY\RelWithDebInfo\RelWithDebInfo\nuget-artifacts" +$nuget_artifacts_dir = "$Env:BUILD_BINARIESDIRECTORY\RelWithDebInfo\nuget-artifacts" # Create the directory if it doesn't exist. New-Item -Path $nuget_artifacts_dir -ItemType directory -ErrorAction SilentlyContinue @@ -48,7 +48,7 @@ Foreach-Object { New-Item -Path "$Env:BUILD_BINARIESDIRECTORY\RelWithDebInfo\_deps\protobuf-build\RelWithDebInfo" -ItemType directory -ErrorAction SilentlyContinue # Copy CUDA libraries. -Copy-Item -Path "$Env:BUILD_BINARIESDIRECTORY\RelWithDebInfo\RelWithDebInfo\nuget-artifacts\onnxruntime-win-x64-cuda-*\lib\*" -Destination "$Env:BUILD_BINARIESDIRECTORY\RelWithDebInfo\RelWithDebInfo" +Copy-Item -Path "$Env:BUILD_BINARIESDIRECTORY\RelWithDebInfo\nuget-artifacts\onnxruntime-win-x64-cuda-*\lib\*" -Destination "$Env:BUILD_BINARIESDIRECTORY\RelWithDebInfo" # Install protoc via dotnet. $protocInstallDir = "$Env:BUILD_BINARIESDIRECTORY\RelWithDebInfo\_deps\protobuf-build" @@ -69,7 +69,7 @@ else { } # Rename onnxruntime directories to a generic format. -$ort_dirs = Get-ChildItem -Path "$Env:BUILD_BINARIESDIRECTORY\RelWithDebInfo\RelWithDebInfo\nuget-artifacts\onnxruntime-*" -Directory +$ort_dirs = Get-ChildItem -Path "$Env:BUILD_BINARIESDIRECTORY\RelWithDebInfo\nuget-artifacts\onnxruntime-*" -Directory foreach ($ort_dir in $ort_dirs) { $dirname = Split-Path -Path $ort_dir -Leaf $lastHyphenIndex = $dirname.LastIndexOf('-')