-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Adding OpenVINO Windows CI Pipeline #23919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
351edab
Use win-qnn-ci-pipeline.yml as the base
yihonglyu 23111a8
Amend for win-openvino-ci-pipeline.yml accordingly
yihonglyu a620cc4
[Temp] Debug environment variables
yihonglyu b531d24
[Draft] Exporting environment variables to pipeline
yihonglyu c5e1c16
[Temp] Make timeoutInMinutes longer and add OpenVINO debug message
yihonglyu 99db3e0
[Draft] Use powershell to run unit test
yihonglyu 0169927
[Tmp] Skip test_register_custom_ops_library and test_register_custom_…
yihonglyu 6fd864e
[Tmp] Disable 'Run float32 model tests' and 'Run float32 model tests'
yihonglyu a92762a
Remove --build_wheel
yihonglyu 255c109
Revert "[Tmp] Skip test_register_custom_ops_library and test_register…
yihonglyu 925156a
Remove log message
yihonglyu 842d8f1
[Tmp] Get CPU information
yihonglyu cc4fd69
[Tmp] Use onnxruntime-Win2022-Intel-CPU for pool
yihonglyu 80d2a96
[Temp] Download OpenVINO externally
yihonglyu 27b4658
[Tmp] Fix syntax error
yihonglyu f5e0e0e
[Tmp] Get CPU info in 'Run unit tests' stage
yihonglyu 0b37582
Polish log message of download_win_openvino.yml
yihonglyu 49712b2
Remove log message
yihonglyu dd01908
[Draft] Revert cmake/onnxruntime_unittests.cmake
yihonglyu 4c51f10
[Draft] Remove parameters ... etc
yihonglyu 909947f
[Draft] Enlarge timeoutInMinutes
yihonglyu a97b715
[Draft] Enlarge TIMEOUT
yihonglyu 0134ad6
Amend set-trigger-rules.py
yihonglyu f80b5e0
Remove unavailable yml in set-trigger-rules.py
yihonglyu 2c0701c
Add error handling when $InnerFolder is not found
yihonglyu 3c8a0d5
Try to fix PowerShell Write-Error @" error
yihonglyu e082146
Try to fix PowerShell Write-Error error
yihonglyu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
tools/ci_build/github/azure-pipelines/templates/jobs/download_win_openvino.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| parameters: | ||
| - name: OpenVINOVersion | ||
| type: string | ||
| default: '2025.0.0' | ||
|
|
||
| steps: | ||
| - powershell: | | ||
| $Url = "https://storage.openvinotoolkit.org/repositories/openvino/packages/2025.0/windows/openvino_toolkit_windows_2025.0.0.17942.1f68be9f594_x86_64.zip" | ||
| $OutputPath = "$env:Agent_TempDirectory\openvino.zip" | ||
| $ExtractPath = "$env:Agent_TempDirectory\openvino-v$env:OpenVINOVersion" | ||
| $TempExtractPath = "$env:Agent_TempDirectory\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 | ||
|
yihonglyu marked this conversation as resolved.
|
||
|
|
||
| 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" | ||
| displayName: 'Download OpenVINO Toolkit v${{ parameters.OpenVINOVersion }}' | ||
| env: | ||
| OpenVINOVersion: ${{ parameters.OpenVINOVersion }} | ||
|
|
||
| - powershell: | | ||
| echo "##vso[task.setvariable variable=OpenVINORootDir]$(Agent.TempDirectory)\openvino-v${{ parameters.OpenVINOVersion }}" | ||
| displayName: 'Set OpenVINORootDir' | ||
|
|
||
| - task: CmdLine@2 | ||
| inputs: | ||
| script: | | ||
| echo $(OpenVINORootDir) | ||
| displayName: 'Print OpenVINORootDir after downloading OpenVINO' | ||
|
|
||
| - task: CmdLine@2 | ||
| displayName: 'Print contents of OpenVINO Toolkit' | ||
| inputs: | ||
| script: | | ||
| dir $(OpenVINORootDir) | ||
116 changes: 116 additions & 0 deletions
116
tools/ci_build/github/azure-pipelines/win-openvino-ci-pipeline.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| ##### 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.