From a2ffa6f4640ee703855834d19fdca1a43b99f9af Mon Sep 17 00:00:00 2001 From: Chun-Wei Chen Date: Sun, 25 Sep 2022 20:56:28 -0700 Subject: [PATCH] debug and 3.20.0 Signed-off-by: Chun-Wei Chen --- .azure-pipelines/MacOS-CI.yml | 13 ++++++++----- .github/workflows/release_linux_aarch64.yml | 2 +- .github/workflows/release_mac.yml | 2 +- .github/workflows/release_win.yml | 2 +- requirements.txt | 2 +- workflow_scripts/protobuf/build_protobuf_unix.sh | 7 ++++++- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.azure-pipelines/MacOS-CI.yml b/.azure-pipelines/MacOS-CI.yml index 75dc75659da..4366fecf803 100644 --- a/.azure-pipelines/MacOS-CI.yml +++ b/.azure-pipelines/MacOS-CI.yml @@ -42,18 +42,21 @@ jobs: - script: | # Install Protobuf from source export NUM_CORES=`sysctl -n hw.logicalcpu` - source workflow_scripts/protobuf/build_protobuf_unix.sh $NUM_CORES $(pwd)/protobuf/protobuf_install + if [ '$(onnx_debug)' == '1' ]; then + export DEBUG=1 + source workflow_scripts/protobuf/build_protobuf_unix.sh $NUM_CORES $(pwd)/protobuf/protobuf_install Debug + else + source workflow_scripts/protobuf/build_protobuf_unix.sh $NUM_CORES $(pwd)/protobuf/protobuf_install + fi git submodule update --init --recursive python -m pip install -q --upgrade pip python -m pip install -q -r requirements-release.txt - export ONNX_BUILD_TESTS=1 - if [ '$(onnx_debug)' == '1' ]; then - export DEBUG=1 - fi + if [ '$(onnx_ml)' == '1' ]; then export ONNX_ML=1 fi + export ONNX_BUILD_TESTS=1 export CMAKE_ARGS="-DONNX_WERROR=ON" if [ '$(onnx_lite)' == '1' ]; then export CMAKE_ARGS="${CMAKE_ARGS} -DONNX_USE_LITE_PROTO=ON" diff --git a/.github/workflows/release_linux_aarch64.yml b/.github/workflows/release_linux_aarch64.yml index 492e3cf2c86..8196d0a4fb6 100644 --- a/.github/workflows/release_linux_aarch64.yml +++ b/.github/workflows/release_linux_aarch64.yml @@ -106,7 +106,7 @@ jobs: ${{ env.img }} \ bash -exc '\ source .env/bin/activate && \ - python -m pip uninstall -y onnx && python -m pip install protobuf==3.19.5 && \ + python -m pip uninstall -y onnx && python -m pip install protobuf==3.20.0 && \ python -m pip install dist/*manylinux2014_aarch64.whl && \ pytest && \ deactivate' diff --git a/.github/workflows/release_mac.yml b/.github/workflows/release_mac.yml index e550c2fb469..7b243a009a5 100644 --- a/.github/workflows/release_mac.yml +++ b/.github/workflows/release_mac.yml @@ -93,7 +93,7 @@ jobs: - name: Verify ONNX with the minimum supported protobuf (from requirements.txt) if: ${{ always() }} run: | - python -m pip uninstall -y protobuf onnx && python -m pip install protobuf==3.19.5 + python -m pip uninstall -y protobuf onnx && python -m pip install protobuf==3.20.0 for file in dist/*.whl; do python -m pip install --upgrade $file; done pytest diff --git a/.github/workflows/release_win.yml b/.github/workflows/release_win.yml index e2be0a28646..720ae46b4bc 100644 --- a/.github/workflows/release_win.yml +++ b/.github/workflows/release_win.yml @@ -115,7 +115,7 @@ jobs: if: ${{ always() }} run: | cd onnx - python -m pip uninstall -y protobuf onnx && python -m pip install protobuf==3.19.5 + python -m pip uninstall -y protobuf onnx && python -m pip install protobuf==3.20.0 Get-ChildItem -Path dist/*.whl | foreach {python -m pip install --upgrade $_.fullname} pytest diff --git a/requirements.txt b/requirements.txt index dc60fb2e1d4..5719d7f78ac 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ numpy >= 1.16.6 # TODO: update once TensorFlow 2.6 is end of life -protobuf >= 3.19.5, <= 3.20.1 +protobuf >= 3.20.0, <= 3.20.1 typing-extensions >= 3.6.2.1 diff --git a/workflow_scripts/protobuf/build_protobuf_unix.sh b/workflow_scripts/protobuf/build_protobuf_unix.sh index e7a6216192e..f804babfca2 100644 --- a/workflow_scripts/protobuf/build_protobuf_unix.sh +++ b/workflow_scripts/protobuf/build_protobuf_unix.sh @@ -4,6 +4,7 @@ export CORE_NUMBER=$1 export INSTALL_PROTOBUF_PATH=$2 +export BUILD_TYPE=$3 if [[ -z "$CORE_NUMBER" ]]; then export CORE_NUMBER=1 @@ -13,6 +14,10 @@ if [[ -z "$INSTALL_PROTOBUF_PATH" ]]; then export INSTALL_PROTOBUF_PATH=/usr fi +if [[ -z "$BUILD_TYPE" ]]; then + export BUILD_TYPE=Release +fi + # Build protobuf from source with -fPIC on Unix-like system ORIGINAL_PATH=$(pwd) cd .. @@ -20,7 +25,7 @@ wget https://github.com/protocolbuffers/protobuf/releases/download/v3.20.2/proto tar -xvf protobuf-cpp-3.20.2.tar.gz cd protobuf-3.20.2 mkdir build_source && cd build_source -cmake ../cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_PROTOBUF_PATH -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release +cmake ../cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_PROTOBUF_PATH -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=$BUILD_TYPE make -j$CORE_NUMBER if [ "$INSTALL_PROTOBUF_PATH" == "/usr" ]; then # install protobuf on default system path so it needs sudo permission