diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml index d467dedfb3591..75f1193ec3e55 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml @@ -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 @@ -167,8 +166,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) @@ -416,7 +416,6 @@ stages: --skip_submodule_sync --cmake_generator "Visual Studio 16 2019" --enable_pybind - --use_openmp --enable_onnx_tests ${{ parameters.build_py_parameters }} --parallel @@ -545,6 +544,7 @@ stages: --skip_submodule_sync --cmake_generator "Visual Studio 16 2019" --enable_pybind + --use_openmp --enable_onnx_tests ${{ parameters.build_py_parameters }} --parallel @@ -563,7 +563,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 @@ -601,6 +601,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 @@ -848,6 +849,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 . @@ -862,7 +920,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