Deprecate OMP from Python package (#6610)

1. For previous openmp build, remove --use_openmp, so thread pool will become default;
2. For previous non-openmp build, add --use_openmp and rename the package to indicate the inclusion.
3. Add a mac build with openmp enabled.
This commit is contained in:
RandySheriffH 2021-02-12 21:50:41 -08:00 committed by GitHub
parent 72eb5de0e2
commit df3d6bad5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,7 +94,6 @@ stages:
--parallel \
--enable_lto \
--build_wheel \
--use_openmp \
--enable_onnx_tests \
${{ parameters.build_py_parameters }} \
--cmake_extra_defines PYTHON_INCLUDE_DIR=$(PythonManylinuxIncludeDir) PYTHON_LIBRARY=/usr/lib64/librt.so
@ -118,7 +117,7 @@ stages:
- template: clean-agent-build-directory-step.yml
- job: Linux_py_Wheels_no_openmp
- job: Linux_py_Wheels_openmp
timeoutInMinutes: 90
workspace:
clean: all
@ -169,8 +168,9 @@ stages:
--parallel \
--enable_lto \
--build_wheel \
--use_openmp \
--enable_onnx_tests \
--wheel_name_suffix=noopenmp \
--wheel_name_suffix=openmp \
${{ parameters.build_py_parameters }} \
--cmake_extra_defines PYTHON_INCLUDE_DIR=$(PythonManylinuxIncludeDir) PYTHON_LIBRARY=/usr/lib64/librt.so
workingDirectory: $(Build.SourcesDirectory)
@ -418,7 +418,6 @@ stages:
--skip_submodule_sync
--cmake_generator "Visual Studio 16 2019"
--enable_pybind
--use_openmp
--enable_onnx_tests
${{ parameters.build_py_parameters }}
--parallel
@ -547,6 +546,7 @@ stages:
--skip_submodule_sync
--cmake_generator "Visual Studio 16 2019"
--enable_pybind
--use_openmp
--enable_onnx_tests
${{ parameters.build_py_parameters }}
--parallel
@ -565,7 +565,7 @@ stages:
displayName: 'Build wheel'
inputs:
scriptPath: '$(Build.SourcesDirectory)\setup.py'
arguments: 'bdist_wheel ${{ parameters.build_py_parameters }} $(NightlyBuildOption) --wheel_name_suffix=noopenmp'
arguments: 'bdist_wheel ${{ parameters.build_py_parameters }} $(NightlyBuildOption) --wheel_name_suffix=openmp'
workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo'
- task: CopyFiles@2
@ -603,6 +603,7 @@ stages:
--skip_submodule_sync
--cmake_generator "Visual Studio 16 2019"
--enable_pybind
--use_openmp
--enable_onnx_tests
--update
--cmake_extra_defines onnxruntime_ENABLE_STATIC_ANALYSIS=ON
@ -850,6 +851,63 @@ stages:
inputs:
versionSpec: $(PythonVersion)
- script: |
set -e
pushd .
cd $(Build.SourcesDirectory)/cmake/external/protobuf
cmake ./cmake -DCMAKE_INSTALL_PREFIX=$(Build.BinariesDirectory)/protobuf -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Relwithdebinfo
make -j$(getconf _NPROCESSORS_ONLN)
make install
popd
export PATH=$(Build.BinariesDirectory)/protobuf/bin:$PATH
export ONNX_ML=1
export CMAKE_ARGS="-DONNX_GEN_PB_TYPE_STUBS=OFF -DONNX_WERROR=OFF"
sudo python3 -m pip install -r '$(Build.SourcesDirectory)/tools/ci_build/github/linux/docker/scripts/requirements.txt'
sudo xcode-select --switch /Applications/Xcode_10.app/Contents/Developer
python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --config Release --skip_onnx_tests --build_wheel ${{ parameters.build_py_parameters }}
displayName: 'Command Line Script'
- task: CopyFiles@2
displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: '$(Build.BinariesDirectory)/Release/dist'
Contents: '*.whl'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: ONNXRuntime python wheel'
inputs:
ArtifactName: onnxruntime
- template: component-governance-component-detection-steps.yml
parameters:
condition: 'succeeded'
- job: MacOS_py_Wheels_openmp
workspace:
clean: all
pool:
vmImage: 'macOS-10.14'
strategy:
matrix:
Python36:
PythonVersion: '3.6'
Python37:
PythonVersion: '3.7'
Python38:
PythonVersion: '3.8'
Python39:
PythonVersion: '3.9'
steps:
- checkout: self
clean: true
submodules: recursive
- task: UsePythonVersion@0
displayName: 'Use Python'
inputs:
versionSpec: $(PythonVersion)
- script: |
set -e
pushd .
@ -864,7 +922,7 @@ stages:
sudo python3 -m pip install -r '$(Build.SourcesDirectory)/tools/ci_build/github/linux/docker/scripts/requirements.txt'
sudo xcode-select --switch /Applications/Xcode_10.app/Contents/Developer
brew install libomp
python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --use_openmp --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --config Release --skip_onnx_tests --build_wheel ${{ parameters.build_py_parameters }}
python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --use_openmp --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --config Release --skip_onnx_tests --build_wheel ${{ parameters.build_py_parameters }} --wheel_name_suffix=openmp
displayName: 'Command Line Script'
- task: CopyFiles@2