diff --git a/.github/actions/install-onnxruntime-wheel/action.yml b/.github/actions/install-onnxruntime-wheel/action.yml new file mode 100644 index 0000000000000..07f9a00a1dbcf --- /dev/null +++ b/.github/actions/install-onnxruntime-wheel/action.yml @@ -0,0 +1,18 @@ +name: 'Install ONNX Runtime Wheel' +description: 'Uninstalls existing ONNX Runtime packages and installs a wheel from a specified directory.' +inputs: + whl-directory: + description: 'The directory containing the ONNX Runtime wheel files.' + required: true +runs: + using: 'composite' + steps: + - name: Uninstall onnxruntime packages + shell: pwsh + run: | + python -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq + + - name: Install onnxruntime wheel from specified directory + shell: pwsh + run: | + Get-ChildItem -Path ${{ inputs.whl-directory }}/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} \ No newline at end of file diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 063b5488499e1..d2738f7d09d79 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -2,9 +2,14 @@ name: iOS_CI_on_Mac on: push: - branches: [ main, 'rel-*'] + branches: + - main + - rel-* pull_request: - branches: [ main ] + branches: + - main + - rel-* + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/windows_cuda.yml b/.github/workflows/windows_cuda.yml new file mode 100644 index 0000000000000..d26ee0a2b766e --- /dev/null +++ b/.github/workflows/windows_cuda.yml @@ -0,0 +1,135 @@ +name: ONNX Runtime CUDA Builds + +on: + push: + branches: + - main + - rel-* + pull_request: + branches: + - main + - rel-* + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x64_RelWithDebInfo: + name: Windows GPU CUDA CI Pipeline # Job name set here + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-Win2022-GPU-A10"] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for all tags and branches + submodules: 'none' + + - uses: actions/setup-python@v5 + 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 + run: python -m pip install -r .\tools\ci_build\github\windows\python\requirements.txt + working-directory: ${{ github.workspace }} + shell: cmd + + - name: Download CUDA SDK v12.2 + working-directory: ${{ runner.temp }} + run: | + azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v12.2" . + dir + shell: pwsh + + - name: Add CUDA to PATH + shell: powershell + run: | + Write-Host "Adding CUDA to PATH" + Write-Host "CUDA Path: $env:RUNNER_TEMP\v12.2\bin" + Add-Content -Path $env:GITHUB_PATH -Value "$env:RUNNER_TEMP\v12.2\bin" + Add-Content -Path $env:GITHUB_PATH -Value "$env:RUNNER_TEMP\v12.2\extras\CUPTI\lib64" + + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ runner.temp }}\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 }} + shell: cmd + + - uses: actions/setup-dotnet@v4 + env: + PROCESSOR_ARCHITECTURE: x64 + with: + dotnet-version: '8.x' + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v2 + with: + nuget-version: '6.x' + + - name: NuGet restore + run: nuget restore ${{ github.workspace }}\packages.config -ConfigFile ${{ github.workspace }}\NuGet.config -PackagesDirectory ${{ runner.temp }}\build\RelWithDebInfo + shell: cmd + + - 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: Set OnnxRuntimeBuildDirectory + shell: pwsh + run: | + $buildDir = Join-Path ${{ runner.temp }} "build" + echo "OnnxRuntimeBuildDirectory=$buildDir" >> $env:GITHUB_ENV + + - name: Build and Test + 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 --enable_onnx_tests --build_wheel --build_java --build_nodejs --use_cuda --cuda_home="$env:RUNNER_TEMP\v12.2" --enable_cuda_profiling --enable_transformers_tool_test --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=ON --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON + if ($lastExitCode -ne 0) { + exit $lastExitCode + } + Remove-Item "${{ runner.temp }}\build\RelWithDebInfo" -Include "*.obj" -Recurse + shell: pwsh + + - name: Validate C# native delegates + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\csharp + shell: cmd + + - name: Install ONNX Runtime Wheel + uses: ./.github/actions/install-onnxruntime-wheel + with: + whl-directory: ${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo\dist + + timeout-minutes: 300 + env: + OrtPackageId: Microsoft.ML.OnnxRuntime.Gpu + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + setVcvars: true + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + DocUpdateNeeded: false + ONNXRUNTIME_TEST_GPU_DEVICE_ID: '0' + AZCOPY_AUTO_LOGIN_TYPE: MSI + AZCOPY_MSI_CLIENT_ID: 63b63039-6328-442f-954b-5a64d124e5b4 \ No newline at end of file diff --git a/.github/workflows/windows_dml.yml b/.github/workflows/windows_dml.yml new file mode 100644 index 0000000000000..c7a4c796555d6 --- /dev/null +++ b/.github/workflows/windows_dml.yml @@ -0,0 +1,118 @@ +name: ONNX Runtime DirectML Builds + +on: + push: + branches: + - main + - rel-* + pull_request: + branches: + - main + - rel-* + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_x64_RelWithDebInfo: + name: Windows GPU DML CI Pipeline + env: + OrtPackageId: Microsoft.ML.OnnxRuntime.DirectML + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + setVcvars: true + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + DocUpdateNeeded: false + ONNXRUNTIME_TEST_GPU_DEVICE_ID: '0' + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-Win2022-GPU-A10"] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for all tags and branches + submodules: 'none' + + - uses: actions/setup-python@v5 + 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 + run: python -m pip install -r .\tools\ci_build\github\windows\python\requirements.txt + working-directory: ${{ github.workspace }} + shell: cmd + + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\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 }} + shell: cmd + + - uses: actions/setup-dotnet@v4 + env: + PROCESSOR_ARCHITECTURE: x64 + with: + dotnet-version: '8.x' + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v2 + with: + nuget-version: '6.x' + + - name: NuGet restore + run: nuget restore ${{ github.workspace }}\packages.config -ConfigFile ${{ github.workspace }}\NuGet.config -PackagesDirectory ${{ github.workspace }}\RelWithDebInfo + shell: cmd + + - 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: Set OnnxRuntimeBuildDirectory + shell: pwsh + run: | + $buildDir = Join-Path ${{ runner.temp }} "build" + echo "OnnxRuntimeBuildDirectory=$buildDir" >> $env:GITHUB_ENV + + - name: Build and Test + 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 --enable_onnx_tests --build_wheel --use_dml --enable_wcos --use_vcpkg --use_vcpkg_ms_internal_asset_cache + if ($lastExitCode -ne 0) { + exit $lastExitCode + } + Remove-Item "${{ github.workspace }}\RelWithDebInfo" -Include "*.obj" -Recurse + shell: pwsh + + - name: Validate C# native delegates + run: python tools\ValidateNativeDelegateAttributes.py + working-directory: ${{ github.workspace }}\csharp + shell: cmd + + - name: Install ONNX Runtime Wheel + uses: ./.github/actions/install-onnxruntime-wheel + with: + whl-directory: ${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo\dist + + \ No newline at end of file diff --git a/.github/workflows/windows_openvino.yml b/.github/workflows/windows_openvino.yml new file mode 100644 index 0000000000000..45ffa40273df8 --- /dev/null +++ b/.github/workflows/windows_openvino.yml @@ -0,0 +1,172 @@ +name: Windows OpenVINO CI Pipeline + +on: + push: + branches: + - main + - rel-* + pull_request: + branches: + - main + - rel-* + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + BUILD_OPENVINO_EP: + name: Windows OpenVINO CI Pipeline + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"] + timeout-minutes: 240 + env: + AZCOPY_AUTO_LOGIN_TYPE: MSI + AZCOPY_MSI_CLIENT_ID: 63b63039-6328-442f-954b-5a64d124e5b4 + OnnxRuntimeBuildDirectory: ${{ github.workspace }} + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + ALLOW_RELEASED_ONNX_OPSET_ONLY: '1' + BuildConfig: RelWithDebInfo + buildArch: x64 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: none + + - name: Setup Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: '3.12' + architecture: x64 #Keep x64, because the original pipeline is for x64 + + - name: Locate vcvarsall and Setup Env + uses: ./.github/actions/locate-vcvarsall-and-setup-env + 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: Download OpenVINO Toolkit v2025.0.0 + env: + OpenVINOVersion: 2025.0.0 + shell: pwsh + run: | + $Url = "https://storage.openvinotoolkit.org/repositories/openvino/packages/2025.0/windows/openvino_toolkit_windows_2025.0.0.17942.1f68be9f594_x86_64.zip" + $OutputPath = "$env:RUNNER_TEMP\openvino.zip" + $ExtractPath = "$env:RUNNER_TEMP\openvino-v$env:OpenVINOVersion" + $TempExtractPath = "$env:RUNNER_TEMP\openvino_temp" + + # Ensure directories exist + if (Test-Path $ExtractPath) { + Remove-Item -Recurse -Force $ExtractPath + } + New-Item -ItemType Directory -Path $ExtractPath | Out-Null + New-Item -ItemType Directory -Path $TempExtractPath | Out-Null + + # Download OpenVINO ZIP + Write-Output "Downloading OpenVINO" + Invoke-WebRequest -Uri $Url -OutFile $OutputPath + + # Extract to temporary directory first + Write-Output "Extracting OpenVINO to a temporary directory" + Expand-Archive -Path $OutputPath -DestinationPath $TempExtractPath -Force + + # Locate the nested subdirectory + $InnerFolder = Get-ChildItem -Path $TempExtractPath -Directory | Select-Object -First 1 + + if ($InnerFolder) { + Write-Output "Moving extracted files to final destination" + Move-Item -Path "$($InnerFolder.FullName)\*" -Destination $ExtractPath -Force + } else { + Write-Error "Extraction failed: No expected subdirectory found in $TempExtractPath." + Write-Error "The archive may not have extracted correctly, or its structure is different than expected." + exit 1 + } + + # Clean up temporary files + Remove-Item -Recurse -Force $TempExtractPath + Remove-Item -Force $OutputPath + + # Confirm success + Write-Output "OpenVINO extracted to $ExtractPath" + + - name: Set OpenVINORootDir + shell: pwsh + # Use $GITHUB_ENV to set the variable for subsequent steps + run: | + $openVinoRootDir = Join-Path $env:RUNNER_TEMP "openvino-v2025.0.0" + echo "OpenVINORootDir=$openVinoRootDir" >> $env:GITHUB_ENV + + - name: Print OpenVINORootDir after downloading OpenVINO + shell: cmd + run: 'echo %OpenVINORootDir%' + + - name: Print contents of OpenVINO Toolkit + shell: cmd + run: 'dir %OpenVINORootDir%' + + - name: Set up OpenVINO environment + shell: pwsh + run: | + Write-Output "Setting up OpenVINO environment variables" + . "$env:OpenVINORootDir\setupvars.ps1" + + Write-Output "Exporting selected environment variables to pipeline" + + $vars = @( + "INTEL_OPENVINO_DIR", + "OpenVINO_DIR", + "OpenVINOGenAI_DIR", + "OPENVINO_LIB_PATHS", + "TBB_DIR", + "PATH", + "PYTHONPATH" + ) + + foreach ($var in $vars) { + if (Test-Path "Env:$var") { + $value = [System.Environment]::GetEnvironmentVariable($var, "Process") + Write-Output "Setting $var=$value" + echo "$var=$value" >> $env:GITHUB_ENV # Append to GITHUB_ENV + } else { + Write-Output "Warning: $var is not set." + } + } + + Write-Output "Selected environment variables exported successfully" + + + + - name: Generate onnxruntime.sln + shell: pwsh + 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 + + - name: Build + shell: pwsh + 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 + + + - name: Run unit tests + shell: pwsh + working-directory: ${{ runner.temp }} + run: | + python "${{ 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 ` + --test --enable_onnx_tests \ No newline at end of file diff --git a/.github/workflows/windows_tensorrt.yml b/.github/workflows/windows_tensorrt.yml new file mode 100644 index 0000000000000..1f52b79b67d67 --- /dev/null +++ b/.github/workflows/windows_tensorrt.yml @@ -0,0 +1,101 @@ +name: Windows GPU TensorRT CI Pipeline + +on: + push: + branches: + - main + - rel-* + pull_request: + branches: + - main + - rel-* + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + Windows_GPU_TensorRT_CI_Pipeline: + name: Windows GPU TensorRT CI Pipeline + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-Win2022-GPU-A10"] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for all tags and branches + submodules: 'none' + + - uses: actions/setup-python@v5 + 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 + run: python -m pip install -r ${{ github.workspace }}\tools\ci_build\github\windows\python\requirements.txt + shell: cmd + + - name: Download Primary CUDA SDK v12.2 + run: 'azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v12.2" ${{ runner.temp }}' + shell: pwsh + env: + AZCOPY_AUTO_LOGIN_TYPE: MSI + AZCOPY_MSI_CLIENT_ID: 63b63039-6328-442f-954b-5a64d124e5b4 + + - name: Download TensorRT-10.8.0.43.Windows10.x86_64.cuda-12.8 + run: 'azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/local/TensorRT-10.8.0.43.Windows10.x86_64.cuda-12.8" ${{ runner.temp }}' + shell: pwsh + env: + AZCOPY_AUTO_LOGIN_TYPE: MSI + AZCOPY_MSI_CLIENT_ID: 63b63039-6328-442f-954b-5a64d124e5b4 + + - 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: Add CUDA to PATH + shell: powershell + run: | + Write-Host "Adding CUDA to PATH" + Write-Host "CUDA Path: $env:RUNNER_TEMP\v12.2\bin" + Add-Content -Path $env:GITHUB_PATH -Value "$env:RUNNER_TEMP\v12.2\bin" + Add-Content -Path $env:GITHUB_PATH -Value "$env:RUNNER_TEMP\v12.2\extras\CUPTI\lib64" + Add-Content -Path $env:GITHUB_PATH -Value "$env:RUNNER_TEMP\TensorRT-10.8.0.43.Windows10.x86_64.cuda-12.8\lib" + + - name: Generate sln + working-directory: ${{ runner.temp }} + run: | + python ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --parallel --use_binskim_compliant_compile_flags --build_dir build --skip_submodule_sync --build_shared_lib --update --cmake_generator "Visual Studio 17 2022" --build_wheel --enable_onnx_tests --use_tensorrt --tensorrt_home="${{ runner.temp }}\TensorRT-10.8.0.43.Windows10.x86_64.cuda-12.8" --cuda_home="${{ runner.temp }}\v12.2" --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 + shell: cmd + + - name: Build + working-directory: ${{ runner.temp }} + run: | + python ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --parallel --use_binskim_compliant_compile_flags --build_dir build --skip_submodule_sync --build_shared_lib --build --cmake_generator "Visual Studio 17 2022" --build_wheel --enable_onnx_tests --use_tensorrt --tensorrt_home="${{ runner.temp }}\TensorRT-10.8.0.43.Windows10.x86_64.cuda-12.8" --cuda_home="${{ runner.temp }}\v12.2" --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 + shell: cmd + + - name: Add build dir to PATH + shell: powershell + run: | + Write-Host "Adding CUDA to PATH" + Add-Content -Path $env:GITHUB_PATH -Value "$env:RUNNER_TEMP\build\RelWithDebInfo\RelWithDebInfo" + + - name: Install ONNX Runtime Wheel + uses: ./.github/actions/install-onnxruntime-wheel + with: + whl-directory: ${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo\dist + + - name: Run tests + working-directory: ${{ runner.temp }} + run: | + mklink /D /J ${{ github.workspace }}\RelWithDebInfo\models ${{ github.workspace }}\models + python ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --parallel --use_binskim_compliant_compile_flags --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.8.0.43.Windows10.x86_64.cuda-12.8" --cuda_home="${{ runner.temp }}\v12.2" --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 + shell: cmd + timeout-minutes: 180 \ No newline at end of file diff --git a/.github/workflows/windows_webgpu.yml b/.github/workflows/windows_webgpu.yml new file mode 100644 index 0000000000000..7b8415c223e0f --- /dev/null +++ b/.github/workflows/windows_webgpu.yml @@ -0,0 +1,262 @@ +name: ONNX Runtime WebGPU Builds + +on: + push: + branches: + - main + - rel-* + pull_request: + branches: + - main + - rel-* + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + webgpu_build_x64_RelWithDebInfo: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-Win2022-GPU-A10"] + timeout-minutes: 300 + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }} + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + setVcvars: true + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + DocUpdateNeeded: false + NVIDIA_TF32_OVERRIDE: '0' + ONNXRUNTIME_TEST_GPU_DEVICE_ID: '0' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: none + + - name: Setup Python 3.12 + uses: actions/setup-python@v5 + 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 + run: python -m pip install -r tools\ci_build\github\windows\python\requirements.txt + shell: cmd + working-directory: ${{ github.workspace }} + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\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 + shell: cmd + working-directory: ${{ github.workspace }} + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + env: + PROCESSOR_ARCHITECTURE: x64 + with: + dotnet-version: '8.x' + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v2 + with: + nuget-version: '6.x' + + - name: NuGet restore + run: | + nuget restore packages.config -ConfigFile NuGet.config -PackagesDirectory ${{ github.workspace }}\RelWithDebInfo + shell: cmd + working-directory: ${{ github.workspace }} + + - 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 }} --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_nodejs --use_webgpu --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=ON onnxruntime_BUILD_DAWN_MONOLITHIC_LIBRARY=ON + if ($lastExitCode -ne 0) { + exit $lastExitCode + } + Remove-Item "${{ github.workspace }}\RelWithDebInfo" -Include "*.obj" -Recurse + + - name: Validate C# native delegates + run: python tools\ValidateNativeDelegateAttributes.py + shell: cmd + working-directory: ${{ github.workspace }}\csharp + continue-on-error: true + + + webgpu_external_dawn_build_x64_RelWithDebInfo: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-Win2022-GPU-A10"] + timeout-minutes: 300 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: none + + - name: Setup Python 3.12 + uses: actions/setup-python@v5 + 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 + run: python -m pip install -r tools\ci_build\github\windows\python\requirements.txt + shell: cmd + working-directory: ${{ github.workspace }} + + - 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: Generate onnxruntime.sln + 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 + + - 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 + + - name: Run tests (onnxruntime_webgpu_external_dawn_test) + run: onnxruntime_webgpu_external_dawn_test.exe + shell: cmd + working-directory: ${{ github.workspace }}\RelWithDebInfo\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 + + webgpu_minimal_build_edge_build_x64_RelWithDebInfo: + runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-Win2022-GPU-A10"] + timeout-minutes: 300 + env: + OrtPackageId: Microsoft.ML.OnnxRuntime + OnnxRuntimeBuildDirectory: ${{ github.workspace }} + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + ALLOW_RELEASED_ONNX_OPSET_ONLY: '0' + DocUpdateNeeded: false + ONNXRUNTIME_TEST_GPU_DEVICE_ID: '0' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: none + + - name: Setup Python 3.12 + uses: actions/setup-python@v5 + 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 + run: python -m pip install -r tools\ci_build\github\windows\python\requirements.txt + shell: cmd + working-directory: ${{ github.workspace }} + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + architecture: x64 + + - name: API Documentation Check and generate + run: | + set ORT_DOXY_SRC=${{ github.workspace }} + set ORT_DOXY_OUT=${{ github.workspace }}\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 + shell: cmd + working-directory: ${{ github.workspace }} + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + env: + PROCESSOR_ARCHITECTURE: x64 + with: + dotnet-version: '8.x' + + - name: Use Nuget 6.x + uses: nuget/setup-nuget@v2 + with: + nuget-version: '6.x' + + - name: NuGet restore + run: | + nuget restore packages.config -ConfigFile NuGet.config -PackagesDirectory ${{ github.workspace }}\RelWithDebInfo + shell: cmd + working-directory: ${{ github.workspace }} + + - 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 }} --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 + if ($lastExitCode -ne 0) { + exit $lastExitCode + } + Remove-Item "${{ github.workspace }}\RelWithDebInfo" -Include "*.obj" -Recurse + + - name: Validate C# native delegates + run: python tools\ValidateNativeDelegateAttributes.py + shell: cmd + working-directory: ${{ github.workspace }}\csharp \ No newline at end of file diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 657259b17b458..d5903c9d1d211 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1066,6 +1066,8 @@ def generate_vcpkg_install_options(build_dir, args): if args.disable_exceptions: folder_name_parts.append("noexception") if len(folder_name_parts) == 0: + # It's hard to tell whether we must use a custom triplet or not. The official triplets work fine for most common situations. However, if a Windows build has set msvc toolset version via args.msvc_toolset then we need to, because we need to ensure all the source code are compiled by the same MSVC toolset version otherwise we will hit link errors like "error LNK2019: unresolved external symbol __std_mismatch_4 referenced in function ..." + # So, to be safe we always use a custom triplet. folder_name = "default" else: folder_name = "_".join(folder_name_parts) @@ -1259,7 +1261,6 @@ def generate_build_tree( ) if args.use_vcpkg: - # TODO: set VCPKG_PLATFORM_TOOLSET_VERSION # Setup CMake flags for vcpkg # Find VCPKG's toolchain cmake file @@ -1339,7 +1340,7 @@ def generate_build_tree( elif args.android: generate_android_triplets(build_dir, args.android_cpp_shared, args.android_api) elif is_windows(): - generate_windows_triplets(build_dir) + generate_windows_triplets(build_dir, args.msvc_toolset) elif is_macOS(): osx_target = args.apple_deploy_target if args.apple_deploy_target is None: @@ -1380,7 +1381,7 @@ def generate_build_tree( target_arch = platform.machine() if args.arm64: target_arch = "ARM64" - elif args.arm64: + elif args.arm64ec: target_arch = "ARM64EC" cpu_arch = platform.architecture()[0] if target_arch == "AMD64": @@ -2646,6 +2647,7 @@ def build_nuget_package( use_dnnl, use_winml, use_qnn, + use_dml, enable_training_apis, msbuild_extra_options, ): @@ -2688,6 +2690,8 @@ def build_nuget_package( package_name = "/p:OrtPackageId=Microsoft.ML.OnnxRuntime.DNNL" elif use_cuda: package_name = "/p:OrtPackageId=Microsoft.ML.OnnxRuntime.Gpu" + elif use_dml: + package_name = "/p:OrtPackageId=Microsoft.ML.OnnxRuntime.DirectML" elif use_rocm: package_name = "/p:OrtPackageId=Microsoft.ML.OnnxRuntime.ROCm" elif use_qnn: @@ -3301,6 +3305,7 @@ def main(): args.use_dnnl, args.use_winml, args.use_qnn, + args.use_dml, args.enable_training_apis, normalize_arg_list(args.msbuild_extra_options), ) diff --git a/tools/ci_build/github/azure-pipelines/win-gpu-cuda-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-gpu-cuda-ci-pipeline.yml deleted file mode 100644 index cbebcad2af986..0000000000000 --- a/tools/ci_build/github/azure-pipelines/win-gpu-cuda-ci-pipeline.yml +++ /dev/null @@ -1,65 +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: CudaVersion - displayName: CUDA version - type: string - default: '12.2' - values: - - 11.8 - - 12.2 -- name: RunOnnxRuntimeTests - displayName: Run Tests? - type: boolean - default: true - -stages: -- stage: cuda - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - EnvSetupScript: setup_env_cuda.bat - buildArch: x64 - additionalBuildFlags: >- - --build_wheel --build_java --build_nodejs --use_cuda --cuda_home="$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}" - --enable_cuda_profiling --enable_transformers_tool_test - --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 - --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=ON - --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_RelWithDebInfo - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - ORT_EP_NAME: CUDA - WITH_CACHE: true - MachinePool: onnxruntime-Win2022-GPU-A10 \ No newline at end of file diff --git a/tools/ci_build/github/azure-pipelines/win-gpu-dml-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-gpu-dml-ci-pipeline.yml deleted file mode 100644 index 82ca32e65261c..0000000000000 --- a/tools/ci_build/github/azure-pipelines/win-gpu-dml-ci-pipeline.yml +++ /dev/null @@ -1,53 +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: dml - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - EnvSetupScript: setup_env.bat - buildArch: x64 - additionalBuildFlags: --build_wheel --use_dml --enable_wcos --use_winml --use_vcpkg --use_vcpkg_ms_internal_asset_cache - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_RelWithDebInfo - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - ORT_EP_NAME: DML - WITH_CACHE: false - MachinePool: onnxruntime-Win2022-GPU-dml-A10 \ No newline at end of file diff --git a/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml deleted file mode 100644 index 5c6d9dd6ed955..0000000000000 --- a/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml +++ /dev/null @@ -1,98 +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: CudaVersion - displayName: CUDA version - type: string - default: '12.2' - values: - - 11.8 - - 12.2 - -variables: - - template: templates/common-variables.yml - - name: win_trt_folder - ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: ${{ variables.win_trt_folder_cuda11 }} - ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: ${{ variables.win_trt_folder_cuda12 }} - -jobs: -- job: 'build' - pool: 'onnxruntime-Win2022-GPU-A10' - variables: - MsbuildArguments: '-detailedsummary -maxcpucount -consoleloggerparameters:PerformanceSummary' - EnvSetupScript: setup_env_trt.bat - skipComponentGovernanceDetection: true - TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] - timeoutInMinutes: 180 - workspace: - clean: all - steps: - - template: templates/jobs/win-ci-prebuild-steps.yml - parameters: - EnvSetupScript: $(EnvSetupScript) - DownloadCUDA: true - DownloadTRT: true - BuildArch: 'x64' - BuildConfig: RelWithDebInfo - MachinePool: 'onnxruntime-Win2022-GPU-A10' - WithCache: true - Today: $(Today) - - - template: templates/jobs/win-ci-build-steps.yml - parameters: - WithCache: True - Today: $(TODAY) - AdditionalKey: "gpu-tensorrt | RelWithDebInfo" - BuildPyArguments: '--config RelWithDebInfo --parallel --use_binskim_compliant_compile_flags --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --update --cmake_generator "Visual Studio 17 2022" --build_wheel --enable_onnx_tests --use_tensorrt --tensorrt_home="$(Agent.TempDirectory)\${{ variables.win_trt_folder }}" --cuda_home="$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}" --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86' - MsbuildArguments: $(MsbuildArguments) - BuildArch: 'x64' - Platform: 'x64' - BuildConfig: RelWithDebInfo - - - task: PythonScript@0 - displayName: 'Build wheel' - inputs: - scriptPath: '$(Build.SourcesDirectory)\setup.py' - arguments: 'bdist_wheel' - workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo' - - - script: | - mklink /D /J $(Build.BinariesDirectory)\RelWithDebInfo\models $(Build.BinariesDirectory)\models - DIR dist\ /S /B > wheel_filename_file - set /p WHEEL_FILENAME=- - --build_nodejs - --use_webgpu - --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=ON onnxruntime_BUILD_DAWN_MONOLITHIC_LIBRARY=ON - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_RelWithDebInfo - RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }} - ORT_EP_NAME: WebGPU - EnablePython: false - WITH_CACHE: true - MachinePool: onnxruntime-Win2022-VS2022-webgpu-A10 - -- stage: webgpu_external_dawn - dependsOn: [] - jobs: - - job: build_x64_RelWithDebInfo - variables: - DEPS_CACHE_DIR: $(Agent.TempDirectory)/deps_ccache - ORT_CACHE_DIR: $(Agent.TempDirectory)/ort_ccache - TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] - workspace: - clean: all - pool: onnxruntime-Win2022-VS2022-webgpu-A10 - timeoutInMinutes: 300 - steps: - - checkout: self - clean: true - submodules: none - - - template: templates/jobs/win-ci-prebuild-steps.yml - parameters: - EnvSetupScript: setup_env.bat - DownloadCUDA: false - DownloadTRT: false - BuildArch: x64 - BuildConfig: RelWithDebInfo - MachinePool: onnxruntime-Win2022-VS2022-webgpu-A10 - WithCache: true - Today: $(Today) - - - template: templates/jobs/win-ci-build-steps.yml - parameters: - WithCache: true - Today: $(TODAY) - CacheDir: $(ORT_CACHE_DIR) - AdditionalKey: " $(System.StageName) | RelWithDebInfo " - BuildPyArguments: '--config RelWithDebInfo --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --update --parallel --cmake_generator "Visual Studio 17 2022" --use_webgpu --use_external_dawn --skip_tests --target onnxruntime_webgpu_external_dawn_test' - MsbuildArguments: '-maxcpucount' - BuildArch: x64 - Platform: x64 - BuildConfig: RelWithDebInfo - - - script: | - onnxruntime_webgpu_external_dawn_test.exe - displayName: Run tests (onnxruntime_webgpu_external_dawn_test) - workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo' - - script: | - onnxruntime_webgpu_external_dawn_test.exe --no_proc_table - displayName: Run tests (onnxruntime_webgpu_external_dawn_test) - workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo' - -- stage: webgpu_minimal_build_edge - dependsOn: [] - jobs: - - template: templates/jobs/win-ci-vs-2022-job.yml - parameters: - BuildConfig: 'RelWithDebInfo' - EnvSetupScript: setup_env.bat - buildArch: x64 - additionalBuildFlags: >- - --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 - msbuildPlatform: x64 - isX86: false - job_name_suffix: x64_RelWithDebInfo - RunOnnxRuntimeTests: false - ORT_EP_NAME: WebGPU - EnablePython: false - WITH_CACHE: true - MachinePool: onnxruntime-Win2022-VS2022-webgpu-A10 diff --git a/tools/ci_build/github/azure-pipelines/win-openvino-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-openvino-ci-pipeline.yml deleted file mode 100644 index f95ac526886fa..0000000000000 --- a/tools/ci_build/github/azure-pipelines/win-openvino-ci-pipeline.yml +++ /dev/null @@ -1,116 +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: 'BUILD_OPENVINO_EP' - pool: 'onnxruntime-Win-CPU-2022' - variables: - MsbuildArguments: '-detailedsummary -maxcpucount -consoleloggerparameters:PerformanceSummary' - OnnxRuntimeBuildDirectory: '$(Build.BinariesDirectory)' - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - buildArch: x64 - setVcvars: true - BuildConfig: 'RelWithDebInfo' - ALLOW_RELEASED_ONNX_OPSET_ONLY: '1' - TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] - timeoutInMinutes: 240 - workspace: - clean: all - steps: - - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.12' - addToPath: true - architecture: $(buildArch) - - - template: templates/jobs/download_win_openvino.yml - - - powershell: | - Write-Output "Setting up OpenVINO environment variables" - . "$(OpenVINORootDir)\setupvars.ps1" - - Write-Output "Exporting selected environment variables to pipeline" - - $vars = @( - "INTEL_OPENVINO_DIR", - "OpenVINO_DIR", - "OpenVINOGenAI_DIR", - "OPENVINO_LIB_PATHS", - "TBB_DIR", - "PATH", - "PYTHONPATH" - ) - - foreach ($var in $vars) { - if (Test-Path "Env:$var") { - $value = [System.Environment]::GetEnvironmentVariable($var, "Process") - Write-Output "Setting $var" - Write-Output "##vso[task.setvariable variable=$var;]$value" - } else { - Write-Output "Warning: $var is not set." - } - } - - Write-Output "Selected environment variables exported successfully" - displayName: 'Set up OpenVINO environment' - - - template: templates/jobs/win-ci-build-steps.yml - parameters: - WithCache: True - Today: $(TODAY) - AdditionalKey: "win-openvino | $(BuildConfig)" - BuildPyArguments: >- - --config $(BuildConfig) - --build_dir $(Build.BinariesDirectory) - --cmake_generator "Visual Studio 17 2022" - --build_shared_lib - --use_openvino CPU - --use_binskim_compliant_compile_flags - --update --parallel - MsbuildArguments: $(MsbuildArguments) - BuildArch: $(buildArch) - Platform: 'x64' - BuildConfig: $(BuildConfig) - - - powershell: | - Write-Output "Getting CPU information" - Get-WmiObject Win32_Processor | Select-Object Name, NumberOfCores, NumberOfLogicalProcessors, Architecture | Format-Table -AutoSize - - Write-Output "Starting unit tests" - python "$(Build.SourcesDirectory)\tools\ci_build\build.py" ` - --config "$(BuildConfig)" ` - --build_dir "$(Build.BinariesDirectory)" ` - --cmake_generator "Visual Studio 17 2022" ` - --build_shared_lib ` - --use_openvino CPU ` - --use_binskim_compliant_compile_flags ` - --test --enable_onnx_tests - displayName: 'Run unit tests' diff --git a/tools/python/run_CIs_for_external_pr.py b/tools/python/run_CIs_for_external_pr.py index aca5f1df7d18b..20e0134dd370a 100644 --- a/tools/python/run_CIs_for_external_pr.py +++ b/tools/python/run_CIs_for_external_pr.py @@ -19,12 +19,7 @@ def get_pipeline_names(): # windows "Windows ARM64 QNN CI Pipeline", "Windows x64 QNN CI Pipeline", - "Windows CPU CI Pipeline", - "Windows GPU CUDA CI Pipeline", - "Windows GPU DML CI Pipeline", "Windows GPU Doc Gen CI Pipeline", - "Windows GPU TensorRT CI Pipeline", - "Windows OpenVINO CI Pipeline", "ONNX Runtime Web CI Pipeline", "Win_TRT_Minimal_CUDA_Test_CI", # linux @@ -34,8 +29,6 @@ def get_pipeline_names(): "Linux GPU TensorRT CI Pipeline", "Linux OpenVINO CI Pipeline", "Linux QNN CI Pipeline", - # mac - "MacOS CI Pipeline", # checks "onnxruntime-binary-size-checks-ci-pipeline", # big models @@ -46,7 +39,6 @@ def get_pipeline_names(): "Android CI Pipeline", "iOS CI Pipeline", "ONNX Runtime React Native CI Pipeline", - "CoreML CI Pipeline", "Linux DNNL CI Pipeline", "Linux MIGraphX CI Pipeline", "Linux ROCm CI Pipeline", diff --git a/tools/python/util/vcpkg_helpers.py b/tools/python/util/vcpkg_helpers.py index ccb3181c86486..df457cdbf2b95 100644 --- a/tools/python/util/vcpkg_helpers.py +++ b/tools/python/util/vcpkg_helpers.py @@ -429,12 +429,13 @@ def generate_vcpkg_triplets_for_emscripten(build_dir: str, emscripten_root: str) add_port_configs(f, True, True) -def generate_windows_triplets(build_dir: str) -> None: +def generate_windows_triplets(build_dir: str, toolset_version: str) -> None: """ Generate triplet files for Windows platforms. Args: build_dir (str): The directory to save the generated triplet files. + toolset_version (str, optional): The version of the platform toolset. """ # Below are all the CPU ARCHs we support on Windows. # ARM64 is for ARM64 processes that contains traditional ARM64 code. @@ -473,6 +474,8 @@ def generate_windows_triplets(build_dir: str) -> None: f.write(f"set(VCPKG_TARGET_ARCHITECTURE {target_abi})\n") f.write(f"set(VCPKG_CRT_LINKAGE {crt_linkage})\n") f.write("set(VCPKG_LIBRARY_LINKAGE static)\n") + if toolset_version: + f.write(f"set(VCPKG_PLATFORM_TOOLSET_VERSION {toolset_version})\n") cflags = ["/MP", "/DWIN32", "/D_WINDOWS"] if enable_binskim: cflags += [