diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index a7beb2bbde..063e22e5cd 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -6,6 +6,9 @@ ### Improvements +* Parallelize wheel-builds where applicable. +[(#314)](https://github.com/PennyLaneAI/pennylane-lightning/pull/314) + ### Documentation ### Bug fixes @@ -14,6 +17,8 @@ This release contains contributions from (in alphabetical order): +Amintor Dusko + --- # Release 0.24.0 diff --git a/.github/workflows/wheel_linux_aarch64.yml b/.github/workflows/wheel_linux_aarch64.yml index 9cb18a58a9..90e40812e7 100644 --- a/.github/workflows/wheel_linux_aarch64.yml +++ b/.github/workflows/wheel_linux_aarch64.yml @@ -1,4 +1,10 @@ name: Wheel::Linux::ARM + +# **What it does**: Builds python wheels for Linux (ubuntu-latest) architecture ARM 64 and store it as artifacts. +# Python versions: 3.7, 3.8, 3.9, 3.10. +# **Why we have it**: To build wheels for pennylane-lightning installation. +# **Who does it impact**: Wheels to be uploaded to PyPI. + on: push: branches: @@ -6,25 +12,6 @@ on: release: types: [published] -env: - CIBW_BUILD: 'cp37-* cp38-* cp39-* cp310-*' - CIBW_SKIP: "*-musllinux*" - - # Python build settings - CIBW_BEFORE_BUILD: | - pip install pybind11 ninja cmake && yum install -y gcc gcc-c++ - - # Testing of built wheels - CIBW_TEST_REQUIRES: numpy~=1.21 scipy pytest pytest-cov pytest-mock flaky - - CIBW_BEFORE_TEST: pip install git+https://github.com/PennyLaneAI/pennylane.git@master - - CIBW_TEST_COMMAND: | - pl-device-test --device=lightning.qubit --skip-ops -x --tb=short --no-flaky-report - - # Use Centos 7 wheel-builder for ARM - CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 - jobs: linux-wheels-aarch64: strategy: @@ -32,7 +19,9 @@ jobs: matrix: os: [ubuntu-latest] arch: [aarch64] - name: ubuntu-latest::aarch64 + cibw_build: [cp37-*, cp38-*, cp39-*, cp310-*] + + name: ubuntu-latest::aarch64 (Python ${{ fromJson('{ "cp37-*":"3.7","cp38-*":"3.8","cp39-*":"3.9","cp310-*":"3.10" }')[matrix.cibw_build] }}) runs-on: ${{ matrix.os }} steps: @@ -57,6 +46,24 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: + CIBW_BUILD: ${{ matrix.cibw_build }} + CIBW_SKIP: "*-musllinux*" + + # Python build settings + CIBW_BEFORE_BUILD: | + pip install pybind11 ninja cmake && yum install -y gcc gcc-c++ + + # Testing of built wheels + CIBW_TEST_REQUIRES: numpy~=1.21 scipy pytest pytest-cov pytest-mock flaky + + CIBW_BEFORE_TEST: pip install git+https://github.com/PennyLaneAI/pennylane.git@master + + CIBW_TEST_COMMAND: | + pl-device-test --device=lightning.qubit --skip-ops -x --tb=short --no-flaky-report + + # Use Centos 7 wheel-builder for ARM + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 + CIBW_ARCHS_LINUX: ${{matrix.arch}} - uses: actions/upload-artifact@v2 diff --git a/.github/workflows/wheel_linux_ppc64le.yml b/.github/workflows/wheel_linux_ppc64le.yml index 8d4771a036..9c262c4b46 100644 --- a/.github/workflows/wheel_linux_ppc64le.yml +++ b/.github/workflows/wheel_linux_ppc64le.yml @@ -1,4 +1,10 @@ name: Wheel::Linux::PowerPC + +# **What it does**: Build python wheels for Linux (ubuntu-latest) architecture PowerPC 64 and store it as artifacts. +# Python versions: 3.7, 3.8, 3.9, 3.10. +# **Why we have it**: To build wheels for pennylane-lightning installation. +# **Who does it impact**: Wheels to be uploaded to PyPI. + on: push: branches: @@ -6,22 +12,6 @@ on: release: types: [published] -env: - CIBW_BUILD: 'cp37-* cp38-* cp39-* cp310-*' - CIBW_SKIP: "*-musllinux*" - - # Python build settings - CIBW_BEFORE_BUILD: | - pip install pybind11 ninja cmake && yum install -y gcc gcc-c++ - - # Skip PPC tests due to lack of numpy/scipy wheel support - CIBW_TEST_SKIP: "*-manylinux_{ppc64le}" - - CIBW_BEFORE_TEST: pip install git+https://github.com/PennyLaneAI/pennylane.git@master - - # Use CentOS 7 image for PPC - CIBW_MANYLINUX_PPC64LE_IMAGE: manylinux2014 - jobs: linux-wheels-ppc64le: strategy: @@ -29,7 +19,9 @@ jobs: matrix: os: [ubuntu-latest] arch: [ppc64le] - name: ubuntu-latest::ppc64le + cibw_build: [cp37-*, cp38-*, cp39-*, cp310-*] + + name: ubuntu-latest::ppc64le (Python ${{ fromJson('{ "cp37-*":"3.7","cp38-*":"3.8","cp39-*":"3.9","cp310-*":"3.10" }')[matrix.cibw_build] }}) runs-on: ${{ matrix.os }} steps: @@ -54,6 +46,21 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: + CIBW_BUILD: ${{ matrix.cibw_build }} + CIBW_SKIP: "*-musllinux*" + + # Python build settings + CIBW_BEFORE_BUILD: | + pip install pybind11 ninja cmake && yum install -y gcc gcc-c++ + + # Skip PPC tests due to lack of numpy/scipy wheel support + CIBW_TEST_SKIP: "*-manylinux_{ppc64le}" + + CIBW_BEFORE_TEST: pip install git+https://github.com/PennyLaneAI/pennylane.git@master + + # Use CentOS 7 image for PPC + CIBW_MANYLINUX_PPC64LE_IMAGE: manylinux2014 + CIBW_ARCHS_LINUX: ${{matrix.arch}} - uses: actions/upload-artifact@v2 diff --git a/.github/workflows/wheel_linux_x86_64.yml b/.github/workflows/wheel_linux_x86_64.yml index 61f7f5fb55..d7ceb70e1c 100644 --- a/.github/workflows/wheel_linux_x86_64.yml +++ b/.github/workflows/wheel_linux_x86_64.yml @@ -1,30 +1,17 @@ name: Wheel::Linux::x86_64 + +# **What it does**: Builds python wheels for Linux (ubuntu-latest) architecture x86_64 and store it as artifacts. +# Python versions: 3.7, 3.8, 3.9, 3.10. +# **Why we have it**: To build wheels for pennylane-lightning installation. +# **Who does it impact**: Wheels to be uploaded to PyPI. + on: - release: - types: [published] + pull_request: push: branches: - master - pull_request: - -env: - CIBW_BUILD: 'cp37-* cp38-* cp39-* cp310-*' - CIBW_SKIP: "*-musllinux*" - - # Python build settings - CIBW_BEFORE_BUILD: | - pip install pybind11 ninja cmake && yum install -y gcc gcc-c++ - - # Testing of built wheels - CIBW_TEST_REQUIRES: numpy~=1.21 scipy pytest pytest-cov pytest-mock flaky - - CIBW_BEFORE_TEST: | - pip install git+https://github.com/PennyLaneAI/pennylane.git@master - - CIBW_TEST_COMMAND: | - pl-device-test --device=lightning.qubit --skip-ops -x --tb=short --no-flaky-report - - CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + release: + types: [published] jobs: linux-wheels-x86-64: @@ -33,7 +20,9 @@ jobs: matrix: os: [ubuntu-latest] arch: [x86_64] - name: ${{ matrix.os }} + cibw_build: [cp37-*, cp38-*, cp39-*, cp310-*] + + name: ${{ matrix.os }} (Python ${{ fromJson('{ "cp37-*":"3.7","cp38-*":"3.8","cp39-*":"3.9","cp310-*":"3.10" }')[matrix.cibw_build] }}) runs-on: ${{ matrix.os }} steps: @@ -53,10 +42,28 @@ jobs: run: python -m pip install cibuildwheel==2.3.0 - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse env: + CIBW_BUILD: ${{ matrix.cibw_build }} + CIBW_SKIP: "*-musllinux*" + + # Python build settings + CIBW_BEFORE_BUILD: | + pip install pybind11 ninja cmake && yum install -y gcc gcc-c++ + + # Testing of built wheels + CIBW_TEST_REQUIRES: numpy~=1.21 scipy pytest pytest-cov pytest-mock flaky + + CIBW_BEFORE_TEST: | + pip install git+https://github.com/PennyLaneAI/pennylane.git@master + + CIBW_TEST_COMMAND: | + pl-device-test --device=lightning.qubit --skip-ops -x --tb=short --no-flaky-report + + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 CIBW_ARCHS_LINUX: ${{matrix.arch}} + run: python -m cibuildwheel --output-dir wheelhouse + - uses: actions-ecosystem/action-regex-match@v2 id: rc_build with: diff --git a/.github/workflows/wheel_macos_arm64.yml b/.github/workflows/wheel_macos_arm64.yml index 8a7b0faccf..608e771976 100644 --- a/.github/workflows/wheel_macos_arm64.yml +++ b/.github/workflows/wheel_macos_arm64.yml @@ -1,35 +1,21 @@ name: Wheel::MacOS::ARM + +# **What it does**: Builds python wheels for MacOS (11) architecture ARM 64 and store it as artifacts. +# Python versions: 3.8, 3.9, 3.10. +# **Why we have it**: To build wheels for pennylane-lightning installation. +# **Who does it impact**: Wheels to be uploaded to PyPI. + on: + pull_request: push: branches: - master - pull_request: release: types: [published] env: - CIBW_BUILD: 'cp37-* cp38-* cp39-* cp310-*' - ARCHS: 'arm64' - # MacOS specific build settings - CIBW_BEFORE_ALL_MACOS: | - brew uninstall --force oclint - - # Python build settings - CIBW_BEFORE_BUILD: | - pip install pybind11 ninja cmake - - # Testing of built wheels - CIBW_TEST_REQUIRES: numpy~=1.21 scipy pytest pytest-cov pytest-mock flaky - - CIBW_BEFORE_TEST: pip install git+https://github.com/PennyLaneAI/pennylane.git@master - - CIBW_TEST_COMMAND: | - pl-device-test --device=lightning.qubit --skip-ops -x --tb=short --no-flaky-report - - CIBW_BUILD_VERBOSITY: 1 - jobs: mac-wheels-arm64: strategy: @@ -37,7 +23,9 @@ jobs: matrix: os: [macos-11] arch: [arm64] - name: macos-latest::arm64 + cibw_build: [cp38-*, cp39-*, cp310-*] + + name: macos-latest::arm64 (Python ${{ fromJson('{ "cp37-*":"3.7","cp38-*":"3.8","cp39-*":"3.9","cp310-*":"3.10" }')[matrix.cibw_build] }}) runs-on: ${{ matrix.os }} steps: @@ -57,11 +45,32 @@ jobs: run: python -m pip install cibuildwheel==2.3.0 - name: Build wheels - run: | - python -m cibuildwheel --output-dir wheelhouse env: + CIBW_BUILD: ${{ matrix.cibw_build }} + + # MacOS specific build settings + CIBW_BEFORE_ALL_MACOS: | + brew uninstall --force oclint + + # Python build settings + CIBW_BEFORE_BUILD: | + pip install pybind11 ninja cmake + + # Testing of built wheels + CIBW_TEST_REQUIRES: numpy~=1.21 scipy pytest pytest-cov pytest-mock flaky + + CIBW_BEFORE_TEST: pip install git+https://github.com/PennyLaneAI/pennylane.git@master + + CIBW_TEST_COMMAND: | + pl-device-test --device=lightning.qubit --skip-ops -x --tb=short --no-flaky-report + + CIBW_BUILD_VERBOSITY: 1 + CIBW_ARCHS_MACOS: ${{ matrix.arch }} + run: | + python -m cibuildwheel --output-dir wheelhouse + - uses: actions/upload-artifact@v2 if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master' }} with: diff --git a/.github/workflows/wheel_macos_x86_64.yml b/.github/workflows/wheel_macos_x86_64.yml index 6131f27acb..e99d070cd1 100644 --- a/.github/workflows/wheel_macos_x86_64.yml +++ b/.github/workflows/wheel_macos_x86_64.yml @@ -1,34 +1,19 @@ name: Wheel::MacOS::Intel + +# **What it does**: Builds python wheels for MacOS (10.15) architecture x86_64 and store it as artifacts. +# Python versions: 3.7, 3.8, 3.9, 3.10. +# **Why we have it**: To build wheels for pennylane-lightning installation. +# **Who does it impact**: Wheels to be uploaded to PyPI. + on: + pull_request: push: branches: - master - pull_request: release: types: [published] env: - CIBW_BUILD: 'cp37-* cp38-* cp39-* cp310-*' - - # MacOS specific build settings - CIBW_BEFORE_ALL_MACOS: | - brew uninstall --force oclint - brew install libomp - - # Python build settings - CIBW_BEFORE_BUILD: | - pip install pybind11 ninja cmake - - # Testing of built wheels - CIBW_TEST_REQUIRES: numpy~=1.21 scipy pytest pytest-cov pytest-mock flaky - - CIBW_BEFORE_TEST: pip install git+https://github.com/PennyLaneAI/pennylane.git@master - - CIBW_TEST_COMMAND: | - pl-device-test --device=lightning.qubit --skip-ops -x --tb=short --no-flaky-report - - CIBW_BUILD_VERBOSITY: 1 - MACOSX_DEPLOYMENT_TARGET: 10.15 jobs: @@ -38,7 +23,9 @@ jobs: matrix: os: [macos-10.15] arch: [x86_64] - name: ${{ matrix.os }} + cibw_build: [cp37-*, cp38-*, cp39-*, cp310-*] + + name: ${{ matrix.os }} (Python ${{ fromJson('{ "cp37-*":"3.7","cp38-*":"3.8","cp39-*":"3.9","cp310-*":"3.10" }')[matrix.cibw_build] }}) runs-on: ${{ matrix.os }} steps: @@ -58,11 +45,34 @@ jobs: run: python -m pip install cibuildwheel==2.3.0 - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse env: + CIBW_BUILD: ${{ matrix.cibw_build }} + + # MacOS specific build settings + CIBW_BEFORE_ALL_MACOS: | + brew uninstall --force oclint + brew install libomp + + # Python build settings + CIBW_BEFORE_BUILD: | + pip install pybind11 ninja cmake + + # Testing of built wheels + CIBW_TEST_REQUIRES: numpy~=1.21 scipy pytest pytest-cov pytest-mock flaky + + CIBW_BEFORE_TEST: pip install git+https://github.com/PennyLaneAI/pennylane.git@master + + CIBW_TEST_COMMAND: | + pl-device-test --device=lightning.qubit --skip-ops -x --tb=short --no-flaky-report + + CIBW_BUILD_VERBOSITY: 1 + CIBW_ARCHS_MACOS: ${{matrix.arch}} + USE_OMP: 1 + run: python -m cibuildwheel --output-dir wheelhouse + - uses: actions-ecosystem/action-regex-match@v2 id: rc_build with: diff --git a/.github/workflows/wheel_noarch.yml b/.github/workflows/wheel_noarch.yml index 78dc2ac273..867281780e 100644 --- a/.github/workflows/wheel_noarch.yml +++ b/.github/workflows/wheel_noarch.yml @@ -1,9 +1,15 @@ name: Wheel::Any::None + +# **What it does**: Builds a pure python wheel for Linux (ubuntu-latest) and store it as an artifact. +# Python version: 3.7. +# **Why we have it**: To test the wheel build in the python layer, with no compilation. +# **Who does it impact**: Wheels to be uploaded to PyPI. + on: + pull_request: push: branches: - master - pull_request: release: types: [published] diff --git a/.github/workflows/wheel_win_x86_64.yml b/.github/workflows/wheel_win_x86_64.yml index db3f1341c2..0f6fb89100 100644 --- a/.github/workflows/wheel_win_x86_64.yml +++ b/.github/workflows/wheel_win_x86_64.yml @@ -1,9 +1,15 @@ name: Wheel::Windows::x86_64 + +# **What it does**: Builds python wheels for Windows (windows-latest) and store it as artifacts. +# Python versions: 3.7, 3.8, 3.9, 3.10. +# **Why we have it**: To build wheels for pennylane-lightning installation. +# **Who does it impact**: Wheels to be uploaded to PyPI. + on: + pull_request: push: branches: - master - pull_request: release: types: [published] @@ -85,7 +91,6 @@ jobs: name: ${{ runner.os }}-wheels.zip path: Z:\dist\*.whl - upload-pypi: needs: win-wheels runs-on: ubuntu-latest diff --git a/pennylane_lightning/_version.py b/pennylane_lightning/_version.py index 38620637dd..36495dc9c3 100644 --- a/pennylane_lightning/_version.py +++ b/pennylane_lightning/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.25.0-dev1" +__version__ = "0.25.0-dev2"