mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-16 21:00:14 +00:00
### Description 1. Add XNNPack build on Linux ARM64 2. Build only one python wheel for PR request. [AB#49763](https://aiinfra.visualstudio.com/6a833879-cd9b-44a4-a9de-adc2d818f13c/_workitems/edit/49763) ### Motivation and Context Why I add xnnpack build on Linux ARM64 rather than Windows ARM64. Becuase KleidiAI doesn't support Windows ``` IF(XNNPACK_TARGET_PROCESSOR STREQUAL "arm64" AND XNNPACK_ENABLE_ARM_I8MM AND NOT CMAKE_C_COMPILER_ID STREQUAL "MSVC") IF (XNNPACK_ENABLE_KLEIDIAI) MESSAGE(STATUS "Enabling KleidiAI for Arm64") ENDIF() ELSE() SET(XNNPACK_ENABLE_KLEIDIAI OFF) ENDIF() ``` ---------
109 lines
3.9 KiB
YAML
109 lines
3.9 KiB
YAML
parameters:
|
|
- name: arch
|
|
type: string
|
|
|
|
- name: machine_pool
|
|
type: string
|
|
|
|
- name: extra_job_id
|
|
type: string
|
|
default: ''
|
|
|
|
- name: python_wheel_suffix
|
|
type: string
|
|
default: ''
|
|
|
|
|
|
# TODO: Ideally it should fetch information from the build that triggers it
|
|
- name: cmake_build_type
|
|
type: string
|
|
default: 'Release'
|
|
values:
|
|
- Debug
|
|
- Release
|
|
- RelWithDebInfo
|
|
- MinSizeRel
|
|
|
|
- name: timeout
|
|
type: number
|
|
default: 120
|
|
|
|
- name: ep
|
|
type: string
|
|
default: 'cpu'
|
|
|
|
jobs:
|
|
- job: Linux_Test_CPU${{ parameters.extra_job_id }}_${{ parameters.arch }}
|
|
timeoutInMinutes: ${{ parameters.timeout }}
|
|
variables:
|
|
skipComponentGovernanceDetection: true
|
|
workspace:
|
|
clean: all
|
|
pool: ${{ parameters.machine_pool }}
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
submodules: none
|
|
# The public ADO project
|
|
- ${{ if eq(variables['System.CollectionId'], 'f3ad12f2-e480-4533-baf2-635c95467d29') }}:
|
|
- download: current # pipeline resource identifier.
|
|
artifact: 'drop-linux-cpu-${{ parameters.arch }}-${{parameters.ep}}'
|
|
|
|
- download: current # pipeline resource identifier.
|
|
artifact: 'onnxruntime${{ parameters.python_wheel_suffix }}-${{ parameters.ep }}'
|
|
|
|
- bash: |
|
|
set -e -x
|
|
mv "$(Pipeline.Workspace)/drop-linux-cpu-${{ parameters.arch }}-${{parameters.ep}}" $(Build.BinariesDirectory)/${{parameters.cmake_build_type}}
|
|
mv "$(Pipeline.Workspace)/onnxruntime${{ parameters.python_wheel_suffix }}-${{parameters.ep}}" "$(Build.BinariesDirectory)/whl"
|
|
cp -r "$(Build.BinariesDirectory)/whl" $(Build.BinariesDirectory)/tmp
|
|
find "$(Build.BinariesDirectory)/tmp" -name '*.whl' -exec bash -c 'unzip -d "${1%.*}" "$1"' _ {} \;
|
|
# The private ADO project
|
|
- ${{ if eq(variables['System.CollectionId'], 'bc038106-a83b-4dab-9dd3-5a41bc58f34c') }}:
|
|
- download: build # pipeline resource identifier.
|
|
artifact: 'drop-linux-cpu-${{ parameters.arch }}-${{parameters.ep}}'
|
|
|
|
- download: build # pipeline resource identifier.
|
|
artifact: 'onnxruntime${{ parameters.python_wheel_suffix }}-${{ parameters.ep }}'
|
|
|
|
- bash: |
|
|
set -e -x
|
|
ls $(Pipeline.Workspace)/build
|
|
mv "$(Pipeline.Workspace)/build/drop-linux-cpu-${{ parameters.arch }}-${{parameters.ep}}" $(Build.BinariesDirectory)/${{parameters.cmake_build_type}}
|
|
mv "$(Pipeline.Workspace)/build/onnxruntime${{ parameters.python_wheel_suffix }}-${{parameters.ep}}" "$(Build.BinariesDirectory)/whl"
|
|
cp -r "$(Build.BinariesDirectory)/whl" $(Build.BinariesDirectory)/tmp
|
|
find "$(Build.BinariesDirectory)/tmp" -name '*.whl' -exec bash -c 'unzip -d "${1%.*}" "$1"' _ {} \;
|
|
|
|
# The BinSkim task uses a dotnet program which doesn't support ARM CPUs yet
|
|
- ${{ if eq(parameters.arch, 'x86_64') }}:
|
|
- task: BinSkim@4
|
|
displayName: 'Run BinSkim'
|
|
inputs:
|
|
AnalyzeTargetGlob: '$(Build.BinariesDirectory)/tmp/**/*.so'
|
|
continueOnError: true
|
|
|
|
#- task: PostAnalysis@2
|
|
# inputs:
|
|
# GdnBreakAllTools: true
|
|
# GdnBreakPolicy: M365
|
|
# GdnBreakPolicyMinSev: Error
|
|
|
|
- template: get-docker-image-steps.yml
|
|
parameters:
|
|
Dockerfile: tools/ci_build/github/linux/docker/inference/${{ parameters.arch }}/python/cpu/Dockerfile
|
|
Context: tools/ci_build/github/linux/docker/inference/${{ parameters.arch }}/python/cpu
|
|
DockerBuildArgs: "--build-arg BUILD_UID=$( id -u )"
|
|
Repository: onnxruntimecpubuildpython${{ parameters.arch }}
|
|
${{ if eq(parameters.arch, 'aarch64') }}:
|
|
UpdateDepsTxt: false
|
|
|
|
- task: Bash@3
|
|
displayName: 'Bash Script'
|
|
inputs:
|
|
targetType: filePath
|
|
filePath: tools/ci_build/github/linux/run_python_dockertest.sh
|
|
arguments: -d CPU -c ${{parameters.cmake_build_type}} -i onnxruntimecpubuildpython${{ parameters.arch }}
|
|
|
|
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
|
|
displayName: 'Clean Agent Directories'
|
|
condition: always()
|