diff --git a/.github/workflows/changelog_reminder.yml b/.github/workflows/changelog_reminder.yml index 2eb934c165..4d3b120541 100644 --- a/.github/workflows/changelog_reminder.yml +++ b/.github/workflows/changelog_reminder.yml @@ -1,5 +1,5 @@ on: - pull_request: + #pull_request: types: [opened, ready_for_review] name: Changelog Reminder diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 6cbde05023..449feeacd9 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,6 +1,6 @@ name: Formatting check on: - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/test_gpu_cu11.yml b/.github/workflows/test_gpu_cu11.yml index 424c73a64d..96d27c2436 100644 --- a/.github/workflows/test_gpu_cu11.yml +++ b/.github/workflows/test_gpu_cu11.yml @@ -1,6 +1,6 @@ name: Testing::Linux::x86_64 (Lightning-GPU) on: - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests_linux.yml index a51db27345..b04ce5fe10 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -10,7 +10,7 @@ on: type: string required: true description: The version of PennyLane to use. Valid values are either 'stable' (most recent git-tag) or 'latest' (most recent commit from master) - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index 7500152af1..782831e269 100644 --- a/.github/workflows/tests_windows.yml +++ b/.github/workflows/tests_windows.yml @@ -3,7 +3,7 @@ on: push: branches: - master - pull_request: + #pull_request: concurrency: group: tests_windows-${{ github.ref }} diff --git a/.github/workflows/tests_without_binary.yml b/.github/workflows/tests_without_binary.yml index bb21da4cfb..845b215e96 100644 --- a/.github/workflows/tests_without_binary.yml +++ b/.github/workflows/tests_without_binary.yml @@ -10,7 +10,7 @@ on: type: string required: true description: The version of PennyLane to use. Valid values are either 'stable' (most recent git-tag) or 'latest' (most recent commit from master) - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/update_dev_version.yml b/.github/workflows/update_dev_version.yml index bfa66e1e8b..02062bdb5c 100644 --- a/.github/workflows/update_dev_version.yml +++ b/.github/workflows/update_dev_version.yml @@ -1,6 +1,6 @@ name: Update dev version automatically on: - pull_request: + #pull_request: jobs: update-dev-version: diff --git a/.github/workflows/wheel_linux_x86_64.yml b/.github/workflows/wheel_linux_x86_64.yml index 486c480b04..c8e99185bd 100644 --- a/.github/workflows/wheel_linux_x86_64.yml +++ b/.github/workflows/wheel_linux_x86_64.yml @@ -9,7 +9,7 @@ env: GCC_VERSION: 11 on: - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/wheel_linux_x86_64_cu11.yml b/.github/workflows/wheel_linux_x86_64_cu11.yml new file mode 100644 index 0000000000..773fc21cf8 --- /dev/null +++ b/.github/workflows/wheel_linux_x86_64_cu11.yml @@ -0,0 +1,135 @@ +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.9, 3.10, 3.11. +# **Why we have it**: To build wheels for pennylane-lightning-gpu installation. +# **Who does it impact**: Wheels to be uploaded to PyPI. + +env: + GCC_VERSION: 11 + +on: + pull_request: + push: + branches: + - master + release: + +jobs: + set_wheel_build_matrix: + name: "Set wheel build matrix" + uses: ./.github/workflows/set_wheel_build_matrix.yml + with: + event_name: ${{ github.event_name }} + + linux-wheels-x86-64: + needs: [set_wheel_build_matrix] + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + arch: [x86_64] + pl_backend: ["lightning_gpu"] + cibw_build: ${{ fromJson(needs.set_wheel_build_matrix.outputs.python_version) }} + container_img: ["quay.io/pypa/manylinux2014_x86_64"] + timeout-minutes: 30 + name: ${{ matrix.os }}::${{ matrix.arch }} - ${{ matrix.pl_backend }} (Python ${{ fromJson('{ "cp39-*":"3.9","cp310-*":"3.10","cp311-*":"3.11" }')[matrix.cibw_build] }}) + runs-on: ${{ matrix.os }} + container: ${{ matrix.container_img }} + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.11.0 + with: + access_token: ${{ github.token }} + + - name: Checkout PennyLane-Lightning-GPU + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install dependencies (CentOS) + if: ${{ (matrix.container_img == 'quay.io/pypa/manylinux2014_x86_64') }} + run: | + # Reduce wait time for repos not responding + cat /etc/yum.conf | sed "s/\[main\]/\[main\]\ntimeout=5/g" > /etc/yum.conf + yum update -y && yum install -y docker + + - name: Install cibuildwheel + run: python3.9 -m pip install cibuildwheel~=2.11.0 + + - name: Build wheels + env: + CIBW_ARCHS_LINUX: ${{ matrix.arch }} + + CIBW_BUILD: ${{ matrix.cibw_build }} + CIBW_BUILD_FRONTEND: "pip" + + CIBW_SKIP: "*-musllinux*" + + CIBW_CONFIG_SETTINGS: --global-option=build_ext --global-option=--define="CMAKE_CXX_COMPILER=$(which g++-11);CMAKE_C_COMPILER=$(which gcc-11);LIGHTNING_RELEASE_TAG=master" + + # Python build settings + CIBW_BEFORE_BUILD: | + cat /etc/yum.conf | sed "s/\[main\]/\[main\]\ntimeout=5/g" > /etc/yum.conf + python -m pip install ninja cmake~=3.24.3 auditwheel + python -m pip install custatevec-cu11 + yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo -y + yum clean all -y + yum install centos-release-scl-rh -y + yum install devtoolset-11-gcc-c++ -y + source /opt/rh/devtoolset-11/enable -y + yum -y install cuda-11-5 git openssh wget + + # ensure nvcc is available + CIBW_ENVIRONMENT: | + PATH=$PATH:/usr/local/cuda/bin \ + LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") \ + PL_BACKEND="${{ matrix.pl_backend }}" + + # CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_REPAIR_WHEEL_COMMAND_LINUX: "./docker/auditwheel repair -w {dest_dir} {wheel}" + + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + + CIBW_BUILD_VERBOSITY: 3 + + run: python3.9 -m cibuildwheel --output-dir wheelhouse + + - name: Validate wheels + run: | + python3.9 -m pip install twine + python3.9 -m twine check ./wheelhouse/*.whl + + - uses: actions-ecosystem/action-regex-match@main + id: rc_build + with: + text: ${{ github.event.pull_request.head.ref }} + regex: '.*[0-9]+.[0-9]+.[0-9]+[-_]?rc[0-9]+' + + - uses: actions/upload-artifact@v3 + if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master' || steps.rc_build.outputs.match != ''}} + with: + name: ${{ runner.os }}-wheels-${{ matrix.pl_backend }}-${{ matrix.arch }}.zip + path: ./wheelhouse/*.whl + + upload-pypi: + needs: linux-wheels-x86-64 + runs-on: ubuntu-latest + if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master'}} + steps: + - uses: actions/download-artifact@v3 + with: + name: Linux-wheels-${{ matrix.pl_backend }}-${{ matrix.arch }}.zip + path: dist + + - name: Upload wheels to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + diff --git a/.github/workflows/wheel_macos_arm64.yml b/.github/workflows/wheel_macos_arm64.yml index 4e0449038c..dde609f04a 100644 --- a/.github/workflows/wheel_macos_arm64.yml +++ b/.github/workflows/wheel_macos_arm64.yml @@ -6,7 +6,7 @@ name: Wheel::MacOS::ARM # **Who does it impact**: Wheels to be uploaded to PyPI. on: - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/wheel_macos_x86_64.yml b/.github/workflows/wheel_macos_x86_64.yml index e63cfb46d3..6f58cbf6a1 100644 --- a/.github/workflows/wheel_macos_x86_64.yml +++ b/.github/workflows/wheel_macos_x86_64.yml @@ -6,7 +6,7 @@ name: Wheel::MacOS::Intel # **Who does it impact**: Wheels to be uploaded to PyPI. on: - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/wheel_noarch.yml b/.github/workflows/wheel_noarch.yml index d3e6622730..000a800cf2 100644 --- a/.github/workflows/wheel_noarch.yml +++ b/.github/workflows/wheel_noarch.yml @@ -6,7 +6,7 @@ name: Wheel::Any::None # **Who does it impact**: Wheels to be uploaded to PyPI. on: - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/wheel_win_x86_64.yml b/.github/workflows/wheel_win_x86_64.yml index 2cbde98bbe..54552cce90 100644 --- a/.github/workflows/wheel_win_x86_64.yml +++ b/.github/workflows/wheel_win_x86_64.yml @@ -6,7 +6,7 @@ name: Wheel::Windows::x86_64 # **Who does it impact**: Wheels to be uploaded to PyPI. on: - pull_request: + #pull_request: push: branches: - master