mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-03 23:49:44 +00:00
### Description 1. Enable VCPKG flag in Windows CPU CI build pipelines. 2. Increased the min supported cmake version from 3.26 to 3.28. Because of it, drop the support for the old way of finding python by "find_package(PythonLibs)". Therefore, in build.py we no longer set "PYTHON_EXECUTABLE" cmake var when doing cmake configure. 3. Added "xnnpack-ep" as a feature for ORT's vcpkg config. 4. Added asset cache support for ORT's vcpkg build 5. Added VCPKG triplet files for Android build. 6. Set VCPKG triplet to "universal2-osx" if CMAKE_OSX_ARCHITECTURES was found in cmake extra defines. 7. Removed a small piece of code in build.py, which was for support CUDA version < 11.8. 8. Fixed an issue that CMAKE_OSX_ARCHITECTURES sometimes got specified twice when build.py invoked cmake. 9. Added more model tests to Android build. After this change, we will test all ONNX versions instead of just the latest one. 10. Fixed issues that are related to build.py's "--build_nuget" parameter. Also, enable the flag in most Windows CPU CI build jobs. 11. Removed a restriction in build.py that disallowed cross-compiling Windows ARM64 nuget package on Windows x86. ### Motivation and Context Adopt vcpkg.
163 lines
6.4 KiB
YAML
163 lines
6.4 KiB
YAML
parameters:
|
|
- name: CommitOverride
|
|
type: boolean
|
|
default: false
|
|
|
|
- name: BuildConfig
|
|
type: string
|
|
default: 'Debug'
|
|
|
|
- name: ExtraBuildArgs
|
|
type: string
|
|
default: ''
|
|
|
|
- name: PoolName
|
|
type: string
|
|
default: 'onnxruntime-Ubuntu2204-AMD-CPU'
|
|
|
|
- name: SkipPublish
|
|
type: boolean
|
|
default: false
|
|
|
|
- name: TimeoutInMinutes
|
|
default: 180
|
|
|
|
- name: BuildJsep
|
|
type: boolean
|
|
default: false
|
|
|
|
- name: BuildWebGPU
|
|
type: boolean
|
|
default: false
|
|
|
|
# In fact, it's only used on Linux for compiler cache.
|
|
- name: BuildStaticLib
|
|
type: boolean
|
|
default: false
|
|
|
|
- name: WithCache
|
|
type: boolean
|
|
default: false
|
|
|
|
jobs:
|
|
- job: build_WASM
|
|
pool:
|
|
name: ${{ parameters.PoolName }}
|
|
variables:
|
|
buildArch: x64
|
|
CommonBuildArgs: '--parallel --config ${{ parameters.BuildConfig }} --skip_submodule_sync --build_wasm --enable_wasm_simd --enable_wasm_threads --use_extensions --cmake_extra_defines onnxruntime_WEBASSEMBLY_DEFAULT_EXTENSION_FLAGS=ON ${{ parameters.ExtraBuildArgs }}'
|
|
runCodesignValidationInjection: false
|
|
TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)]
|
|
ORT_CACHE_DIR: $(Agent.TempDirectory)/ort_ccache
|
|
timeoutInMinutes: ${{ parameters.TimeoutInMinutes }}
|
|
workspace:
|
|
clean: all
|
|
steps:
|
|
- checkout: self
|
|
- task: DownloadPipelineArtifact@2
|
|
inputs:
|
|
artifact: '__commit'
|
|
path: $(Pipeline.Workspace)
|
|
displayName: 'Get commit SHA'
|
|
condition: eq('${{ parameters.CommitOverride }}', 'true')
|
|
- script: |
|
|
export __commit__=<$(Pipeline.Workspace)/__commit.txt
|
|
git fetch origin +$__commit__:refs/remotes/origin/$__commit__
|
|
git checkout --force $__commit__
|
|
workingDirectory: '$(Build.SourcesDirectory)'
|
|
displayName: 'Read commit SHA and checkout'
|
|
condition: eq('${{ parameters.CommitOverride }}', 'true')
|
|
- script: |
|
|
git submodule sync --recursive
|
|
git submodule update --init --recursive
|
|
workingDirectory: '$(Build.SourcesDirectory)'
|
|
displayName: 'Checkout submodules'
|
|
- task: UsePythonVersion@0
|
|
inputs:
|
|
versionSpec: '3.12'
|
|
addToPath: true
|
|
architecture: $(buildArch)
|
|
|
|
- ${{if eq(parameters.WithCache, true)}}:
|
|
- script: |
|
|
set -ex
|
|
cd '$(Build.SourcesDirectory)/cmake/external/emsdk'
|
|
./emsdk install 3.1.59 ccache-git-emscripten-64bit
|
|
./emsdk activate 3.1.59 ccache-git-emscripten-64bit
|
|
displayName: 'emsdk install and activate ccache for emscripten'
|
|
- ${{if eq(parameters.WithCache, false)}}:
|
|
- script: |
|
|
set -ex
|
|
cd '$(Build.SourcesDirectory)/cmake/external/emsdk'
|
|
./emsdk install 3.1.59
|
|
./emsdk activate 3.1.59
|
|
displayName: 'emsdk install and activate ccache for emscripten'
|
|
|
|
- template: build-linux-wasm-step.yml
|
|
parameters:
|
|
Today: $(Today)
|
|
${{ if eq(parameters.BuildStaticLib, true)}}:
|
|
AdditionalKey: wasm_inferencing | ${{ parameters.BuildConfig }} | static
|
|
${{ else }}:
|
|
AdditionalKey: wasm_inferencing | ${{ parameters.BuildConfig }}
|
|
CacheDir: $(ORT_CACHE_DIR)/wasm_inferencing
|
|
Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_inferencing --wasm_run_tests_in_browser'
|
|
DisplayName: 'Build and test (browser) (simd + threads)'
|
|
WithCache: ${{ parameters.WithCache }}
|
|
|
|
- ${{ if eq(parameters.BuildJsep, true) }}:
|
|
- template: build-linux-wasm-step.yml
|
|
parameters:
|
|
Today: $(Today)
|
|
${{ if eq(parameters.BuildStaticLib, true)}}:
|
|
AdditionalKey: wasm_inferencing_jsep | ${{ parameters.BuildConfig }} | static
|
|
${{ else }}:
|
|
AdditionalKey: wasm_inferencing_jsep | ${{ parameters.BuildConfig }}
|
|
CacheDir: $(ORT_CACHE_DIR)/wasm_inferencing_jsep
|
|
Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_inferencing_jsep --use_jsep --use_webnn --target onnxruntime_webassembly --skip_tests'
|
|
DisplayName: 'Build (simd + threads + JSEP)'
|
|
WithCache: ${{ parameters.WithCache }}
|
|
|
|
- ${{ if eq(parameters.BuildWebGPU, true) }}:
|
|
# This step only verifies whether the build is successful.
|
|
# currently, we uses EMSDK 3.1.59, which is not compatible with Dawn's changes in its Emscripten fork. Closure compiler will not work for WebGPU build.
|
|
# Only enables in DEBUG build.
|
|
#
|
|
# TODO: when upgrading to a newer Emscripten version, we should fix this step.
|
|
- template: build-linux-wasm-step.yml
|
|
parameters:
|
|
Today: $(Today)
|
|
${{ if eq(parameters.BuildStaticLib, true)}}:
|
|
AdditionalKey: wasm_inferencing_webgpu_exp | ${{ parameters.BuildConfig }} | static
|
|
${{ else }}:
|
|
AdditionalKey: wasm_inferencing_webgpu_exp | ${{ parameters.BuildConfig }}
|
|
CacheDir: $(ORT_CACHE_DIR)/wasm_inferencing_webgpu
|
|
Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_inferencing_webgpu --use_webgpu --target onnxruntime_webassembly --skip_tests'
|
|
DisplayName: 'Build (simd + threads + WebGPU experimental)'
|
|
WithCache: ${{ parameters.WithCache }}
|
|
|
|
- ${{ if eq(parameters.SkipPublish, false) }}:
|
|
- script: |
|
|
cp $(Build.BinariesDirectory)/wasm_inferencing/${{ parameters.BuildConfig }}/ort-wasm-simd-threaded.wasm $(Build.ArtifactStagingDirectory)
|
|
cp $(Build.BinariesDirectory)/wasm_inferencing/${{ parameters.BuildConfig }}/ort-wasm-simd-threaded.mjs $(Build.ArtifactStagingDirectory)
|
|
if [ -d $(Build.BinariesDirectory)/wasm_inferencing_jsep ]; then
|
|
cp $(Build.BinariesDirectory)/wasm_inferencing_jsep/${{ parameters.BuildConfig }}/ort-wasm-simd-threaded.jsep.wasm $(Build.ArtifactStagingDirectory)
|
|
cp $(Build.BinariesDirectory)/wasm_inferencing_jsep/${{ parameters.BuildConfig }}/ort-wasm-simd-threaded.jsep.mjs $(Build.ArtifactStagingDirectory)
|
|
fi
|
|
displayName: 'Create Artifacts'
|
|
- ${{ if eq(parameters.SkipPublish, false) }}:
|
|
- task: PublishPipelineArtifact@0
|
|
displayName: 'Publish Pipeline Artifact'
|
|
inputs:
|
|
artifactName: '${{ parameters.BuildConfig }}_wasm'
|
|
targetPath: '$(Build.ArtifactStagingDirectory)'
|
|
- task: PublishTestResults@2
|
|
displayName: 'Publish unit test results'
|
|
inputs:
|
|
testResultsFiles: '**/*.results.xml'
|
|
searchFolder: '$(Build.BinariesDirectory)'
|
|
testRunTitle: 'Unit Test Run'
|
|
condition: and(succeededOrFailed(), eq('${{ parameters.BuildConfig }}', 'Debug'))
|
|
- template: component-governance-component-detection-steps.yml
|
|
parameters :
|
|
condition : 'succeeded'
|