Skip to content
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

Improve Win QNNEP pipeline #17586

Merged
merged 13 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ parameters:
type: string
default: "$(Agent.TempDirectory)/ort_ccache"

- name: DebugCache
type: boolean
default: false

- name: AdditionalKey
type: string
default: ""
Expand Down Expand Up @@ -45,6 +49,18 @@ parameters:

steps:
- ${{ if eq(parameters.WithCache, true) }}:
- powershell: |
if ([string]::IsNullOrEmpty((Get-Command ccache -errorAction SilentlyContinue)))
{
choco install ccache -y --version 4.7.4
$ccache_path = (Get-Command ccache).Source
$ccache_parent_dir = (Split-Path -parent $ccache_path)
Copy-Item "C:\ProgramData\chocolatey\lib\ccache\tools\ccache-4.7.4-windows-x86_64\ccache.exe" -Destination "C:\ProgramData\chocolatey\bin\cl.exe"
Get-ChildItem $ccache_parent_dir
ccache --version
}
displayName: Install ccache
- task: Cache@2
inputs:
${{if eq(variables['Build.SourceBranchName'], 'merge')}}:
Expand Down Expand Up @@ -83,6 +99,11 @@ steps:
createLogFile: true
env:
CCACHE_DIR: ${{parameters.CacheDir}}
CCACHE_SLOPPINESS: file_macro,time_macros,include_file_mtime,include_file_ctime
CCACHE_COMPILERCHECK: content
${{if eq(parameters.DebugCache, true)}}:
CCACHE_DEBUG: 1
CCACHE_DEBUGDIR: $(Agent.TempDirectory)/cache_debug

- ${{ if eq(parameters.WithCache, true) }}:
- powershell: |
Expand All @@ -91,3 +112,10 @@ steps:
displayName: cache stat
env:
CCACHE_DIR: ${{parameters.CacheDir}}
- ${{if eq(parameters.DebugCache, true)}}:
- task: PublishPipelineArtifact@0
displayName: 'publish cache log'
inputs:
artifactName: 'cache-log'
targetPath: $(Agent.TempDirectory)/cache_debug
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parameters:
- name: EnvSetupScript
type: string
default: setup_env.bat

- name: BuildConfig
type: string
Expand Down
33 changes: 12 additions & 21 deletions tools/ci_build/github/azure-pipelines/win-qnn-ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ jobs:
BuildConfig: 'RelWithDebInfo'
ALLOW_RELEASED_ONNX_OPSET_ONLY: '1'
QNN_SDK_ROOT: 'C:\data\qnnsdk\${{parameters.QnnSdk}}'
timeoutInMinutes: 150
TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)]
timeoutInMinutes: 120
workspace:
clean: all
steps:
Expand All @@ -70,29 +71,19 @@ jobs:
# '_Ret &std::_Visit_strategy<1>::_Visit2<_Ret,_ListOfIndexVectors,_Callable,const
# std::variant<onnxruntime::OpSchemaKernelTypeStrResolver,onnxruntime::KernelTypeStrResolver>&>(size_t,_Callable &&,
# const std::variant<onnxruntime::OpSchemaKernelTypeStrResolver,onnxruntime::KernelTypeStrResolver> &)'
- task: PythonScript@0
displayName: 'Generate cmake config'
inputs:
scriptPath: '$(Build.SourcesDirectory)\tools\ci_build\build.py'
arguments: '--config $(BuildConfig) --build_dir $(Build.BinariesDirectory) --compile_no_warning_as_error --update --cmake_generator "Visual Studio 17 2022" --use_qnn --qnn_home $(QNN_SDK_ROOT) --parallel'
workingDirectory: '$(Build.BinariesDirectory)'

- task: VSBuild@1
displayName: 'Build'
inputs:
solution: '$(Build.BinariesDirectory)\$(BuildConfig)\onnxruntime.sln'
platform: 'x64'
configuration: $(BuildConfig)
msbuildArgs: $(MsbuildArguments)
msbuildArchitecture: $(buildArch)
maximumCpuCount: true
logProjectEvents: false
workingFolder: '$(Build.BinariesDirectory)\$(BuildConfig)'
createLogFile: true
- template: templates/jobs/win-ci-build-steps.yml
parameters:
WithCache: True
Today: $(TODAY)
AdditionalKey: "win-qnn | $(BuildConfig)"
BuildPyArguments: '--config $(BuildConfig) --build_dir $(Build.BinariesDirectory) --compile_no_warning_as_error --update --cmake_generator "Visual Studio 17 2022" --use_qnn --qnn_home $(QNN_SDK_ROOT) --parallel'
MsbuildArguments: $(MsbuildArguments)
BuildArch: $(buildArch)
Platform: 'x64'
BuildConfig: $(BuildConfig)

- powershell: |
python $(Build.SourcesDirectory)\tools\ci_build\build.py --config $(BuildConfig) --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --test --cmake_generator "Visual Studio 17 2022" --enable_onnx_tests
workingDirectory: '$(Build.BinariesDirectory)\$(BuildConfig)\$(BuildConfig)'
displayName: 'Run unit tests'
Expand Down