onnxruntime/tools/ci_build/github/azure-pipelines/orttraining-py-packaging-pipeline-cpu.yml
Ashwini Khade f2e19a8ccf
Updates to training pipelines to reduce CI time (#18116)
### Description
Motivation for this PR is reducing CI test time by removing unnecessary
tests from the pipelines.

Following changes are for reducing test time in pipelines:

- Skip CPU model tests in GPU builds. Training CIs run these tests as a
sanity check. There is no direct training code being tested in these
pipelines, furthermore, CPU tests are being run in CPU pipelines so no
need to run them again in GPU builds and block the GPU VM. This change
reduces testing time by 20-25 mins in all training GPU pipelines.

- Delete debug package building pipeline for linux training packages.
This was required by compiler team at some point but there have been 0
downloads of these packages.



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
2023-10-26 14:58:57 -07:00

103 lines
3.3 KiB
YAML

trigger: none
resources:
repositories:
- repository: manylinux
type: Github
endpoint: Microsoft
name: pypa/manylinux
ref: 5eda9aded5462201e6310105728d33016e637ea7
stages:
- stage: Python_Packaging_Linux_Training_CPU
jobs:
- job: Linux_Training_CPU_Wheels
timeoutInMinutes: 120
workspace:
clean: all
pool: onnxruntime-Ubuntu2004-AMD-CPU
strategy:
matrix:
Python38:
PythonVersion: '3.8'
Python39:
PythonVersion: '3.9'
Python310:
PythonVersion: '3.10'
Python311:
PythonVersion: '3.11'
steps:
- checkout: self
clean: true
submodules: recursive
- template: templates/set-python-manylinux-variables-step.yml
- template: templates/get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cpu
Context: tools/ci_build/github/linux/docker
DockerBuildArgs: >-
--build-arg PYTHON_VERSION=$(PythonVersion)
--build-arg INSTALL_DEPS_EXTRA_ARGS=-tu
--build-arg BUILD_UID=$(id -u)
Repository: onnxruntimetrainingcpubuild
- task: CmdLine@2
displayName: 'build onnxruntime'
inputs:
script: |
mkdir -p $HOME/.onnx
docker run --rm \
--volume /data/onnx:/data/onnx:ro \
--volume $(Build.SourcesDirectory):/onnxruntime_src \
--volume $(Build.BinariesDirectory):/build \
--volume /data/models:/build/models:ro \
--volume $HOME/.onnx:/home/onnxruntimedev/.onnx \
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
-e ORT_DISABLE_PYTHON_PACKAGE_LOCAL_VERSION \
-e DEFAULT_TRAINING_PACKAGE_DEVICE \
onnxruntimetrainingcpubuild \
$(PythonManylinuxDir)/bin/python3 /onnxruntime_src/tools/ci_build/build.py \
--build_dir /build --cmake_generator Ninja \
--config Debug Release \
--skip_submodule_sync \
--build_shared_lib \
--parallel \
--build_wheel \
--enable_onnx_tests \
--enable_pybind --enable_training
workingDirectory: $(Build.SourcesDirectory)
- task: CopyFiles@2
displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: '$(Build.BinariesDirectory)'
Contents: 'Release/dist/*.whl'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: ONNXRuntime python wheel and documentation'
inputs:
ArtifactName: onnxruntime_training_cpu
- template: templates/component-governance-component-detection-steps.yml
parameters:
condition: 'succeeded'
- template: templates/clean-agent-build-directory-step.yml
- template: templates/py-packaging-stage.yml
parameters:
build_py_parameters: --enable_training
enable_linux_gpu: false
enable_linux_cpu: false
enable_windows_cpu: true
enable_windows_gpu: false
enable_mac_cpu: true
enable_mac_silicon: true
enable_linux_arm: false