onnxruntime/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml
RandySheriffH 4dfb89b3ad
Implement mutex-free spin lock for task queue (#14834)
Implemented "lock-free" spinlock to save CPU usage on context switching.
The change has been tested on queene service of Ads team, the lock-free
version of ort (40 threads) saves CPU usage on gen8 (128 logical
processors on 8 numa nodes) windows by nearly half, from 65% to 35%.

For 32 cores, the curve is flat:

Anubis, 32 vCPU, windows, hugging face models,
95 percentile E2E latency in ms:

model | mutex(ms) | mutex-free
--- | --- | ---
 alvert_base_v2 | 34.21 | 34.09
 bert_large_uncased | 116.27| 117.84
 bart_base | 72.06 | 71.99
 distilgpt2 | 25.43 | 25.02
 vit_base_patch16_224 | 37.33 | 37.76

Anubis, 32 vCPU win, Linux, 1st party models,
95 percentile E2E latency in ms:

model | mutex(ms) | mutex-free
--- | --- | ---
deepthink_v2 | 24.35 | 22.95
bing_feeds |  36.96 | 36.48
deep_writes |  14.46 | 14.32
keypoints |  9.34 | 7.69
model11 |  1.71 | 1.66
model12 |  1.82 | 1.44
model2 |  4.21 | 3.95
model6 |  1.08 | 1.05
agiencoder |  0.99 | 0.93
geminet_transformer |  5.32 | 5.24

---------

Co-authored-by: Randy Shuai <rashuai@microsoft.com>
2023-05-19 10:12:10 -07:00

214 lines
No EOL
6.9 KiB
YAML

parameters:
- name: RunOnnxRuntimeTests
displayName: Run Tests?
type: boolean
default: true
stages:
- stage: x64_debug
dependsOn: []
jobs:
- template: templates/jobs/win-ci-vs-2022-job.yml
parameters:
BuildConfig: 'Debug'
EnvSetupScript: setup_env.bat
buildArch: x64
additionalBuildFlags: --build_java --build_nodejs --build_wheel --disable_memleak_checker
msbuildPlatform: x64
isX86: false
job_name_suffix: x64_debug
RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }}
RunStaticCodeAnalysis: false
isTraining: false
ORT_EP_NAME: CPU
GenerateDocumentation: false
WITH_CACHE: true
MachinePool: 'onnxruntime-Win-CPU-2022'
- stage: x64_release
dependsOn: []
jobs:
- template: templates/jobs/win-ci-vs-2022-job.yml
parameters:
BuildConfig: 'RelWithDebInfo'
EnvSetupScript: setup_env.bat
buildArch: x64
# Compare to our Nuget packaging pipeline, this job has "--build_wheel" but doesn't have "--enable_lto --disable_rtti --use_telemetry --enable_wcos"
# Python bindings use typeid so I can't disable RTTI here. If it causes a problem, we will need to split this job to two jobs.
additionalBuildFlags: --build_wheel --build_java --build_nodejs
msbuildPlatform: x64
isX86: false
job_name_suffix: x64_release
RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }}
RunStaticCodeAnalysis: false
isTraining: false
ORT_EP_NAME: CPU
GenerateDocumentation: false
WITH_CACHE: true
MachinePool: 'onnxruntime-Win-CPU-2022'
- stage: x64_release_dnnl
dependsOn: []
jobs:
- template: templates/jobs/win-ci-vs-2022-job.yml
parameters:
BuildConfig: 'RelWithDebInfo'
EnvSetupScript: setup_env.bat
buildArch: x64
additionalBuildFlags: --build_wheel --use_dnnl --build_java
msbuildPlatform: x64
isX86: false
job_name_suffix: x64_release
RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }}
RunStaticCodeAnalysis: false
isTraining: false
ORT_EP_NAME: DNNL
GenerateDocumentation: false
WITH_CACHE: true
# Intel EPs require Intel CPUs
MachinePool: 'onnxruntime-Win2022-Intel-CPU'
# Tests doesn't work on AMD CPUs
- stage: x64_release_xnnpack
dependsOn: []
jobs:
- template: templates/jobs/win-ci-vs-2022-job.yml
parameters:
BuildConfig: 'RelWithDebInfo'
EnvSetupScript: setup_env.bat
buildArch: x64
additionalBuildFlags: --build_wheel --use_xnnpack
msbuildPlatform: x64
isX86: false
job_name_suffix: x64_release
RunOnnxRuntimeTests: false
RunStaticCodeAnalysis: false
isTraining: false
ORT_EP_NAME: XNNPACK
GenerateDocumentation: false
WITH_CACHE: true
MachinePool: 'onnxruntime-Win-CPU-2022'
- stage: x64_release_winml
dependsOn: []
jobs:
- template: templates/jobs/win-ci-vs-2022-job.yml
parameters:
BuildConfig: 'RelWithDebInfo'
EnvSetupScript: setup_env.bat
buildArch: x64
additionalBuildFlags: --use_winml --enable_wcos --disable_rtti --cmake_extra_defines CMAKE_SYSTEM_VERSION=10.0.22000.0
msbuildPlatform: x64
isX86: false
job_name_suffix: x64_release_winml
RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }}
# WinML has many warnings
RunStaticCodeAnalysis: false
EnablePython: false
isTraining: false
ORT_EP_NAME: CPU
GenerateDocumentation: false
WITH_CACHE: true
MachinePool: 'onnxruntime-Win-CPU-2022'
- stage: x86_release
dependsOn: []
jobs:
- template: templates/jobs/win-ci-vs-2022-job.yml
parameters:
BuildConfig: 'RelWithDebInfo'
EnvSetupScript: setup_env_x86.bat
buildArch: x86
additionalBuildFlags: --build_wheel
msbuildPlatform: Win32
isX86: true
job_name_suffix: x86_release
RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }}
RunStaticCodeAnalysis: false
isTraining: false
ORT_EP_NAME: CPU
GenerateDocumentation: false
WITH_CACHE: true
MachinePool: 'onnxruntime-Win-CPU-2022'
- stage: training_x64_debug
dependsOn: []
jobs:
- template: templates/jobs/win-ci-vs-2022-job.yml
parameters:
BuildConfig: 'Debug'
EnvSetupScript: setup_env.bat
buildArch: x64
additionalBuildFlags: --enable_training --build_wheel --disable_memleak_checker
msbuildPlatform: x64
isX86: false
job_name_suffix: training_x64_debug
RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }}
RunStaticCodeAnalysis: false
isTraining: true
ORT_EP_NAME: CPU
GenerateDocumentation: false
WITH_CACHE: true
MachinePool: 'onnxruntime-Win2022-CPU-training-AMD'
- stage: training_x64_release
dependsOn: []
jobs:
- template: templates/jobs/win-ci-vs-2022-job.yml
parameters:
BuildConfig: 'RelWithDebInfo'
EnvSetupScript: setup_env.bat
buildArch: x64
additionalBuildFlags: --enable_training --build_wheel
msbuildPlatform: x64
isX86: false
job_name_suffix: training_x64_release
RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }}
RunStaticCodeAnalysis: true
isTraining: true
ORT_EP_NAME: CPU
GenerateDocumentation: false
WITH_CACHE: true
MachinePool: 'onnxruntime-Win2022-CPU-training-AMD'
- stage: ort_training_apis_x64_release
dependsOn: []
jobs:
- template: templates/jobs/win-ci-vs-2022-job.yml
parameters:
BuildConfig: 'RelWithDebInfo'
EnvSetupScript: setup_env.bat
buildArch: x64
additionalBuildFlags: --enable_training_apis
msbuildPlatform: x64
isX86: false
job_name_suffix: ort_training_apis_x64_release
RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }}
RunStaticCodeAnalysis: false
EnablePython: false
isTraining: true
ORT_EP_NAME: CPU
GenerateDocumentation: false
WITH_CACHE: true
MachinePool: 'onnxruntime-Win2022-CPU-training-AMD'
- stage: x64_release_azure
dependsOn: []
jobs:
- template: templates/jobs/win-ci-vs-2022-job.yml
parameters:
BuildConfig: 'RelWithDebInfo'
EnvSetupScript: setup_env_azure.bat
buildArch: x64
additionalBuildFlags: --use_azure --use_lock_free_queue
msbuildPlatform: x64
isX86: false
job_name_suffix: x64_release_azure
RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }}
RunStaticCodeAnalysis: false
EnablePython: false
isTraining: false
ORT_EP_NAME: CPU
GenerateDocumentation: false
WITH_CACHE: true
MachinePool: 'onnxruntime-Win-CPU-2022'