From 4a345e381d14885c9754a31032c294ea179127e1 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Mon, 8 Apr 2024 15:00:04 +0800 Subject: [PATCH 01/21] update actions --- .github/workflows/build.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a9c28692..1378fee8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,21 +11,26 @@ permissions: jobs: build: - + # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily run on Ubuntu-latest. + # However, to ensure the stability of the packaging system, we will need to fix the Ubuntu version in the future. runs-on: ubuntu-latest + # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily only package executable files for Python 3.8. + # In the future, we will need to extend support to cover Python 3.8 through Python 3.10. steps: - - name: Set up Python + - name: Setup Python 3.5 uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: '3.8' + # Checkout the latest branch of Paddle2ONNX. - name: Checkout Paddle2ONNX uses: actions/checkout@v4 with: submodules: true path: paddle2onnx + # Checkout the branch(v3.16.0) of Paddle2ONNX. - name: Checkout Protobuf uses: actions/checkout@v4 with: @@ -33,6 +38,7 @@ jobs: ref: v3.16.0 path: protobuf + # Build Protobuf, detailed process can refer to the [Paddle2ONNX construction documentation](https://github.com/PaddlePaddle/Paddle2ONNX/blob/develop/docs/zh/compile.md). - name: Build Protobuf working-directory: ./protobuf run: | @@ -42,12 +48,14 @@ jobs: cmake --build ./build_wd -- install echo "$PWD/install_dir/bin" >> $GITHUB_PATH - - name: Install dependencies + # Install Dependencies for Python + - name: Install Dependencies for Python run: | python -m pip install --upgrade pip pip install setuptools wheel auditwheel auditwheel-symbols if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + # Build Paddle2ONNX - name: Build Paddle2ONNX working-directory: ./paddle2onnx run: | From 1741a877dfa0959c3e38afc7fc5a1ab5ea40456b Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Mon, 8 Apr 2024 17:05:23 +0800 Subject: [PATCH 02/21] remove setup_dev.py update build.yml --- .github/workflows/build.yml | 7 +- setup_dev.py | 319 ------------------------------------ 2 files changed, 4 insertions(+), 322 deletions(-) delete mode 100644 setup_dev.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1378fee8f..9aaa61b5f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,12 +13,12 @@ jobs: build: # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily run on Ubuntu-latest. # However, to ensure the stability of the packaging system, we will need to fix the Ubuntu version in the future. - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily only package executable files for Python 3.8. # In the future, we will need to extend support to cover Python 3.8 through Python 3.10. steps: - - name: Setup Python 3.5 + - name: Setup Python 3.8 uses: actions/setup-python@v5 with: python-version: '3.8' @@ -59,4 +59,5 @@ jobs: - name: Build Paddle2ONNX working-directory: ./paddle2onnx run: | - python setup.py install + python setup.py bdist_wheel + auditwheel repair dist/paddle2onnx-$(cat VERSION_NUMBER)-cp39-cp39-linux_x86_64.whl diff --git a/setup_dev.py b/setup_dev.py deleted file mode 100644 index 99bad0169..000000000 --- a/setup_dev.py +++ /dev/null @@ -1,319 +0,0 @@ -# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# This file referred to github.com/onnx/onnx.git - -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - -from distutils.spawn import find_executable -from distutils import sysconfig, log -import setuptools -import setuptools.command.build_py -import setuptools.command.develop -import setuptools.command.build_ext - -from collections import namedtuple -from contextlib import contextmanager -import glob -import os -import shlex -import subprocess -import sys -import platform -from textwrap import dedent -import multiprocessing - -TOP_DIR = os.path.realpath(os.path.dirname(__file__)) -SRC_DIR = os.path.join(TOP_DIR, 'paddle2onnx') -CMAKE_BUILD_DIR = os.path.join(TOP_DIR, '.setuptools-cmake-build') - -WINDOWS = (os.name == 'nt') - -CMAKE = find_executable('cmake3') or find_executable('cmake') -MAKE = find_executable('make') - -setup_requires = [] -extras_require = {} - -################################################################################ -# Global variables for controlling the build variant -################################################################################ - -# Default value is set to TRUE\1 to keep the settings same as the current ones. -# However going forward the recomemded way to is to set this to False\0 -USE_MSVC_STATIC_RUNTIME = bool(os.getenv('USE_MSVC_STATIC_RUNTIME', '1') == '1') -ONNX_NAMESPACE = os.getenv('ONNX_NAMESPACE', 'paddle2onnx') -################################################################################ -# Version -################################################################################ - -try: - git_version = subprocess.check_output( - ['git', 'rev-parse', 'HEAD'], cwd=TOP_DIR).decode('ascii').strip() -except (OSError, subprocess.CalledProcessError): - git_version = None - -with open(os.path.join(TOP_DIR, 'VERSION_NUMBER')) as version_file: - VersionInfo = namedtuple('VersionInfo', ['version', 'git_version'])( - version=version_file.read().strip(), git_version=git_version) - -################################################################################ -# Pre Check -################################################################################ - -assert CMAKE, 'Could not find "cmake" executable!' - -################################################################################ -# Utilities -################################################################################ - - -@contextmanager -def cd(path): - if not os.path.isabs(path): - raise RuntimeError('Can only cd to absolute path, got: {}'.format(path)) - orig_path = os.getcwd() - os.chdir(path) - try: - yield - finally: - os.chdir(orig_path) - - -################################################################################ -# Customized commands -################################################################################ - - -class ONNXCommand(setuptools.Command): - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - -class create_version(ONNXCommand): - def run(self): - with open(os.path.join(SRC_DIR, 'version.py'), 'w') as f: - f.write( - dedent('''\ - # This file is generated by setup.py. DO NOT EDIT! - from __future__ import absolute_import - from __future__ import division - from __future__ import print_function - from __future__ import unicode_literals - version = '{version}' - git_version = '{git_version}' - '''.format(**dict(VersionInfo._asdict())))) - - -class cmake_build(setuptools.Command): - """ - Compiles everything when `python setupmnm.py build` is run using cmake. - Custom args can be passed to cmake by specifying the `CMAKE_ARGS` - environment variable. - The number of CPUs used by `make` can be specified by passing `-j` - to `setup.py build`. By default all CPUs are used. - """ - user_options = [(str('jobs='), str('j'), - str('Specifies the number of jobs to use with make'))] - - built = False - - def initialize_options(self): - self.jobs = None - - def finalize_options(self): - if sys.version_info[0] >= 3: - self.set_undefined_options('build', ('parallel', 'jobs')) - if self.jobs is None and os.getenv("MAX_JOBS") is not None: - self.jobs = os.getenv("MAX_JOBS") - self.jobs = multiprocessing.cpu_count() if self.jobs is None else int( - self.jobs) - - def run(self): - if cmake_build.built: - return - cmake_build.built = True - if not os.path.exists(CMAKE_BUILD_DIR): - os.makedirs(CMAKE_BUILD_DIR) - - with cd(CMAKE_BUILD_DIR): - build_type = 'Release' - # configure - cmake_args = [ - CMAKE, - '-DPYTHON_INCLUDE_DIR={}'.format(sysconfig.get_python_inc()), - '-DPYTHON_EXECUTABLE={}'.format(sys.executable), - '-DBUILD_PADDLE2ONNX_PYTHON=ON', - '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', - '-DONNX_NAMESPACE={}'.format(ONNX_NAMESPACE), - '-DPY_EXT_SUFFIX={}'.format( - sysconfig.get_config_var('EXT_SUFFIX') or ''), - ] - cmake_args.append('-DCMAKE_BUILD_TYPE=%s' % build_type) - if WINDOWS: - cmake_args.extend([ - # we need to link with libpython on windows, so - # passing python version to window in order to - # find python in cmake - '-DPY_VERSION={}'.format('{0}.{1}'.format(* \ - sys.version_info[:2])), - ]) - if platform.architecture()[0] == '64bit': - cmake_args.extend(['-A', 'x64', '-T', 'host=x64']) - else: - cmake_args.extend(['-A', 'Win32', '-T', 'host=x86']) - if 'CMAKE_ARGS' in os.environ: - extra_cmake_args = shlex.split(os.environ['CMAKE_ARGS']) - # prevent crossfire with downstream scripts - del os.environ['CMAKE_ARGS'] - log.info('Extra cmake args: {}'.format(extra_cmake_args)) - cmake_args.extend(extra_cmake_args) - cmake_args.append(TOP_DIR) - subprocess.check_call(cmake_args) - - build_args = [CMAKE, '--build', os.curdir] - if WINDOWS: - build_args.extend(['--config', build_type]) - build_args.extend(['--', '/maxcpucount:{}'.format(self.jobs)]) - else: - build_args.extend(['--', '-j', str(self.jobs)]) - subprocess.check_call(build_args) - - -class build_py(setuptools.command.build_py.build_py): - def run(self): - self.run_command('create_version') - self.run_command('cmake_build') - - generated_python_files = \ - glob.glob(os.path.join(CMAKE_BUILD_DIR, 'paddle2onnx', '*.py')) + \ - glob.glob(os.path.join(CMAKE_BUILD_DIR, 'paddle2onnx', '*.pyi')) - - for src in generated_python_files: - dst = os.path.join(TOP_DIR, os.path.relpath(src, CMAKE_BUILD_DIR)) - self.copy_file(src, dst) - - return setuptools.command.build_py.build_py.run(self) - - -class develop(setuptools.command.develop.develop): - def run(self): - self.run_command('build_py') - setuptools.command.develop.develop.run(self) - - -class build_ext(setuptools.command.build_ext.build_ext): - def run(self): - self.run_command('cmake_build') - setuptools.command.build_ext.build_ext.run(self) - - def build_extensions(self): - for ext in self.extensions: - fullname = self.get_ext_fullname(ext.name) - filename = os.path.basename(self.get_ext_filename(fullname)) - - lib_path = CMAKE_BUILD_DIR - if os.name == 'nt': - debug_lib_dir = os.path.join(lib_path, "Debug") - release_lib_dir = os.path.join(lib_path, "Release") - if os.path.exists(debug_lib_dir): - lib_path = debug_lib_dir - elif os.path.exists(release_lib_dir): - lib_path = release_lib_dir - src = os.path.join(lib_path, filename) - dst = os.path.join( - os.path.realpath(self.build_lib), "paddle2onnx", filename) - self.copy_file(src, dst) - - -class mypy_type_check(ONNXCommand): - description = 'Run MyPy type checker' - - def run(self): - """Run command.""" - onnx_script = os.path.realpath( - os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "tools/mypy-onnx.py")) - returncode = subprocess.call([sys.executable, onnx_script]) - sys.exit(returncode) - - -cmdclass = { - 'create_version': create_version, - 'cmake_build': cmake_build, - 'build_py': build_py, - 'develop': develop, - 'build_ext': build_ext, - 'typecheck': mypy_type_check, -} - -################################################################################ -# Extensions -################################################################################ - -ext_modules = [ - setuptools.Extension( - name=str('paddle2onnx.paddle2onnx_cpp2py_export'), sources=[]) -] - -################################################################################ -# Packages -################################################################################ - -# no need to do fancy stuff so far -packages = setuptools.find_packages() - -################################################################################ -# Test -################################################################################ - -setup_requires.append('pytest-runner') - -if sys.version_info[0] == 3: - # Mypy doesn't work with Python 2 - extras_require['mypy'] = ['mypy==0.600'] - -################################################################################ -# Final -################################################################################ - -setuptools.setup( - name="paddle2onnx", - version=VersionInfo.version, - description="Export PaddlePaddle to ONNX", - ext_modules=ext_modules, - cmdclass=cmdclass, - packages=packages, - include_package_data=True, - setup_requires=setup_requires, - extras_require=extras_require, - author='paddle-infer', - author_email='paddle-infer@baidu.com', - url='https://github.com/PaddlePaddle/Paddle2ONNX.git', - # install_requires=['six', 'protobuf', 'onnx<=1.9.0'], - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: Apache Software License", - "Operating System :: OS Independent", - ], - license='Apache 2.0', - entry_points={'console_scripts': ['paddle2onnx=paddle2onnx.command:main']}) From 9d774c30e3d3ebaa18988c0c8b8c34ce22216779 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Mon, 8 Apr 2024 17:15:37 +0800 Subject: [PATCH 03/21] update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9aaa61b5f..9ac80b311 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,4 +60,4 @@ jobs: working-directory: ./paddle2onnx run: | python setup.py bdist_wheel - auditwheel repair dist/paddle2onnx-$(cat VERSION_NUMBER)-cp39-cp39-linux_x86_64.whl + auditwheel repair dist/paddle2onnx-$(cat VERSION_NUMBER)-cp38-cp38-linux_x86_64.whl From 1e8d278830bfd45d667fd31c7eff2fc76673fac5 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Mon, 8 Apr 2024 17:32:18 +0800 Subject: [PATCH 04/21] update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ac80b311..8e0b0f3fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: build: # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily run on Ubuntu-latest. # However, to ensure the stability of the packaging system, we will need to fix the Ubuntu version in the future. - runs-on: ubuntu-20.04 + runs-on: ubuntu-18.04 # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily only package executable files for Python 3.8. # In the future, we will need to extend support to cover Python 3.8 through Python 3.10. From accb6750fc60665abe17c53704d02509e618967c Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Tue, 9 Apr 2024 09:34:35 +0800 Subject: [PATCH 05/21] update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e0b0f3fb..73598fc91 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: build: # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily run on Ubuntu-latest. # However, to ensure the stability of the packaging system, we will need to fix the Ubuntu version in the future. - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily only package executable files for Python 3.8. # In the future, we will need to extend support to cover Python 3.8 through Python 3.10. From f493263dfdc6a595a0e21950b19621a436cf5849 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Fri, 12 Apr 2024 11:46:50 +0800 Subject: [PATCH 06/21] remove unuseful docs --- docs/zh/change_log.md | 19 ------------------- docs/zh/custom_op_mapper.md | 0 2 files changed, 19 deletions(-) delete mode 100644 docs/zh/change_log.md delete mode 100644 docs/zh/custom_op_mapper.md diff --git a/docs/zh/change_log.md b/docs/zh/change_log.md deleted file mode 100644 index 19c97a966..000000000 --- a/docs/zh/change_log.md +++ /dev/null @@ -1,19 +0,0 @@ -## 更新记录 - -2020.11.4 -1. 支持Paddle动态图模型导出为ONNX。 -2. 重构代码结构以更好地支持不同Paddle版本,以及动态图和静态图的转换。 -3. 提升ONNX Opset的覆盖率,未来仍将稳定支持9,10,11三个版本。 - -2020.9.21 -1. 支持ONNX Opset 9, 10, 11三个版本的导出。 -2. 新增支持转换的OP: swish, floor, uniform_random, abs, instance_norm, clip, tanh, log, norm和pad2d。 - -2019.09.25 -1. 新增支持SE_ResNet50_vd、SqueezeNet1_0、SE_ResNext50_32x4d、Xception41、VGG16、InceptionV4、YoloV3模型转换。 -2. 解决0.1版本无法适配新版ONNX版本问题。 - -2019.08.20 -1. 解决preview版本无法适配最新的PaddlePaddle和ONNX版本问题。 -2. 功能上支持主流的图像分类模型和部分图像检测模型。 -3. 统一对外的使用接口,用户可利用PIP安装功能包进行使用。 diff --git a/docs/zh/custom_op_mapper.md b/docs/zh/custom_op_mapper.md deleted file mode 100644 index e69de29bb..000000000 From c471648b633072ae8709cc42cfb57ddfafef8ad5 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Fri, 12 Apr 2024 11:47:07 +0800 Subject: [PATCH 07/21] rename compile.md to compile_local.md --- README.md | 2 +- docs/zh/{compile.md => compile_local.md} | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) rename docs/zh/{compile.md => compile_local.md} (97%) diff --git a/README.md b/README.md index ff27ea428..7178918dc 100755 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ TensorRT/OpenVINO/MNN/TNN/NCNN,以及其它对 ONNX 开源格式进行支持 pip install paddle2onnx ``` -由于没有自动发包机制,针对PaddlePaddle2.6.0的用户,请按照[Github 源码安装方式](docs/zh/compile.md)编译Paddle2ONNX。 +由于没有自动发包机制,针对PaddlePaddle2.6.0的用户,请按照[Github 源码安装方式](docs/zh/compile_local.md)编译Paddle2ONNX。 # 4 使用 diff --git a/docs/zh/compile.md b/docs/zh/compile_local.md similarity index 97% rename from docs/zh/compile.md rename to docs/zh/compile_local.md index c2acbd654..63eee9be6 100644 --- a/docs/zh/compile.md +++ b/docs/zh/compile_local.md @@ -1,8 +1,8 @@ -# 编译安装Paddle2ONNX +# 本地编译安装Paddle2ONNX Paddle2ONNX编译安装需要确保环境满足以下需求 - cmake >= 3.18.0 -- protobuf >= 3.16.0 +- protobuf == 3.16.0 注意:Paddle2ONNX产出的模型,在使用ONNX Runtime推理时,要求使用最新版本(1.10.0版本以及上),如若需要使用低版本(1.6~1.10之间),则需要将ONNX版本降至1.8.2,在执行完`git submodule update`后,执行如下命令,然后再进行编译 ``` @@ -13,6 +13,7 @@ git checkout v1.8.1 ## Linux/Mac编译安装 ### 安装Protobuf + ``` git clone https://github.com/protocolbuffers/protobuf.git cd protobuf @@ -25,7 +26,9 @@ make install # 将编译目录加入环境变量 export PATH=${PWD}/installed_protobuf_lib/bin:${PATH} ``` + ### 安装Paddle2ONNX + ``` git clone https://github.com/PaddlePaddle/Paddle2ONNX.git cd Paddle2ONNX @@ -40,10 +43,13 @@ python setup.py install 注意Windows编译安装先验条件是系统中已安装好Visual Studio 2019 ### 打开VS命令行工具 + 系统菜单中,找到**x64 Native Tools Command Prompt for VS 2019**打开 ### 安装Protobuf + 注意下面cmake命令中`-DCMAKE_INSTALL_PREFIX`指定为你实际设定的路径 + ``` git clone https://github.com/protocolbuffers/protobuf.git cd protobuf @@ -58,6 +64,7 @@ set PATH=D:\Paddle\installed_protobuf_lib\bin;%PATH% ``` ### 安装Paddle2ONNX + ``` git clone https://github.com/PaddlePaddle/Paddle2ONNX.git cd Paddle2ONNX @@ -65,5 +72,4 @@ git submodule init git submodule update python setup.py install - ``` From ddbe38632dc5955f6a8fe96c17f5624b92365ef3 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Fri, 12 Apr 2024 15:21:48 +0800 Subject: [PATCH 08/21] update p2o build docker --- .github/workflows/build.yml | 87 ++++++++++--------- .../workflows/scripts/build_protobuf_unix.sh | 22 +++++ .github/workflows/scripts/entrypoint.sh | 58 +++++++++++++ docs/zh/compile_docker.md | 26 ++++++ docs/zh/compile_local.md | 4 +- 5 files changed, 153 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/scripts/build_protobuf_unix.sh create mode 100644 .github/workflows/scripts/entrypoint.sh create mode 100644 docs/zh/compile_docker.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f278ee244..49e255150 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,18 +11,16 @@ permissions: jobs: build: - # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily run on Ubuntu-latest. - # However, to ensure the stability of the packaging system, we will need to fix the Ubuntu version in the future. runs-on: ubuntu-latest + strategy: + matrix: +# python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] + python-version: [ '3.8' ] + architecture: [ 'x64' ] # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily only package executable files for Python 3.8. # In the future, we will need to extend support to cover Python 3.8 through Python 3.10. steps: - - name: Setup Python 3.8 - uses: actions/setup-python@v5 - with: - python-version: '3.8' - # Checkout the latest branch of Paddle2ONNX. - name: Checkout Paddle2ONNX uses: actions/checkout@v4 @@ -30,40 +28,45 @@ jobs: submodules: true path: paddle2onnx - # Checkout the branch(v3.16.0) of Paddle2ONNX. - - name: Checkout Protobuf - uses: actions/checkout@v4 + - name: Build on manylinux2014_x86_64 + uses: docker://quay.io/pypa/manylinux2014_x86_64:latest with: - repository: protocolbuffers/protobuf - ref: v3.16.0 - path: protobuf - - # Build Protobuf, detailed process can refer to the [Paddle2ONNX construction documentation](https://github.com/PaddlePaddle/Paddle2ONNX/blob/develop/docs/zh/compile.md). - - name: Build Protobuf - working-directory: ./protobuf - run: | - #============ - cmake ./cmake -B build_wd -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install_dir - cmake --build ./build_wd - cmake --build ./build_wd -- install - echo "$PWD/install_dir/bin" >> $GITHUB_PATH - - # Install Dependencies for Python - - name: Install Dependencies for Python - run: | - python -m pip install --upgrade pip - pip install setuptools wheel auditwheel auditwheel-symbols build - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - # Build Paddle2ONNX - - name: Build Paddle2ONNX - working-directory: ./paddle2onnx - run: | - python -m build - python -m pip install dist/*.whl + entrypoint: bash + args: .github/workflows/scripts/entrypoint.sh ${{ matrix.python-version }} manylinux2014_x86_64 - # Install Test - - name: Run Test - working-directory: ./paddle2onnx/tests - run: | - bash run.sh python \ No newline at end of file +# # Checkout the branch(v3.16.0) of Paddle2ONNX. +# - name: Checkout Protobuf +# uses: actions/checkout@v4 +# with: +# repository: protocolbuffers/protobuf +# ref: v3.16.0 +# path: protobuf +# +# # Build Protobuf, detailed process can refer to the [Paddle2ONNX construction documentation](https://github.com/PaddlePaddle/Paddle2ONNX/blob/develop/docs/zh/compile.md). +# - name: Build Protobuf +# working-directory: ./protobuf +# run: | +# #============ +# cmake ./cmake -B build_wd -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install_dir +# cmake --build ./build_wd +# cmake --build ./build_wd -- install +# echo "$PWD/install_dir/bin" >> $GITHUB_PATH +# +# # Install Dependencies for Python +# - name: Install Dependencies for Python +# run: | +# python -m pip install --upgrade pip +# pip install setuptools wheel auditwheel auditwheel-symbols build +# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi +# +# # Build Paddle2ONNX +# - name: Build Paddle2ONNX +# working-directory: ./paddle2onnx +# run: | +# python -m build +# python -m pip install dist/*.whl +# # Do Test +# - name: Run Test +# working-directory: ./paddle2onnx/tests +# run: | +# bash run.sh python \ No newline at end of file diff --git a/.github/workflows/scripts/build_protobuf_unix.sh b/.github/workflows/scripts/build_protobuf_unix.sh new file mode 100644 index 000000000..9d3cbdaea --- /dev/null +++ b/.github/workflows/scripts/build_protobuf_unix.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Copyright (c) ONNX Project Contributors +# +# SPDX-License-Identifier: Apache-2.0 + +export CORE_NUMBER=$1 + +if [[ -z "$CORE_NUMBER" ]]; then + export CORE_NUMBER=1 +fi + +# Build protobuf from source with -fPIC on Unix-like system +ORIGINAL_PATH=$(pwd) +cd .. +git clone https://github.com/protocolbuffers/protobuf.git -b v3.16.0 +cd protobuf +mkdir build_source && cd build_source +cmake ../cmake -DCMAKE_INSTALL_PREFIX=${PWD}/installed_protobuf_lib -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release +make -j$CORE_NUMBER && make install +export PATH=$INSTALL_PROTOBUF_PATH/include:$INSTALL_PROTOBUF_PATH/lib:$INSTALL_PROTOBUF_PATH/bin:$PATH +cd $ORIGINAL_PATH \ No newline at end of file diff --git a/.github/workflows/scripts/entrypoint.sh b/.github/workflows/scripts/entrypoint.sh new file mode 100644 index 000000000..976b2cead --- /dev/null +++ b/.github/workflows/scripts/entrypoint.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +# Copyright (c) ONNX Project Contributors +# +# SPDX-License-Identifier: Apache-2.0 + +set -e -x + +# CLI arguments +PY_VERSION=$1 +PLAT=$2 +GITHUB_EVENT_NAME=$3 + +export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib + +# Compile wheels +# Need to be updated if there is a new Python Version +if [ "$(uname -m)" == "aarch64" ]; then + PIP_INSTALL_COMMAND="$PY_VERSION -m pip install --no-cache-dir -q" + PYTHON_COMMAND="$PY_VERSION" +else + declare -A python_map=( ["3.8"]="cp38-cp38" ["3.9"]="cp39-cp39" ["3.10"]="cp310-cp310" ["3.11"]="cp311-cp311" ["3.12"]="cp312-cp312") + PY_VER=${python_map[$PY_VERSION]} + PIP_INSTALL_COMMAND="/opt/python/${PY_VER}/bin/pip install --no-cache-dir -q" + PYTHON_COMMAND="/opt/python/${PY_VER}/bin/python" +fi + +# Update pip and install cmake +$PIP_INSTALL_COMMAND --upgrade pip +$PIP_INSTALL_COMMAND cmake + +# Build protobuf from source +source .github/workflows/scripts/build_protobuf_unix.sh "$(nproc)" + +# Init Paddle2ONNX +git submodule init +git submodule update + +# Build Paddle2ONNX wheels +$PYTHON_COMMAND -m build --wheel || { echo "Building wheels failed."; exit 1; } + +# Bundle external shared libraries into the wheels +# find -exec does not preserve failed exit codes, so use an output file for failures +failed_wheels=$PWD/failed-wheels +rm -f "$failed_wheels" +find . -type f -iname "*-linux*.whl" -exec sh -c "auditwheel repair '{}' -w \$(dirname '{}') --plat '${PLAT}' || { echo 'Repairing wheels failed.'; auditwheel show '{}' >> '$failed_wheels'; }" \; + +if [[ -f "$failed_wheels" ]]; then + echo "Repairing wheels failed:" + cat failed-wheels + exit 1 +fi + +# Remove useless *-linux*.whl; only keep manylinux*.whl +rm -f dist/*-linux*.whl + +echo "Successfully build wheels:" +find . -type f -iname "*manylinux*.whl" \ No newline at end of file diff --git a/docs/zh/compile_docker.md b/docs/zh/compile_docker.md new file mode 100644 index 000000000..c89fab965 --- /dev/null +++ b/docs/zh/compile_docker.md @@ -0,0 +1,26 @@ +# Docker编译安装Paddle2ONNX + +Paddle2ONNX编译安装需要确保环境满足以下需求 +- cmake >= 3.18.0 +- protobuf == 3.16.0 + +注意:Paddle2ONNX产出的模型,在使用ONNX Runtime推理时,要求使用最新版本(1.10.0版本以及上),如若需要使用低版本(1.6~1.10之间),则需要将ONNX版本降至1.8.2,在执行完`git submodule update`后,执行如下命令,然后再进行编译 +``` +cd Paddle2ONNX/third/onnx +git checkout v1.8.1 +``` + +拉取manylinux镜像并创建容器 + +```bash +docker pull quay.io/pypa/manylinux2014_x86_64 +docker run --name p2o_build -d quay.io/pypa/manylinux2014_x86_64 +``` + +创建容器并运行 + +```bash +docker start p2o_build +docker exec -it p2o_build bash +``` + diff --git a/docs/zh/compile_local.md b/docs/zh/compile_local.md index 63eee9be6..2009ba4fc 100644 --- a/docs/zh/compile_local.md +++ b/docs/zh/compile_local.md @@ -35,7 +35,7 @@ cd Paddle2ONNX git submodule init git submodule update -python setup.py install +python -m build ``` ## Windows编译安装 @@ -71,5 +71,5 @@ cd Paddle2ONNX git submodule init git submodule update -python setup.py install +python -m build ``` From d6386f983656b84ae7b93607e7430b469338f271 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Fri, 12 Apr 2024 15:26:41 +0800 Subject: [PATCH 09/21] update p2o build docker --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 49e255150..c059194ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,6 @@ jobs: uses: actions/checkout@v4 with: submodules: true - path: paddle2onnx - name: Build on manylinux2014_x86_64 uses: docker://quay.io/pypa/manylinux2014_x86_64:latest From 2b66f15e7f2d02fb1ebfa11e572baac837f6ac7c Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Fri, 12 Apr 2024 15:32:06 +0800 Subject: [PATCH 10/21] update p2o build docker --- .github/workflows/scripts/entrypoint.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/scripts/entrypoint.sh b/.github/workflows/scripts/entrypoint.sh index 976b2cead..c81d3c6e5 100644 --- a/.github/workflows/scripts/entrypoint.sh +++ b/.github/workflows/scripts/entrypoint.sh @@ -32,10 +32,6 @@ $PIP_INSTALL_COMMAND cmake # Build protobuf from source source .github/workflows/scripts/build_protobuf_unix.sh "$(nproc)" -# Init Paddle2ONNX -git submodule init -git submodule update - # Build Paddle2ONNX wheels $PYTHON_COMMAND -m build --wheel || { echo "Building wheels failed."; exit 1; } From 47841531152d8d6f2e3d59034c6fde18866f409c Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Fri, 12 Apr 2024 15:37:31 +0800 Subject: [PATCH 11/21] update p2o build docker --- .github/workflows/scripts/build_protobuf_unix.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scripts/build_protobuf_unix.sh b/.github/workflows/scripts/build_protobuf_unix.sh index 9d3cbdaea..85fb09c98 100644 --- a/.github/workflows/scripts/build_protobuf_unix.sh +++ b/.github/workflows/scripts/build_protobuf_unix.sh @@ -18,5 +18,5 @@ cd protobuf mkdir build_source && cd build_source cmake ../cmake -DCMAKE_INSTALL_PREFIX=${PWD}/installed_protobuf_lib -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release make -j$CORE_NUMBER && make install -export PATH=$INSTALL_PROTOBUF_PATH/include:$INSTALL_PROTOBUF_PATH/lib:$INSTALL_PROTOBUF_PATH/bin:$PATH +export PATH=${PWD}/installed_protobuf_lib/bin:${PATH} cd $ORIGINAL_PATH \ No newline at end of file From eb63d87704ff7b0e320efa28ce62e07fcd2c87b1 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Fri, 12 Apr 2024 16:06:56 +0800 Subject: [PATCH 12/21] update p2o build docker --- .github/workflows/build.yml | 42 ++++++++++--------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c059194ef..36448bc3a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,37 +33,17 @@ jobs: entrypoint: bash args: .github/workflows/scripts/entrypoint.sh ${{ matrix.python-version }} manylinux2014_x86_64 -# # Checkout the branch(v3.16.0) of Paddle2ONNX. -# - name: Checkout Protobuf -# uses: actions/checkout@v4 -# with: -# repository: protocolbuffers/protobuf -# ref: v3.16.0 -# path: protobuf -# -# # Build Protobuf, detailed process can refer to the [Paddle2ONNX construction documentation](https://github.com/PaddlePaddle/Paddle2ONNX/blob/develop/docs/zh/compile.md). -# - name: Build Protobuf -# working-directory: ./protobuf -# run: | -# #============ -# cmake ./cmake -B build_wd -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install_dir -# cmake --build ./build_wd -# cmake --build ./build_wd -- install -# echo "$PWD/install_dir/bin" >> $GITHUB_PATH -# -# # Install Dependencies for Python -# - name: Install Dependencies for Python -# run: | -# python -m pip install --upgrade pip -# pip install setuptools wheel auditwheel auditwheel-symbols build -# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi -# -# # Build Paddle2ONNX -# - name: Build Paddle2ONNX -# working-directory: ./paddle2onnx -# run: | -# python -m build -# python -m pip install dist/*.whl + - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 + with: + name: wheels + path: dist + + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + # # Do Test # - name: Run Test # working-directory: ./paddle2onnx/tests From 8eb41607bda08e406f8f0cf4645262bc0eaf7512 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Fri, 12 Apr 2024 16:27:14 +0800 Subject: [PATCH 13/21] update VERSION_NUMBER --- VERSION_NUMBER | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION_NUMBER b/VERSION_NUMBER index 9084fa2f7..26aaba0e8 100755 --- a/VERSION_NUMBER +++ b/VERSION_NUMBER @@ -1 +1 @@ -1.1.0 +1.2.0 From bf650c694d02556edea26c2d871c75bc6ecffc75 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Fri, 12 Apr 2024 17:02:40 +0800 Subject: [PATCH 14/21] update python version --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 36448bc3a..cdc5ddf69 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,8 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: -# python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] - python-version: [ '3.8' ] + python-version: [ '3.8', '3.9'] architecture: [ 'x64' ] # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily only package executable files for Python 3.8. From e3016571da88e66aeaeeb863346a9b801a99b483 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Sat, 13 Apr 2024 09:23:54 +0800 Subject: [PATCH 15/21] update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cdc5ddf69..f924ad896 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,7 @@ jobs: uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + password: ${{ secrets.ZHENG_BICHENG_PYPI_TOKEN }} # # Do Test # - name: Run Test From ceeba7f4fa3a95cbc7ca24adf52cf5b12c355be8 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Sat, 13 Apr 2024 10:42:11 +0800 Subject: [PATCH 16/21] update build.yml --- .github/workflows/build_and_test.yml | 45 +++++++++++++++++++ .../{build.yml => release_linux_x86_64.yml} | 16 ++----- 2 files changed, 49 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/build_and_test.yml rename .github/workflows/{build.yml => release_linux_x86_64.yml} (77%) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml new file mode 100644 index 000000000..20322ad06 --- /dev/null +++ b/.github/workflows/build_and_test.yml @@ -0,0 +1,45 @@ +name: Build Package + +on: + push: + branches: [ "develop" ] + pull_request: + branches: [ "develop" ] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ '3.8' ] + architecture: [ 'x64' ] + + # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily only package executable files for Python 3.8. + # In the future, we will need to extend support to cover Python 3.8 through Python 3.10. + steps: + # Checkout the latest branch of Paddle2ONNX. + - name: Checkout Paddle2ONNX + uses: actions/checkout@v4 + with: + submodules: true + + - name: Build on manylinux2014_x86_64 + uses: docker://quay.io/pypa/manylinux2014_x86_64:latest + with: + entrypoint: bash + args: .github/workflows/scripts/entrypoint.sh ${{ matrix.python-version }} manylinux2014_x86_64 + + # Build Paddle2ONNX + - name: Build Paddle2ONNX + working-directory: ./paddle2onnx + run: | + python -m pip install dist/*.whl + + # Install Test + - name: Run Test + working-directory: ./paddle2onnx/tests + run: | + bash run.sh python \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/release_linux_x86_64.yml similarity index 77% rename from .github/workflows/build.yml rename to .github/workflows/release_linux_x86_64.yml index f924ad896..efe1078c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/release_linux_x86_64.yml @@ -1,10 +1,8 @@ name: Build Package on: - push: - branches: [ "develop" ] - pull_request: - branches: [ "develop" ] + release: + types: [published] permissions: contents: read @@ -14,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.8', '3.9'] + python-version: [ '3.8', '3.9', '3.10'] architecture: [ 'x64' ] # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily only package executable files for Python 3.8. @@ -41,10 +39,4 @@ jobs: uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: user: __token__ - password: ${{ secrets.ZHENG_BICHENG_PYPI_TOKEN }} - -# # Do Test -# - name: Run Test -# working-directory: ./paddle2onnx/tests -# run: | -# bash run.sh python \ No newline at end of file + password: ${{ secrets.ZHENG_BICHENG_PYPI_TOKEN }} \ No newline at end of file From 0c92929ca62535a6624edb0632d772116ec54830 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Sat, 13 Apr 2024 10:51:29 +0800 Subject: [PATCH 17/21] update build.yml --- .github/workflows/build_and_test.yml | 40 ++++++++++++++++++++++------ README.md | 4 +-- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 20322ad06..f278ee244 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -11,31 +11,55 @@ permissions: jobs: build: + # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily run on Ubuntu-latest. + # However, to ensure the stability of the packaging system, we will need to fix the Ubuntu version in the future. runs-on: ubuntu-latest - strategy: - matrix: - python-version: [ '3.8' ] - architecture: [ 'x64' ] # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily only package executable files for Python 3.8. # In the future, we will need to extend support to cover Python 3.8 through Python 3.10. steps: + - name: Setup Python 3.8 + uses: actions/setup-python@v5 + with: + python-version: '3.8' + # Checkout the latest branch of Paddle2ONNX. - name: Checkout Paddle2ONNX uses: actions/checkout@v4 with: submodules: true + path: paddle2onnx - - name: Build on manylinux2014_x86_64 - uses: docker://quay.io/pypa/manylinux2014_x86_64:latest + # Checkout the branch(v3.16.0) of Paddle2ONNX. + - name: Checkout Protobuf + uses: actions/checkout@v4 with: - entrypoint: bash - args: .github/workflows/scripts/entrypoint.sh ${{ matrix.python-version }} manylinux2014_x86_64 + repository: protocolbuffers/protobuf + ref: v3.16.0 + path: protobuf + + # Build Protobuf, detailed process can refer to the [Paddle2ONNX construction documentation](https://github.com/PaddlePaddle/Paddle2ONNX/blob/develop/docs/zh/compile.md). + - name: Build Protobuf + working-directory: ./protobuf + run: | + #============ + cmake ./cmake -B build_wd -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install_dir + cmake --build ./build_wd + cmake --build ./build_wd -- install + echo "$PWD/install_dir/bin" >> $GITHUB_PATH + + # Install Dependencies for Python + - name: Install Dependencies for Python + run: | + python -m pip install --upgrade pip + pip install setuptools wheel auditwheel auditwheel-symbols build + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi # Build Paddle2ONNX - name: Build Paddle2ONNX working-directory: ./paddle2onnx run: | + python -m build python -m pip install dist/*.whl # Install Test diff --git a/README.md b/README.md index 0440d97b3..8f5d35724 100755 --- a/README.md +++ b/README.md @@ -14,13 +14,11 @@ TensorRT/OpenVINO/MNN/TNN/NCNN,以及其它对 ONNX 开源格式进行支持 # 3 安装 -针对PaddlePaddle2.5.2的用户可以直接运行以下命令行代码来安装P2O - ``` pip install paddle2onnx ``` -由于没有自动发包机制,针对PaddlePaddle2.6.0的用户,请按照[Github 源码安装方式](docs/zh/compile_local.md)编译Paddle2ONNX。 +开发用户,请按照[Github 源码安装方式](docs/zh/compile_local.md)编译Paddle2ONNX。 # 4 使用 From 0c3824c6088972fa478d9ac1a74d54ced8660198 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Sat, 13 Apr 2024 10:52:06 +0800 Subject: [PATCH 18/21] update build.yml --- .github/workflows/release_linux_x86_64.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_linux_x86_64.yml b/.github/workflows/release_linux_x86_64.yml index efe1078c3..dbad2acc3 100644 --- a/.github/workflows/release_linux_x86_64.yml +++ b/.github/workflows/release_linux_x86_64.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.8', '3.9', '3.10'] + python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12'] architecture: [ 'x64' ] # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily only package executable files for Python 3.8. From 94c4cc2e47d19db3fbf1a39b7a598294b3eaea38 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Sat, 13 Apr 2024 11:08:31 +0800 Subject: [PATCH 19/21] update build.yml --- .github/workflows/release_linux_x86_64.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release_linux_x86_64.yml b/.github/workflows/release_linux_x86_64.yml index dbad2acc3..2eb3de043 100644 --- a/.github/workflows/release_linux_x86_64.yml +++ b/.github/workflows/release_linux_x86_64.yml @@ -12,7 +12,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12'] +# python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: [ '3.8' ] architecture: [ 'x64' ] # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily only package executable files for Python 3.8. @@ -21,8 +22,11 @@ jobs: # Checkout the latest branch of Paddle2ONNX. - name: Checkout Paddle2ONNX uses: actions/checkout@v4 - with: - submodules: true + shell: bash + run: | + auth_header="$(git config --local --get http.https://github.com/.extraheader)" + git submodule sync --recursive + git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - name: Build on manylinux2014_x86_64 uses: docker://quay.io/pypa/manylinux2014_x86_64:latest From 1b6e37b9e9c21276b44440b4d4b7500d0c6c1894 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Sat, 13 Apr 2024 11:15:47 +0800 Subject: [PATCH 20/21] update build.yml --- .github/workflows/release_linux_x86_64.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release_linux_x86_64.yml b/.github/workflows/release_linux_x86_64.yml index 2eb3de043..434009f8d 100644 --- a/.github/workflows/release_linux_x86_64.yml +++ b/.github/workflows/release_linux_x86_64.yml @@ -22,11 +22,8 @@ jobs: # Checkout the latest branch of Paddle2ONNX. - name: Checkout Paddle2ONNX uses: actions/checkout@v4 - shell: bash - run: | - auth_header="$(git config --local --get http.https://github.com/.extraheader)" - git submodule sync --recursive - git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 + with: + submodules: true - name: Build on manylinux2014_x86_64 uses: docker://quay.io/pypa/manylinux2014_x86_64:latest From 82cd655893ac0b2646af1bd89234a3a6cb01f0c1 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng Date: Sat, 13 Apr 2024 11:22:59 +0800 Subject: [PATCH 21/21] update build.yml --- .github/workflows/release_linux_x86_64.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release_linux_x86_64.yml b/.github/workflows/release_linux_x86_64.yml index 434009f8d..dbad2acc3 100644 --- a/.github/workflows/release_linux_x86_64.yml +++ b/.github/workflows/release_linux_x86_64.yml @@ -12,8 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: -# python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12'] - python-version: [ '3.8' ] + python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12'] architecture: [ 'x64' ] # For the sake of simplicity in testing, the Paddle2ONNX packaging program will temporarily only package executable files for Python 3.8.