From f5f5b3fd6da38a0b93a69f1b826db5dc976b9ee0 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 13 Oct 2023 15:22:47 -0400 Subject: [PATCH 01/44] Initial commit mpi tests --- .github/workflows/changelog_reminder.yml | 2 +- .github/workflows/format.yml | 2 +- .github/workflows/test_gpu_cu11.yml | 2 +- .github/workflows/tests_linux.yml | 2 +- .github/workflows/tests_linux_x86_mpich.yml | 306 ++++++++++++++++++ .github/workflows/tests_linux_x86_openmpi.yml | 279 ++++++++++++++++ .github/workflows/tests_windows.yml | 2 +- .github/workflows/tests_without_binary.yml | 2 +- .github/workflows/update_dev_version.yml | 2 +- .github/workflows/wheel_linux_x86_64.yml | 2 +- .github/workflows/wheel_macos_arm64.yml | 2 +- .github/workflows/wheel_macos_x86_64.yml | 2 +- .github/workflows/wheel_noarch.yml | 2 +- .github/workflows/wheel_win_x86_64.yml | 2 +- 14 files changed, 597 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/tests_linux_x86_mpich.yml create mode 100644 .github/workflows/tests_linux_x86_openmpi.yml 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 f82d2813fa..859cb6f9aa 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_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml new file mode 100644 index 0000000000..8ecd49d06b --- /dev/null +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -0,0 +1,306 @@ +name: Tests::Linux::x86_64_MPICH +on: + workflow_call: + inputs: + lightning-gpu-version: + type: string + required: true + description: The version of lightning to use. Valid values are either 'stable' (most recent git-tag) or 'latest' (most recent commit from master) + pennylane-version: + 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) + release: + push: + branches: + - main + pull_request: + +env: + COVERAGE_FLAGS: "--cov=pennylane_lightning_gpu --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native" + GCC_VERSION: 11 + OMP_NUM_THREADS: "2" + CI_CUDA_ARCH: 86 + +concurrency: + group: gpu-test-mpich-${{ github.ref }}-${{ inputs.lightning-gpu-version }}-${{ inputs.pennylane-version }} + cancel-in-progress: true + +jobs: + cpp_mpich_tests: + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + + runs-on: + - self-hosted + - linux + - x64 + - ubuntu-22.04 + - multi-gpu + + strategy: + max-parallel: 1 + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + # Checkout entire git-history if workflow_call passes 'stable' as we need to find the most recent git-tag + fetch-depth: ${{ inputs.lightning-gpu-version == 'stable' && 0 || 1 }} + + - name: Switch to stable build of Lightning-GPU + if: inputs.lightning-gpu-version == 'stable' + run: git checkout $(git tag | sort -V | tail -1) + + - uses: actions/setup-python@v4 + id: setup_python + name: Install Python + with: + python-version: '3.9' + + # Since the self-hosted runner can be re-used. It is best to set up all package + # installations in a virtual environment that gets cleaned at the end of each workflow run + - name: Setup Python virtual environment + id: setup_venv + env: + VENV_NAME: ${{ github.workspace }}/venv_${{ steps.setup_python.outputs.python-version }}_${{ github.sha }} + run: | + # Clear any pre-existing venvs + rm -rf venv_* + + # Create new venv for this workflow_run + python --version + python -m venv ${{ env.VENV_NAME }} + + # Add the venv to PATH for subsequent steps + echo ${{ env.VENV_NAME }}/bin >> $GITHUB_PATH + + # Adding venv name as an output for subsequent steps to reference if needed + echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT + + - name: Display Python-Path + id: python_path + run: | + py_path=$(which python) + echo "Python Interpreter Path => $py_path" + echo "python=$py_path" >> $GITHUB_OUTPUT + + pip_path=$(which python) + echo "PIP Path => $pip_path" + echo "pip=$pip_path" >> $GITHUB_OUTPUT + + - name: Install required packages + run: | + python -m pip install ninja cmake custatevec-cu11 + + - name: Validate GPU version and installed compiler + run: | + source /etc/profile.d/modules.sh + module use /opt/modules + module load cuda/11.8 + which -a nvcc + nvcc --version + + - name: Validate Multi-GPU packages + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + run: | + source /etc/profile.d/modules.sh + + module use /opt/modules/ + + echo 'Checking for OpenMPI' + module load openmpi + mpirun --version + which mpicc + which mpirun + module unload openmpi + + echo 'Checking for MPICH' + module load mpich + mpiexec --version + which mpicc + which mpiexec + module unload mpich + + - name: Install Latest PennyLane + if: inputs.pennylane-version == 'latest' + run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master + + - name: Build and run unit tests with MPICH backend + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load mpich + module unload mpich + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + cmake . -BBuild \ + -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ + -DPLLGPU_ENABLE_MPI=On \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DPLLGPU_BUILD_TESTS=ON \ + -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ + -DLIGHTNING_RELEASE_TAG="master" \ + -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ + -DCMAKE_CUDA_ARCHITECTURES="86" \ + -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ + -G Ninja + cmake --build ./Build + cd ./Build + mkdir -p ./tests/results + /opt/mpi/mpich/bin/mpirun -np 2 ./pennylane_lightning_gpu/src/tests/mpi_runner --order lex --reporter junit --out ./tests/results/report_${{ github.job }}.xml + + - name: Upload test results + uses: actions/upload-artifact@v3 + if: always() + with: + name: ubuntu-tests-reports + path: ./Build/tests/results/report_${{ github.job }}.xml + + - name: Build and run unit tests for code coverage for MPICH backend + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load mpich + module unload mpich + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + cmake . -BBuildCov \ + -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ + -DPLLGPU_ENABLE_MPI=On \ + -DCMAKE_BUILD_TYPE=Debug \ + -DPLLGPU_BUILD_TESTS=ON \ + -DPLLGPU_ENABLE_COVERAGE=ON \ + -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ + -DLIGHTNING_RELEASE_TAG="master" \ + -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ + -DCMAKE_CUDA_ARCHITECTURES="86" \ + -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ + -G Ninja + cmake --build ./BuildCov + cd ./BuildCov + /opt/mpi/mpich/bin/mpirun -np 2 ./pennylane_lightning_gpu/src/tests/mpi_runner + lcov --directory . -b ../pennylane_lightning_gpu/src --capture --output-file coverage.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info + mv coverage.info coverage-${{ github.job }}.info + + - name: Upload code coverage results for MPICH backend + uses: actions/upload-artifact@v3 + with: + name: ubuntu-codecov-results-cpp + path: ./BuildCov/coverage-${{ github.job }}.info + + - name: Cleanup + if: always() + run: | + rm -rf ${{ steps.setup_venv.outputs.venv_name }} + rm -rf * + rm -rf .git + rm -rf .gitignore + rm -rf .github + pip cache purge + + + python_mpich_tests: + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + + runs-on: + - self-hosted + - linux + - x64 + - ubuntu-22.04 + - multi-gpu + + strategy: + max-parallel: 1 + + steps: + - name: Checkout pennyLane-lightning-gpu + uses: actions/checkout@v3 + with: + # Checkout entire git-history if workflow_call passes 'stable' as we need to find the most recent git-tag + fetch-depth: ${{ inputs.lightning-gpu-version == 'stable' && 0 || 1 }} + + - name: Switch to stable build of Lightning-GPU + if: inputs.lightning-gpu-version == 'stable' + run: git checkout $(git tag | sort -V | tail -1) + + - uses: actions/setup-python@v4 + id: setup_python + name: Install Python + with: + python-version: '3.9' + + # Since the self-hosted runner can be re-used. It is best to set up all package + # installations in a virtual environment that gets cleaned at the end of each workflow run + - name: Setup Python virtual environment + id: setup_venv + env: + VENV_NAME: ${{ github.workspace }}/venv_${{ steps.setup_python.outputs.python-version }}_${{ github.sha }} + run: | + # Clear any pre-existing venvs + rm -rf venv_* + + # Create new venv for this workflow_run + python --version + python -m venv ${{ env.VENV_NAME }} + + # Add the venv to PATH for subsequent steps + echo ${{ env.VENV_NAME }}/bin >> $GITHUB_PATH + + # Adding venv name as an output for subsequent steps to reference if needed + source ${{ env.VENV_NAME }}/bin/activate + echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT + + - name: Display Python-Path + id: python_path + run: | + py_path=$(which python) + echo "Python Interpreter Path => $py_path" + echo "python=$py_path" >> $GITHUB_OUTPUT + + pip_path=$(which python) + echo "PIP Path => $pip_path" + echo "pip=$pip_path" >> $GITHUB_OUTPUT + + - name: Install Latest PennyLane + # We want to install the latest PL on non workflow_call events + if: inputs.pennylane-version == 'latest' || inputs.pennylane-version == '' + run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master + + - name: Install required packages (MPICH backend) + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load mpich + module unload mpich + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + python -m pip install pip~=22.0 + python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py + # Sync with latest master branches + python -m pip install git+https://github.com/PennyLaneAI/pennylane-lightning.git@master --force-reinstall --no-deps + + - name: Build and install package (MPICH backend) + env: + CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + run: | + python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;PLLGPU_ENABLE_MPI=On;LIGHTNING_RELEASE_TAG=master;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" + python -m pip install -e . --verbose + + - name: Run PennyLane-Lightning-GPU unit tests (MPICH backend) + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load mpich + /opt/mpi/mpich/bin/mpirun -np 2 python -m pytest ./mpitests/ + python -m pytest ./tests/ + + - name: Cleanup + if: always() + run: | + rm -rf ${{ steps.setup_venv.outputs.venv_name }} + rm -rf * + rm -rf .git + rm -rf .gitignore + rm -rf .github + pip cache purge diff --git a/.github/workflows/tests_linux_x86_openmpi.yml b/.github/workflows/tests_linux_x86_openmpi.yml new file mode 100644 index 0000000000..3af6988644 --- /dev/null +++ b/.github/workflows/tests_linux_x86_openmpi.yml @@ -0,0 +1,279 @@ +name: Tests::Linux::x86_64_OPENMPI +on: + release: + push: + branches: + - main + #pull_request: + +env: + COVERAGE_FLAGS: "--cov=pennylane_lightning_gpu --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native" + GCC_VERSION: 11 + OMP_NUM_THREADS: "2" + CI_CUDA_ARCH: 86 + +concurrency: + group: gpu-test-openmpi-${{ github.ref }}-${{ inputs.lightning-gpu-version }}-${{ inputs.pennylane-version }} + cancel-in-progress: true + +jobs: + cpp_openmpi_tests: + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + + runs-on: + - self-hosted + - linux + - x64 + - ubuntu-22.04 + - multi-gpu + + strategy: + max-parallel: 1 + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + id: setup_python + name: Install Python + with: + python-version: '3.9' + + # Since the self-hosted runner can be re-used. It is best to set up all package + # installations in a virtual environment that gets cleaned at the end of each workflow run + - name: Setup Python virtual environment + id: setup_venv + env: + VENV_NAME: ${{ github.workspace }}/venv_${{ steps.setup_python.outputs.python-version }}_${{ github.sha }} + run: | + # Clear any pre-existing venvs + rm -rf venv_* + + # Create new venv for this workflow_run + python --version + python -m venv ${{ env.VENV_NAME }} + + # Add the venv to PATH for subsequent steps + echo ${{ env.VENV_NAME }}/bin >> $GITHUB_PATH + + # Adding venv name as an output for subsequent steps to reference if needed + echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT + + - name: Display Python-Path + id: python_path + run: | + py_path=$(which python) + echo "Python Interpreter Path => $py_path" + echo "python=$py_path" >> $GITHUB_OUTPUT + + pip_path=$(which python) + echo "PIP Path => $pip_path" + echo "pip=$pip_path" >> $GITHUB_OUTPUT + + - name: Install required packages + run: | + python -m pip install ninja cmake custatevec-cu11 + + - name: Validate GPU version and installed compiler + run: | + source /etc/profile.d/modules.sh + module use /opt/modules + module load cuda/11.8 + nvidia-smi + which -a nvcc + nvcc --version + + - name: Validate Multi-GPU packages + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + run: | + source /etc/profile.d/modules.sh + + module use /opt/modules/ + + echo 'Checking for OpenMPI' + module load openmpi + mpirun --version + which mpicc + which mpirun + module unload openmpi + + echo 'Checking for MPICH' + module load mpich + mpiexec --version + which mpicc + which mpiexec + module unload mpich + + - name: Build and run unit tests with OpenMPI backend + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load openmpi + module unload openmpi + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/openmpi/include:/opt/mpi/openmpi/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/openmpi/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + cmake . -BBuild \ + -DCMAKE_PREFIX_PATH=/opt/mpi/openmpi/ \ + -DPLLGPU_ENABLE_MPI=On \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DPLLGPU_BUILD_TESTS=ON \ + -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ + -DLIGHTNING_RELEASE_TAG="master" \ + -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ + -DCMAKE_CUDA_ARCHITECTURES="86" \ + -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ + -G Ninja + cmake --build ./Build + cd ./Build + mkdir -p ./tests/results + /opt/mpi/openmpi/bin/mpirun -np 2 ./pennylane_lightning_gpu/src/tests/mpi_runner --order lex --reporter junit --out ./tests/results/report_${{ github.job }}.xml + + - name: Upload test results + uses: actions/upload-artifact@v3 + if: always() + with: + name: ubuntu-tests-reports + path: ./Build/tests/results/report_${{ github.job }}.xml + + - name: Build and run unit tests for code coverage for OpenMPI backend + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load openmpi + module unload openmpi + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/openmpi/include:/opt/mpi/openmpi/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/openmpi/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + cmake . -BBuildCov \ + -DCMAKE_PREFIX_PATH=/opt/mpi/openmpi/ \ + -DPLLGPU_ENABLE_MPI=On \ + -DCMAKE_BUILD_TYPE=Debug \ + -DPLLGPU_BUILD_TESTS=ON \ + -DPLLGPU_ENABLE_COVERAGE=ON \ + -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ + -DLIGHTNING_RELEASE_TAG="master" \ + -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ + -DCMAKE_CUDA_ARCHITECTURES="86" \ + -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ + -G Ninja + cmake --build ./BuildCov + cd ./BuildCov + /opt/mpi/openmpi/bin/mpirun -np 2 ./pennylane_lightning_gpu/src/tests/mpi_runner + lcov --directory . -b ../pennylane_lightning_gpu/src --capture --output-file coverage.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info + mv coverage.info coverage-${{ github.job }}.info + + - name: Upload code coverage results for OpenMPI backend + uses: actions/upload-artifact@v3 + with: + name: ubuntu-codecov-results-cpp + path: ./BuildCov/coverage-${{ github.job }}.info + + - name: Cleanup + if: always() + run: | + rm -rf ${{ steps.setup_venv.outputs.venv_name }} + rm -rf * + rm -rf .git + rm -rf .gitignore + rm -rf .github + pip cache purge + + + python_openmpi_tests: + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + + runs-on: + - self-hosted + - linux + - x64 + - ubuntu-22.04 + - multi-gpu + + strategy: + max-parallel: 1 + + steps: + - name: Checkout pennyLane-lightning-gpu + uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + id: setup_python + name: Install Python + with: + python-version: '3.9' + + # Since the self-hosted runner can be re-used. It is best to set up all package + # installations in a virtual environment that gets cleaned at the end of each workflow run + - name: Setup Python virtual environment + id: setup_venv + env: + VENV_NAME: ${{ github.workspace }}/venv_${{ steps.setup_python.outputs.python-version }}_${{ github.sha }} + run: | + # Clear any pre-existing venvs + rm -rf venv_* + + # Create new venv for this workflow_run + python --version + python -m venv ${{ env.VENV_NAME }} + + # Add the venv to PATH for subsequent steps + echo ${{ env.VENV_NAME }}/bin >> $GITHUB_PATH + + # Adding venv name as an output for subsequent steps to reference if needed + source ${{ env.VENV_NAME }}/bin/activate + echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT + + - name: Display Python-Path + id: python_path + run: | + py_path=$(which python) + echo "Python Interpreter Path => $py_path" + echo "python=$py_path" >> $GITHUB_OUTPUT + + pip_path=$(which python) + echo "PIP Path => $pip_path" + echo "pip=$pip_path" >> $GITHUB_OUTPUT + + - name: Install Latest PennyLane + # We want to install the latest PL on non workflow_call events + if: inputs.pennylane-version == 'latest' || inputs.pennylane-version == '' + run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master + + - name: Install required packages (OpenMPI backend) + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load openmpi + module unload openmpi + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/openmpi/include:/opt/mpi/openmpi/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/openmpi/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + python -m pip install pip~=22.0 + python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py + # Sync with latest master branches + python -m pip install git+https://github.com/PennyLaneAI/pennylane-lightning.git@master --force-reinstall --no-deps + + - name: Build and install package (OpenMPI backend) + env: + CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + run: | + python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/openmpi;PLLGPU_ENABLE_MPI=On;LIGHTNING_RELEASE_TAG=master;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" + python -m pip install -e . --verbose + + - name: Run PennyLane-Lightning-GPU unit tests (OpenMPI backend) + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load openmpi + /opt/mpi/openmpi/bin/mpirun -np 2 python -m pytest ./mpitests/ + python -m pytest ./tests/ + + - name: Cleanup + if: always() + run: | + rm -rf ${{ steps.setup_venv.outputs.venv_name }} + rm -rf * + rm -rf .git + rm -rf .gitignore + rm -rf .github + pip cache purge 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_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 From 17e05575fbc05bb301a1c612c09adf46a8d2254a Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 13 Oct 2023 15:24:56 -0400 Subject: [PATCH 02/44] Remove label guards --- .github/workflows/tests_linux_x86_mpich.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 8ecd49d06b..84a11dd3ba 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -28,7 +28,7 @@ concurrency: jobs: cpp_mpich_tests: - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') runs-on: - self-hosted @@ -101,7 +101,7 @@ jobs: nvcc --version - name: Validate Multi-GPU packages - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') run: | source /etc/profile.d/modules.sh @@ -201,7 +201,7 @@ jobs: python_mpich_tests: - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') runs-on: - self-hosted From fe2270dbcfb71952358f41ff92f648fee4ed5191 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 13 Oct 2023 15:41:47 -0400 Subject: [PATCH 03/44] Fix PL_DEVICE --- .github/workflows/tests_linux_x86_mpich.yml | 45 +++++++++++---------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 84a11dd3ba..61ed83684b 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -17,7 +17,7 @@ on: pull_request: env: - COVERAGE_FLAGS: "--cov=pennylane_lightning_gpu --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native" + COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native" GCC_VERSION: 11 OMP_NUM_THREADS: "2" CI_CUDA_ARCH: 86 @@ -28,7 +28,7 @@ concurrency: jobs: cpp_mpich_tests: - # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') runs-on: - self-hosted @@ -44,8 +44,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: - # Checkout entire git-history if workflow_call passes 'stable' as we need to find the most recent git-tag - fetch-depth: ${{ inputs.lightning-gpu-version == 'stable' && 0 || 1 }} + fetch-tags: true - name: Switch to stable build of Lightning-GPU if: inputs.lightning-gpu-version == 'stable' @@ -131,15 +130,15 @@ jobs: module use /opt/modules/ module load mpich module unload mpich + export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK cmake . -BBuild \ -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ - -DPLLGPU_ENABLE_MPI=On \ + -DPLLGPU_ENABLE_MPI=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DPLLGPU_BUILD_TESTS=ON \ -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ - -DLIGHTNING_RELEASE_TAG="master" \ -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ -DCMAKE_CUDA_ARCHITECTURES="86" \ -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ @@ -147,7 +146,7 @@ jobs: cmake --build ./Build cd ./Build mkdir -p ./tests/results - /opt/mpi/mpich/bin/mpirun -np 2 ./pennylane_lightning_gpu/src/tests/mpi_runner --order lex --reporter junit --out ./tests/results/report_${{ github.job }}.xml + /opt/mpi/mpich/bin/mpirun -np 2 ./pennylane_lightning/src/tests/mpi_runner --order lex --reporter junit --out ./tests/results/report_${{ github.job }}.xml - name: Upload test results uses: actions/upload-artifact@v3 @@ -162,24 +161,24 @@ jobs: module use /opt/modules/ module load mpich module unload mpich + export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK cmake . -BBuildCov \ -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ - -DPLLGPU_ENABLE_MPI=On \ + -DPLLGPU_ENABLE_MPI=ON \ -DCMAKE_BUILD_TYPE=Debug \ -DPLLGPU_BUILD_TESTS=ON \ -DPLLGPU_ENABLE_COVERAGE=ON \ -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ - -DLIGHTNING_RELEASE_TAG="master" \ -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ -DCMAKE_CUDA_ARCHITECTURES="86" \ -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ -G Ninja cmake --build ./BuildCov cd ./BuildCov - /opt/mpi/mpich/bin/mpirun -np 2 ./pennylane_lightning_gpu/src/tests/mpi_runner - lcov --directory . -b ../pennylane_lightning_gpu/src --capture --output-file coverage.info + /opt/mpi/mpich/bin/mpirun -np 2 ./pennylane_lightning/src/tests/mpi_runner + lcov --directory . -b ../pennylane_lightning/src --capture --output-file coverage.info lcov --remove coverage.info '/usr/*' --output-file coverage.info mv coverage.info coverage-${{ github.job }}.info @@ -217,12 +216,13 @@ jobs: - name: Checkout pennyLane-lightning-gpu uses: actions/checkout@v3 with: - # Checkout entire git-history if workflow_call passes 'stable' as we need to find the most recent git-tag - fetch-depth: ${{ inputs.lightning-gpu-version == 'stable' && 0 || 1 }} + fetch-tags: true - name: Switch to stable build of Lightning-GPU if: inputs.lightning-gpu-version == 'stable' - run: git checkout $(git tag | sort -V | tail -1) + run: | + git fetch tags --force + git checkout $(git tag | sort -V | tail -1) - uses: actions/setup-python@v4 id: setup_python @@ -273,27 +273,28 @@ jobs: module use /opt/modules/ module load mpich module unload mpich + export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK python -m pip install pip~=22.0 python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py # Sync with latest master branches - python -m pip install git+https://github.com/PennyLaneAI/pennylane-lightning.git@master --force-reinstall --no-deps + # python -m pip install git+https://github.com/PennyLaneAI/pennylane-lightning.git@master --force-reinstall --no-deps - name: Build and install package (MPICH backend) env: CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") run: | - python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;PLLGPU_ENABLE_MPI=On;LIGHTNING_RELEASE_TAG=master;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" - python -m pip install -e . --verbose + PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;PLLGPU_ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" + PL_BACKEND=lightning_gpu python -m pip install -e . --verbose - name: Run PennyLane-Lightning-GPU unit tests (MPICH backend) run: | source /etc/profile.d/modules.sh module use /opt/modules/ module load mpich - /opt/mpi/mpich/bin/mpirun -np 2 python -m pytest ./mpitests/ - python -m pytest ./tests/ + PL_DEVICE=lightning.gpu /opt/mpi/mpich/bin/mpirun -np 2 python -m pytest ./mpitests/ + PL_DEVICE=lightning.gpu python -m pytest ./tests/ - name: Cleanup if: always() From b5859432f0debc21f8f7d213af756d0a14ff9a71 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 13 Oct 2023 15:47:17 -0400 Subject: [PATCH 04/44] Install lightning_qubit. --- .github/workflows/tests_linux_x86_mpich.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 61ed83684b..3f49a6f45b 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -285,6 +285,7 @@ jobs: env: CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") run: | + SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;PLLGPU_ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" PL_BACKEND=lightning_gpu python -m pip install -e . --verbose From 1ed0a4a4b8a08927dd6b6fdafe3b0e853c5ac27e Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 13 Oct 2023 15:49:53 -0400 Subject: [PATCH 05/44] Fix ENABLE_MPI --- .github/workflows/tests_linux_x86_mpich.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 3f49a6f45b..62e3852a2d 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -286,7 +286,7 @@ jobs: CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") run: | SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv - PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;PLLGPU_ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" + PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }}" PL_BACKEND=lightning_gpu python -m pip install -e . --verbose - name: Run PennyLane-Lightning-GPU unit tests (MPICH backend) From eb6983aec501efdf4cbecc03d8ffdce45f284a31 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 13 Oct 2023 15:55:27 -0400 Subject: [PATCH 06/44] print cuquantum --- .github/workflows/tests_linux_x86_mpich.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 62e3852a2d..533ac5336f 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -285,6 +285,7 @@ jobs: env: CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") run: | + echo CUQUANTUM_SDK=$CUQUANTUM_SDK SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }}" PL_BACKEND=lightning_gpu python -m pip install -e . --verbose From 1502d0ceeecea92122fe1df8a94ea1efedfab0ba Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 13 Oct 2023 16:01:47 -0400 Subject: [PATCH 07/44] export cu_sdk --- .github/workflows/tests_linux_x86_mpich.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 533ac5336f..d8ed12eea1 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -282,9 +282,8 @@ jobs: # python -m pip install git+https://github.com/PennyLaneAI/pennylane-lightning.git@master --force-reinstall --no-deps - name: Build and install package (MPICH backend) - env: - CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") run: | + export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") echo CUQUANTUM_SDK=$CUQUANTUM_SDK SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }}" From 804ed24d0f0fe5302b42b567dd02e6ab443e6b08 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 13 Oct 2023 16:06:43 -0400 Subject: [PATCH 08/44] revert define --- .github/workflows/tests_linux_x86_mpich.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index d8ed12eea1..dbdeb7a6b6 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -282,11 +282,11 @@ jobs: # python -m pip install git+https://github.com/PennyLaneAI/pennylane-lightning.git@master --force-reinstall --no-deps - name: Build and install package (MPICH backend) + env: + CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") run: | - export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - echo CUQUANTUM_SDK=$CUQUANTUM_SDK SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv - PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }}" + PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" PL_BACKEND=lightning_gpu python -m pip install -e . --verbose - name: Run PennyLane-Lightning-GPU unit tests (MPICH backend) From 86fca0982f18582ff97324c26a822e600d4460a9 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 13 Oct 2023 16:41:32 -0400 Subject: [PATCH 09/44] Debug cpp tests. --- .github/workflows/tests_linux_x86_mpich.yml | 63 +++++++++++---------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index dbdeb7a6b6..836d3ec564 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -17,7 +17,7 @@ on: pull_request: env: - COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native" + COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native" GCC_VERSION: 11 OMP_NUM_THREADS: "2" CI_CUDA_ARCH: 86 @@ -48,7 +48,9 @@ jobs: - name: Switch to stable build of Lightning-GPU if: inputs.lightning-gpu-version == 'stable' - run: git checkout $(git tag | sort -V | tail -1) + run: | + git fetch tags --force + git checkout $(git tag | sort -V | tail -1) - uses: actions/setup-python@v4 id: setup_python @@ -82,14 +84,14 @@ jobs: py_path=$(which python) echo "Python Interpreter Path => $py_path" echo "python=$py_path" >> $GITHUB_OUTPUT - + pip_path=$(which python) echo "PIP Path => $pip_path" echo "pip=$pip_path" >> $GITHUB_OUTPUT - name: Install required packages run: | - python -m pip install ninja cmake custatevec-cu11 + python -m pip install ninja cmake custatevec-cu11 - name: Validate GPU version and installed compiler run: | @@ -100,7 +102,6 @@ jobs: nvcc --version - name: Validate Multi-GPU packages - # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') run: | source /etc/profile.d/modules.sh @@ -109,15 +110,15 @@ jobs: echo 'Checking for OpenMPI' module load openmpi mpirun --version - which mpicc - which mpirun + which -a mpicc + which -a mpirun module unload openmpi echo 'Checking for MPICH' module load mpich mpiexec --version - which mpicc - which mpiexec + which -a mpicc + which -a mpiexec module unload mpich - name: Install Latest PennyLane @@ -135,7 +136,7 @@ jobs: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK cmake . -BBuild \ -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ - -DPLLGPU_ENABLE_MPI=ON \ + -DENABLE_MPI=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DPLLGPU_BUILD_TESTS=ON \ -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ @@ -146,14 +147,16 @@ jobs: cmake --build ./Build cd ./Build mkdir -p ./tests/results - /opt/mpi/mpich/bin/mpirun -np 2 ./pennylane_lightning/src/tests/mpi_runner --order lex --reporter junit --out ./tests/results/report_${{ github.job }}.xml + ls -la ./pennylane_lightning/src/tests + for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done; + for file in *runner_mpi ; do /opt/mpi/mpich/bin/mpirun -np 2 ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done; - name: Upload test results uses: actions/upload-artifact@v3 if: always() with: name: ubuntu-tests-reports - path: ./Build/tests/results/report_${{ github.job }}.xml + path: ./Build/tests/results/ - name: Build and run unit tests for code coverage for MPICH backend run: | @@ -162,11 +165,11 @@ jobs: module load mpich module unload mpich export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK cmake . -BBuildCov \ -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ - -DPLLGPU_ENABLE_MPI=ON \ + -DENABLE_MPI=ON \ -DCMAKE_BUILD_TYPE=Debug \ -DPLLGPU_BUILD_TESTS=ON \ -DPLLGPU_ENABLE_COVERAGE=ON \ @@ -177,16 +180,17 @@ jobs: -G Ninja cmake --build ./BuildCov cd ./BuildCov - /opt/mpi/mpich/bin/mpirun -np 2 ./pennylane_lightning/src/tests/mpi_runner + for file in *runner ; do ./$file; done; + for file in *runner_mpi ; do /opt/mpi/mpich/bin/mpirun -np 2 ./$file; done; lcov --directory . -b ../pennylane_lightning/src --capture --output-file coverage.info lcov --remove coverage.info '/usr/*' --output-file coverage.info - mv coverage.info coverage-${{ github.job }}.info + mv coverage.info coverage-${{ github.job }}-lightning_gpu.info - name: Upload code coverage results for MPICH backend uses: actions/upload-artifact@v3 with: name: ubuntu-codecov-results-cpp - path: ./BuildCov/coverage-${{ github.job }}.info + path: ./BuildCov/coverage-${{ github.job }}-lightning_gpu.info - name: Cleanup if: always() @@ -200,7 +204,7 @@ jobs: python_mpich_tests: - # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') runs-on: - self-hosted @@ -257,7 +261,7 @@ jobs: py_path=$(which python) echo "Python Interpreter Path => $py_path" echo "python=$py_path" >> $GITHUB_OUTPUT - + pip_path=$(which python) echo "PIP Path => $pip_path" echo "pip=$pip_path" >> $GITHUB_OUTPUT @@ -274,28 +278,29 @@ jobs: module load mpich module unload mpich export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK python -m pip install pip~=22.0 python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py - # Sync with latest master branches - # python -m pip install git+https://github.com/PennyLaneAI/pennylane-lightning.git@master --force-reinstall --no-deps - + SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv + - name: Build and install package (MPICH backend) - env: + env: CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + PL_BACKEND: lightning_gpu run: | - SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv - PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" - PL_BACKEND=lightning_gpu python -m pip install -e . --verbose + python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" + python -m pip install -e . --verbose - name: Run PennyLane-Lightning-GPU unit tests (MPICH backend) + env: + PL_DEVICE: lightning.gpu run: | source /etc/profile.d/modules.sh module use /opt/modules/ module load mpich - PL_DEVICE=lightning.gpu /opt/mpi/mpich/bin/mpirun -np 2 python -m pytest ./mpitests/ - PL_DEVICE=lightning.gpu python -m pytest ./tests/ + /opt/mpi/mpich/bin/mpirun -np 2 python -m pytest ./mpitests/ + python -m pytest ./tests/ - name: Cleanup if: always() From d0a9a7985563f6da16bdf8498607664da3b55320 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 13 Oct 2023 16:42:12 -0400 Subject: [PATCH 10/44] Debug cpp tests. --- .github/workflows/tests_linux_x86_mpich.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 836d3ec564..e8840133dd 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -28,7 +28,7 @@ concurrency: jobs: cpp_mpich_tests: - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') runs-on: - self-hosted From 5cf7870d7914d6b9b69870bf90f5e243f219f945 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 13 Oct 2023 16:52:05 -0400 Subject: [PATCH 11/44] Fix cmake options. --- .github/workflows/tests_linux_x86_mpich.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index e8840133dd..7c86504a81 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -2,7 +2,7 @@ name: Tests::Linux::x86_64_MPICH on: workflow_call: inputs: - lightning-gpu-version: + lightning-version: type: string required: true description: The version of lightning to use. Valid values are either 'stable' (most recent git-tag) or 'latest' (most recent commit from master) @@ -23,12 +23,12 @@ env: CI_CUDA_ARCH: 86 concurrency: - group: gpu-test-mpich-${{ github.ref }}-${{ inputs.lightning-gpu-version }}-${{ inputs.pennylane-version }} + group: gpu-test-mpich-${{ github.ref }}-${{ inputs.lightning-version }}-${{ inputs.pennylane-version }} cancel-in-progress: true jobs: cpp_mpich_tests: - # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') runs-on: - self-hosted @@ -47,7 +47,7 @@ jobs: fetch-tags: true - name: Switch to stable build of Lightning-GPU - if: inputs.lightning-gpu-version == 'stable' + if: inputs.lightning-version == 'stable' run: | git fetch tags --force git checkout $(git tag | sort -V | tail -1) @@ -138,7 +138,7 @@ jobs: -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ -DENABLE_MPI=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DPLLGPU_BUILD_TESTS=ON \ + -DBUILD_TESTS=ON \ -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ -DCMAKE_CUDA_ARCHITECTURES="86" \ @@ -171,8 +171,8 @@ jobs: -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ -DENABLE_MPI=ON \ -DCMAKE_BUILD_TYPE=Debug \ - -DPLLGPU_BUILD_TESTS=ON \ - -DPLLGPU_ENABLE_COVERAGE=ON \ + -DBUILD_TESTS=ON \ + -DENABLE_COVERAGE=ON \ -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ -DCMAKE_CUDA_ARCHITECTURES="86" \ @@ -204,7 +204,7 @@ jobs: python_mpich_tests: - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') runs-on: - self-hosted @@ -223,7 +223,7 @@ jobs: fetch-tags: true - name: Switch to stable build of Lightning-GPU - if: inputs.lightning-gpu-version == 'stable' + if: inputs.lightning-version == 'stable' run: | git fetch tags --force git checkout $(git tag | sort -V | tail -1) From 9e151de5551e0cc8af1dbcf123827c22864e35e8 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 09:06:32 -0400 Subject: [PATCH 12/44] Compile with mpicxx --- .github/workflows/tests_linux_x86_mpich.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 7c86504a81..b34cb85048 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -139,7 +139,7 @@ jobs: -DENABLE_MPI=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DBUILD_TESTS=ON \ - -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ + -DCMAKE_CXX_COMPILER=mpicxx \ -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ -DCMAKE_CUDA_ARCHITECTURES="86" \ -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ From 2969555bbfcb1de80d2132151a2e04e57befcc5b Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 09:24:29 -0400 Subject: [PATCH 13/44] Specify backend. --- .github/workflows/tests_linux_x86_mpich.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index b34cb85048..ab7377f86c 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -126,12 +126,14 @@ jobs: run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master - name: Build and run unit tests with MPICH backend + env: + CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + PL_BACKEND: lightning_gpu run: | source /etc/profile.d/modules.sh module use /opt/modules/ module load mpich module unload mpich - export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK cmake . -BBuild \ From e4e24b03ae89a55d7ff81d96e322634ff323dccd Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 10:03:43 -0400 Subject: [PATCH 14/44] Specify backend. --- .github/workflows/tests_linux_x86_mpich.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index ab7377f86c..5d0b01700a 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -126,17 +126,16 @@ jobs: run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master - name: Build and run unit tests with MPICH backend - env: - CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - PL_BACKEND: lightning_gpu run: | source /etc/profile.d/modules.sh module use /opt/modules/ module load mpich module unload mpich + export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK cmake . -BBuild \ + -DPL_BACKEND=lightning_gpu \ -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ -DENABLE_MPI=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ From ab083971799baa66fe019df5d3fcebd00892cda6 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 10:19:09 -0400 Subject: [PATCH 15/44] Remove obsolete line. --- .github/workflows/tests_linux_x86_mpich.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 5d0b01700a..7dc353263e 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -148,7 +148,6 @@ jobs: cmake --build ./Build cd ./Build mkdir -p ./tests/results - ls -la ./pennylane_lightning/src/tests for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done; for file in *runner_mpi ; do /opt/mpi/mpich/bin/mpirun -np 2 ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done; From 1463b89fcd0d4d6a8275dba516ce5681061b0f78 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 10:37:54 -0400 Subject: [PATCH 16/44] Specify cov backend --- .github/workflows/tests_linux_x86_mpich.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 7dc353263e..c7ef4a38fb 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -168,6 +168,7 @@ jobs: export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK cmake . -BBuildCov \ + -DPL_BACKEND=lightning_gpu \ -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ -DENABLE_MPI=ON \ -DCMAKE_BUILD_TYPE=Debug \ From 4ef07c419f014f677c9b30bae56d96b2e5bf1add Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 11:04:25 -0400 Subject: [PATCH 17/44] Merge test/cov & try simplifying python --- .github/workflows/tests_linux_x86_mpich.yml | 42 ++++----------------- 1 file changed, 7 insertions(+), 35 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index c7ef4a38fb..ec0432f781 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -138,7 +138,8 @@ jobs: -DPL_BACKEND=lightning_gpu \ -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ -DENABLE_MPI=ON \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_BUILD_TYPE=Debug \ + -DENABLE_COVERAGE=ON \ -DBUILD_TESTS=ON \ -DCMAKE_CXX_COMPILER=mpicxx \ -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ @@ -150,6 +151,9 @@ jobs: mkdir -p ./tests/results for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done; for file in *runner_mpi ; do /opt/mpi/mpich/bin/mpirun -np 2 ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done; + lcov --directory . -b ../pennylane_lightning/src --capture --output-file coverage.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info + mv coverage.info coverage-${{ github.job }}-lightning_gpu.info - name: Upload test results uses: actions/upload-artifact@v3 @@ -158,35 +162,6 @@ jobs: name: ubuntu-tests-reports path: ./Build/tests/results/ - - name: Build and run unit tests for code coverage for MPICH backend - run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load mpich - module unload mpich - export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK - cmake . -BBuildCov \ - -DPL_BACKEND=lightning_gpu \ - -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ - -DENABLE_MPI=ON \ - -DCMAKE_BUILD_TYPE=Debug \ - -DBUILD_TESTS=ON \ - -DENABLE_COVERAGE=ON \ - -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ - -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ - -DCMAKE_CUDA_ARCHITECTURES="86" \ - -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ - -G Ninja - cmake --build ./BuildCov - cd ./BuildCov - for file in *runner ; do ./$file; done; - for file in *runner_mpi ; do /opt/mpi/mpich/bin/mpirun -np 2 ./$file; done; - lcov --directory . -b ../pennylane_lightning/src --capture --output-file coverage.info - lcov --remove coverage.info '/usr/*' --output-file coverage.info - mv coverage.info coverage-${{ github.job }}-lightning_gpu.info - - name: Upload code coverage results for MPICH backend uses: actions/upload-artifact@v3 with: @@ -205,7 +180,7 @@ jobs: python_mpich_tests: - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') + # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') runs-on: - self-hosted @@ -286,11 +261,8 @@ jobs: SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv - name: Build and install package (MPICH backend) - env: - CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - PL_BACKEND: lightning_gpu run: | - python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" + python setup.py build_ext -i --define="PL_BACKEND=lightning_gpu;CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" python -m pip install -e . --verbose - name: Run PennyLane-Lightning-GPU unit tests (MPICH backend) From f0c90c6cb956644a832d5c33036b4fb8df1eda85 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 12:10:20 -0400 Subject: [PATCH 18/44] if-no-files-found: error and fix python tests. --- .github/workflows/tests_linux_x86_mpich.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index ec0432f781..bcce95b057 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -159,12 +159,14 @@ jobs: uses: actions/upload-artifact@v3 if: always() with: + if-no-files-found: error name: ubuntu-tests-reports path: ./Build/tests/results/ - name: Upload code coverage results for MPICH backend uses: actions/upload-artifact@v3 with: + if-no-files-found: error name: ubuntu-codecov-results-cpp path: ./BuildCov/coverage-${{ github.job }}-lightning_gpu.info @@ -253,15 +255,15 @@ jobs: module use /opt/modules/ module load mpich module unload mpich - export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK python -m pip install pip~=22.0 python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv - name: Build and install package (MPICH backend) run: | + export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK python setup.py build_ext -i --define="PL_BACKEND=lightning_gpu;CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" python -m pip install -e . --verbose From b5fcc1f77e2d8174553e20da1194752324ea35f3 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 12:12:48 -0400 Subject: [PATCH 19/44] Fix mpi find --- .github/workflows/tests_linux_x86_mpich.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index bcce95b057..a1761da898 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -255,15 +255,17 @@ jobs: module use /opt/modules/ module load mpich module unload mpich + export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK python -m pip install pip~=22.0 python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv - name: Build and install package (MPICH backend) + env: + CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") run: | - export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK python setup.py build_ext -i --define="PL_BACKEND=lightning_gpu;CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" python -m pip install -e . --verbose From 884aa75be5934bc80796b340345202746385b2bd Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 12:53:29 -0400 Subject: [PATCH 20/44] Install real lightning. --- .github/workflows/tests_linux_x86_mpich.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index a1761da898..4df24160d8 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -168,7 +168,7 @@ jobs: with: if-no-files-found: error name: ubuntu-codecov-results-cpp - path: ./BuildCov/coverage-${{ github.job }}-lightning_gpu.info + path: ./Build/coverage-${{ github.job }}-lightning_gpu.info - name: Cleanup if: always() @@ -260,7 +260,7 @@ jobs: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK python -m pip install pip~=22.0 python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py - SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv + PL_BACKEND=lightning_qubit python -m pip install -e . -vv - name: Build and install package (MPICH backend) env: From 911510745245827def51d2fa827c2a453105253d Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 13:15:55 -0400 Subject: [PATCH 21/44] Revert python tests. --- .github/workflows/tests_linux_x86_mpich.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 4df24160d8..25ca355cef 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -28,7 +28,7 @@ concurrency: jobs: cpp_mpich_tests: - # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') runs-on: - self-hosted @@ -260,13 +260,14 @@ jobs: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK python -m pip install pip~=22.0 python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py - PL_BACKEND=lightning_qubit python -m pip install -e . -vv + SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv - name: Build and install package (MPICH backend) env: CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + PL_BACKEND: lightning_gpu run: | - python setup.py build_ext -i --define="PL_BACKEND=lightning_gpu;CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" + python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" python -m pip install -e . --verbose - name: Run PennyLane-Lightning-GPU unit tests (MPICH backend) From 7636d80dcc3f8865b936cf278c62df50b0b5fbbd Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 13:32:34 -0400 Subject: [PATCH 22/44] Hardcode backend values in python tests --- .github/workflows/tests_linux_x86_mpich.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 25ca355cef..9c9d50ab17 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -265,20 +265,17 @@ jobs: - name: Build and install package (MPICH backend) env: CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - PL_BACKEND: lightning_gpu run: | - python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" - python -m pip install -e . --verbose + PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" + PL_BACKEND=lightning_gpu python -m pip install -e . --verbose - name: Run PennyLane-Lightning-GPU unit tests (MPICH backend) - env: - PL_DEVICE: lightning.gpu run: | source /etc/profile.d/modules.sh module use /opt/modules/ module load mpich - /opt/mpi/mpich/bin/mpirun -np 2 python -m pytest ./mpitests/ - python -m pytest ./tests/ + PL_DEVICE=lightning.gpu /opt/mpi/mpich/bin/mpirun -np 2 python -m pytest ./mpitests/ + PL_DEVICE=lightning.gpu python -m pytest ./tests/ - name: Cleanup if: always() From cd8c67b1c8c7dd422cdf2c0def0851b89dc01a80 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 13:51:53 -0400 Subject: [PATCH 23/44] Install lightning_qubit with gpu in python tests --- .github/workflows/tests_linux_x86_mpich.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 9c9d50ab17..606fd6c7ea 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -260,12 +260,12 @@ jobs: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK python -m pip install pip~=22.0 python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py - SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv - name: Build and install package (MPICH backend) env: CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") run: | + SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" PL_BACKEND=lightning_gpu python -m pip install -e . --verbose From 2327eb46433d93228eeaa64a0b0819a5e1ba15a8 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 13:59:20 -0400 Subject: [PATCH 24/44] Remove explicit mpich mentions. --- .github/workflows/tests_linux_x86_mpich.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 606fd6c7ea..42395004c8 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -1,4 +1,4 @@ -name: Tests::Linux::x86_64_MPICH +name: Tests::Linux::x86_64 on: workflow_call: inputs: @@ -27,8 +27,8 @@ concurrency: cancel-in-progress: true jobs: - cpp_mpich_tests: - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') + cpp_tests: + # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') runs-on: - self-hosted @@ -125,7 +125,7 @@ jobs: if: inputs.pennylane-version == 'latest' run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master - - name: Build and run unit tests with MPICH backend + - name: Build and run unit tests run: | source /etc/profile.d/modules.sh module use /opt/modules/ @@ -163,7 +163,7 @@ jobs: name: ubuntu-tests-reports path: ./Build/tests/results/ - - name: Upload code coverage results for MPICH backend + - name: Upload code coverage results uses: actions/upload-artifact@v3 with: if-no-files-found: error @@ -181,7 +181,7 @@ jobs: pip cache purge - python_mpich_tests: + python_tests: # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') runs-on: @@ -249,7 +249,7 @@ jobs: if: inputs.pennylane-version == 'latest' || inputs.pennylane-version == '' run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master - - name: Install required packages (MPICH backend) + - name: Install required packages run: | source /etc/profile.d/modules.sh module use /opt/modules/ @@ -260,16 +260,16 @@ jobs: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK python -m pip install pip~=22.0 python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py + SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv - - name: Build and install package (MPICH backend) + - name: Build and install package env: CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") run: | - SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" PL_BACKEND=lightning_gpu python -m pip install -e . --verbose - - name: Run PennyLane-Lightning-GPU unit tests (MPICH backend) + - name: Run PennyLane-Lightning-GPU unit tests run: | source /etc/profile.d/modules.sh module use /opt/modules/ From 0ed2beec0785320a98365c1965e619e7b4f08cc0 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 14:18:28 -0400 Subject: [PATCH 25/44] Parametrize mpilib name. --- .github/workflows/tests_linux_x86_mpich.yml | 30 +++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 42395004c8..4af3455523 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -23,7 +23,7 @@ env: CI_CUDA_ARCH: 86 concurrency: - group: gpu-test-mpich-${{ github.ref }}-${{ inputs.lightning-version }}-${{ inputs.pennylane-version }} + group: gpu-test-mpi-${{ github.ref }}-${{ inputs.lightning-version }}-${{ inputs.pennylane-version }} cancel-in-progress: true jobs: @@ -39,6 +39,8 @@ jobs: strategy: max-parallel: 1 + matrix: + mpilib: ["mpich"] steps: - name: Checkout @@ -129,14 +131,14 @@ jobs: run: | source /etc/profile.d/modules.sh module use /opt/modules/ - module load mpich - module unload mpich + module load ${{ matrix.mpilib }} + module unload ${{ matrix.mpilib }} export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/${{ matrix.mpilib }}/include:/opt/mpi/${{ matrix.mpilib }}/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/${{ matrix.mpilib }}/lib:$CUQUANTUM_SDK cmake . -BBuild \ -DPL_BACKEND=lightning_gpu \ - -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ + -DCMAKE_PREFIX_PATH=/opt/mpi/${{ matrix.mpilib }}/ \ -DENABLE_MPI=ON \ -DCMAKE_BUILD_TYPE=Debug \ -DENABLE_COVERAGE=ON \ @@ -150,7 +152,7 @@ jobs: cd ./Build mkdir -p ./tests/results for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done; - for file in *runner_mpi ; do /opt/mpi/mpich/bin/mpirun -np 2 ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done; + for file in *runner_mpi ; do /opt/mpi/${{ matrix.mpilib }}/bin/mpirun -np 2 ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done; lcov --directory . -b ../pennylane_lightning/src --capture --output-file coverage.info lcov --remove coverage.info '/usr/*' --output-file coverage.info mv coverage.info coverage-${{ github.job }}-lightning_gpu.info @@ -253,11 +255,11 @@ jobs: run: | source /etc/profile.d/modules.sh module use /opt/modules/ - module load mpich - module unload mpich + module load ${{ matrix.mpilib }} + module unload ${{ matrix.mpilib }} export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/${{ matrix.mpilib }}/include:/opt/mpi/${{ matrix.mpilib }}/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/${{ matrix.mpilib }}/lib:$CUQUANTUM_SDK python -m pip install pip~=22.0 python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv @@ -266,15 +268,15 @@ jobs: env: CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") run: | - PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" + PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=mpicxx;CMAKE_PREFIX_PATH=/opt/mpi/${{ matrix.mpilib }};ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" PL_BACKEND=lightning_gpu python -m pip install -e . --verbose - name: Run PennyLane-Lightning-GPU unit tests run: | source /etc/profile.d/modules.sh module use /opt/modules/ - module load mpich - PL_DEVICE=lightning.gpu /opt/mpi/mpich/bin/mpirun -np 2 python -m pytest ./mpitests/ + module load ${{ matrix.mpilib }} + PL_DEVICE=lightning.gpu /opt/mpi/${{ matrix.mpilib }}/bin/mpirun -np 2 python -m pytest ./mpitests/ PL_DEVICE=lightning.gpu python -m pytest ./tests/ - name: Cleanup From 42f9d2f38f092db2b44db05f85d5caa317a4b99d Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 14:36:58 -0400 Subject: [PATCH 26/44] Add openmpi tests. --- .github/workflows/tests_linux_x86_mpich.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 4af3455523..952347a8ec 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -40,7 +40,7 @@ jobs: strategy: max-parallel: 1 matrix: - mpilib: ["mpich"] + mpilib: ["mpich", "openmpi"] steps: - name: Checkout @@ -195,6 +195,8 @@ jobs: strategy: max-parallel: 1 + matrix: + mpilib: ["mpich", "openmpi"] steps: - name: Checkout pennyLane-lightning-gpu From 3a27060fea64ef424f3a88730dae3f05a46bf4f1 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 14:58:28 -0400 Subject: [PATCH 27/44] Build only openmpi python tests. --- .github/workflows/tests_linux_x86_mpich.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 952347a8ec..a3b8d826bb 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -28,7 +28,7 @@ concurrency: jobs: cpp_tests: - # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') runs-on: - self-hosted @@ -196,7 +196,7 @@ jobs: strategy: max-parallel: 1 matrix: - mpilib: ["mpich", "openmpi"] + mpilib: ["openmpi"] steps: - name: Checkout pennyLane-lightning-gpu From d7bfd8013916fb3e7e0133ae6ffe213ccf7a2818 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 16:01:46 -0400 Subject: [PATCH 28/44] Add timeouts --- .github/workflows/tests_linux_x86_mpich.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index a3b8d826bb..367c93c9e4 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -41,6 +41,7 @@ jobs: max-parallel: 1 matrix: mpilib: ["mpich", "openmpi"] + timeout-minutes: 30 steps: - name: Checkout @@ -197,6 +198,7 @@ jobs: max-parallel: 1 matrix: mpilib: ["openmpi"] + timeout-minutes: 30 steps: - name: Checkout pennyLane-lightning-gpu From eb17997169dba2bdef29faa891e76b2e2a773a3f Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 16:39:01 -0400 Subject: [PATCH 29/44] test/test_apply.py --- .github/workflows/tests_linux_x86_mpich.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 367c93c9e4..81cf2b081f 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -280,8 +280,8 @@ jobs: source /etc/profile.d/modules.sh module use /opt/modules/ module load ${{ matrix.mpilib }} - PL_DEVICE=lightning.gpu /opt/mpi/${{ matrix.mpilib }}/bin/mpirun -np 2 python -m pytest ./mpitests/ PL_DEVICE=lightning.gpu python -m pytest ./tests/ + PL_DEVICE=lightning.gpu /opt/mpi/${{ matrix.mpilib }}/bin/mpirun -np 2 python -m pytest ./mpitests/test_apply.py - name: Cleanup if: always() From a3628fb8c0949bb1d3fa63bd561442f122697090 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 16:49:15 -0400 Subject: [PATCH 30/44] Revert pull triggers. --- .github/workflows/changelog_reminder.yml | 2 +- .github/workflows/format.yml | 2 +- .github/workflows/test_gpu_cu11.yml | 2 +- .github/workflows/tests_linux.yml | 2 +- .github/workflows/tests_linux_x86_mpich.yml | 4 ++-- .github/workflows/tests_linux_x86_openmpi.yml | 2 +- .github/workflows/tests_windows.yml | 2 +- .github/workflows/tests_without_binary.yml | 2 +- .github/workflows/update_dev_version.yml | 2 +- .github/workflows/wheel_linux_x86_64.yml | 2 +- .github/workflows/wheel_macos_arm64.yml | 2 +- .github/workflows/wheel_macos_x86_64.yml | 2 +- .github/workflows/wheel_noarch.yml | 2 +- .github/workflows/wheel_win_x86_64.yml | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/changelog_reminder.yml b/.github/workflows/changelog_reminder.yml index 4d3b120541..2eb934c165 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 449feeacd9..6cbde05023 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 859cb6f9aa..f82d2813fa 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 b04ce5fe10..a51db27345 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_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml index 81cf2b081f..6c6c7ebb0d 100644 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -185,7 +185,7 @@ jobs: python_tests: - # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') runs-on: - self-hosted @@ -281,7 +281,7 @@ jobs: module use /opt/modules/ module load ${{ matrix.mpilib }} PL_DEVICE=lightning.gpu python -m pytest ./tests/ - PL_DEVICE=lightning.gpu /opt/mpi/${{ matrix.mpilib }}/bin/mpirun -np 2 python -m pytest ./mpitests/test_apply.py + PL_DEVICE=lightning.gpu /opt/mpi/${{ matrix.mpilib }}/bin/mpirun -np 2 python -m pytest ./mpitests/test_adjoint_jacobian.py - name: Cleanup if: always() diff --git a/.github/workflows/tests_linux_x86_openmpi.yml b/.github/workflows/tests_linux_x86_openmpi.yml index 3af6988644..4c1f533b61 100644 --- a/.github/workflows/tests_linux_x86_openmpi.yml +++ b/.github/workflows/tests_linux_x86_openmpi.yml @@ -4,7 +4,7 @@ on: push: branches: - main - #pull_request: + pull_request: env: COVERAGE_FLAGS: "--cov=pennylane_lightning_gpu --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native" diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index 782831e269..7500152af1 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 845b215e96..bb21da4cfb 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 02062bdb5c..bfa66e1e8b 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 c8e99185bd..486c480b04 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_macos_arm64.yml b/.github/workflows/wheel_macos_arm64.yml index dde609f04a..4e0449038c 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 6f58cbf6a1..e63cfb46d3 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 000a800cf2..d3e6622730 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 54552cce90..2cbde98bbe 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 From f6e0e4d76a19f3937c5e7c71905708061557a519 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 16 Oct 2023 17:01:57 -0400 Subject: [PATCH 31/44] Clean gpu-mpi test workflows. --- ..._x86_mpich.yml => tests_linux_x86_mpi.yml} | 0 .github/workflows/tests_linux_x86_openmpi.yml | 279 ------------------ 2 files changed, 279 deletions(-) rename .github/workflows/{tests_linux_x86_mpich.yml => tests_linux_x86_mpi.yml} (100%) delete mode 100644 .github/workflows/tests_linux_x86_openmpi.yml diff --git a/.github/workflows/tests_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpi.yml similarity index 100% rename from .github/workflows/tests_linux_x86_mpich.yml rename to .github/workflows/tests_linux_x86_mpi.yml diff --git a/.github/workflows/tests_linux_x86_openmpi.yml b/.github/workflows/tests_linux_x86_openmpi.yml deleted file mode 100644 index 4c1f533b61..0000000000 --- a/.github/workflows/tests_linux_x86_openmpi.yml +++ /dev/null @@ -1,279 +0,0 @@ -name: Tests::Linux::x86_64_OPENMPI -on: - release: - push: - branches: - - main - pull_request: - -env: - COVERAGE_FLAGS: "--cov=pennylane_lightning_gpu --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native" - GCC_VERSION: 11 - OMP_NUM_THREADS: "2" - CI_CUDA_ARCH: 86 - -concurrency: - group: gpu-test-openmpi-${{ github.ref }}-${{ inputs.lightning-gpu-version }}-${{ inputs.pennylane-version }} - cancel-in-progress: true - -jobs: - cpp_openmpi_tests: - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') - - runs-on: - - self-hosted - - linux - - x64 - - ubuntu-22.04 - - multi-gpu - - strategy: - max-parallel: 1 - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - id: setup_python - name: Install Python - with: - python-version: '3.9' - - # Since the self-hosted runner can be re-used. It is best to set up all package - # installations in a virtual environment that gets cleaned at the end of each workflow run - - name: Setup Python virtual environment - id: setup_venv - env: - VENV_NAME: ${{ github.workspace }}/venv_${{ steps.setup_python.outputs.python-version }}_${{ github.sha }} - run: | - # Clear any pre-existing venvs - rm -rf venv_* - - # Create new venv for this workflow_run - python --version - python -m venv ${{ env.VENV_NAME }} - - # Add the venv to PATH for subsequent steps - echo ${{ env.VENV_NAME }}/bin >> $GITHUB_PATH - - # Adding venv name as an output for subsequent steps to reference if needed - echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT - - - name: Display Python-Path - id: python_path - run: | - py_path=$(which python) - echo "Python Interpreter Path => $py_path" - echo "python=$py_path" >> $GITHUB_OUTPUT - - pip_path=$(which python) - echo "PIP Path => $pip_path" - echo "pip=$pip_path" >> $GITHUB_OUTPUT - - - name: Install required packages - run: | - python -m pip install ninja cmake custatevec-cu11 - - - name: Validate GPU version and installed compiler - run: | - source /etc/profile.d/modules.sh - module use /opt/modules - module load cuda/11.8 - nvidia-smi - which -a nvcc - nvcc --version - - - name: Validate Multi-GPU packages - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') - run: | - source /etc/profile.d/modules.sh - - module use /opt/modules/ - - echo 'Checking for OpenMPI' - module load openmpi - mpirun --version - which mpicc - which mpirun - module unload openmpi - - echo 'Checking for MPICH' - module load mpich - mpiexec --version - which mpicc - which mpiexec - module unload mpich - - - name: Build and run unit tests with OpenMPI backend - run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load openmpi - module unload openmpi - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/openmpi/include:/opt/mpi/openmpi/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/openmpi/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - cmake . -BBuild \ - -DCMAKE_PREFIX_PATH=/opt/mpi/openmpi/ \ - -DPLLGPU_ENABLE_MPI=On \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DPLLGPU_BUILD_TESTS=ON \ - -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ - -DLIGHTNING_RELEASE_TAG="master" \ - -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ - -DCMAKE_CUDA_ARCHITECTURES="86" \ - -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ - -G Ninja - cmake --build ./Build - cd ./Build - mkdir -p ./tests/results - /opt/mpi/openmpi/bin/mpirun -np 2 ./pennylane_lightning_gpu/src/tests/mpi_runner --order lex --reporter junit --out ./tests/results/report_${{ github.job }}.xml - - - name: Upload test results - uses: actions/upload-artifact@v3 - if: always() - with: - name: ubuntu-tests-reports - path: ./Build/tests/results/report_${{ github.job }}.xml - - - name: Build and run unit tests for code coverage for OpenMPI backend - run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load openmpi - module unload openmpi - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/openmpi/include:/opt/mpi/openmpi/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/openmpi/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - cmake . -BBuildCov \ - -DCMAKE_PREFIX_PATH=/opt/mpi/openmpi/ \ - -DPLLGPU_ENABLE_MPI=On \ - -DCMAKE_BUILD_TYPE=Debug \ - -DPLLGPU_BUILD_TESTS=ON \ - -DPLLGPU_ENABLE_COVERAGE=ON \ - -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ - -DLIGHTNING_RELEASE_TAG="master" \ - -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ - -DCMAKE_CUDA_ARCHITECTURES="86" \ - -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ - -G Ninja - cmake --build ./BuildCov - cd ./BuildCov - /opt/mpi/openmpi/bin/mpirun -np 2 ./pennylane_lightning_gpu/src/tests/mpi_runner - lcov --directory . -b ../pennylane_lightning_gpu/src --capture --output-file coverage.info - lcov --remove coverage.info '/usr/*' --output-file coverage.info - mv coverage.info coverage-${{ github.job }}.info - - - name: Upload code coverage results for OpenMPI backend - uses: actions/upload-artifact@v3 - with: - name: ubuntu-codecov-results-cpp - path: ./BuildCov/coverage-${{ github.job }}.info - - - name: Cleanup - if: always() - run: | - rm -rf ${{ steps.setup_venv.outputs.venv_name }} - rm -rf * - rm -rf .git - rm -rf .gitignore - rm -rf .github - pip cache purge - - - python_openmpi_tests: - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') - - runs-on: - - self-hosted - - linux - - x64 - - ubuntu-22.04 - - multi-gpu - - strategy: - max-parallel: 1 - - steps: - - name: Checkout pennyLane-lightning-gpu - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - id: setup_python - name: Install Python - with: - python-version: '3.9' - - # Since the self-hosted runner can be re-used. It is best to set up all package - # installations in a virtual environment that gets cleaned at the end of each workflow run - - name: Setup Python virtual environment - id: setup_venv - env: - VENV_NAME: ${{ github.workspace }}/venv_${{ steps.setup_python.outputs.python-version }}_${{ github.sha }} - run: | - # Clear any pre-existing venvs - rm -rf venv_* - - # Create new venv for this workflow_run - python --version - python -m venv ${{ env.VENV_NAME }} - - # Add the venv to PATH for subsequent steps - echo ${{ env.VENV_NAME }}/bin >> $GITHUB_PATH - - # Adding venv name as an output for subsequent steps to reference if needed - source ${{ env.VENV_NAME }}/bin/activate - echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT - - - name: Display Python-Path - id: python_path - run: | - py_path=$(which python) - echo "Python Interpreter Path => $py_path" - echo "python=$py_path" >> $GITHUB_OUTPUT - - pip_path=$(which python) - echo "PIP Path => $pip_path" - echo "pip=$pip_path" >> $GITHUB_OUTPUT - - - name: Install Latest PennyLane - # We want to install the latest PL on non workflow_call events - if: inputs.pennylane-version == 'latest' || inputs.pennylane-version == '' - run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master - - - name: Install required packages (OpenMPI backend) - run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load openmpi - module unload openmpi - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/openmpi/include:/opt/mpi/openmpi/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/openmpi/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - python -m pip install pip~=22.0 - python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py - # Sync with latest master branches - python -m pip install git+https://github.com/PennyLaneAI/pennylane-lightning.git@master --force-reinstall --no-deps - - - name: Build and install package (OpenMPI backend) - env: - CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - run: | - python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/openmpi;PLLGPU_ENABLE_MPI=On;LIGHTNING_RELEASE_TAG=master;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" - python -m pip install -e . --verbose - - - name: Run PennyLane-Lightning-GPU unit tests (OpenMPI backend) - run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load openmpi - /opt/mpi/openmpi/bin/mpirun -np 2 python -m pytest ./mpitests/ - python -m pytest ./tests/ - - - name: Cleanup - if: always() - run: | - rm -rf ${{ steps.setup_venv.outputs.venv_name }} - rm -rf * - rm -rf .git - rm -rf .gitignore - rm -rf .github - pip cache purge From 8202ce39e7d8b8187b970ff575d1e02288acf6c1 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Tue, 17 Oct 2023 08:37:12 -0400 Subject: [PATCH 32/44] Revert to 804ed24. --- .github/workflows/changelog_reminder.yml | 2 +- .github/workflows/format.yml | 2 +- .github/workflows/test_gpu_cu11.yml | 2 +- .github/workflows/tests_linux.yml | 2 +- .github/workflows/tests_linux_x86_mpich.yml | 308 ++++++++++++++++++ .github/workflows/tests_linux_x86_openmpi.yml | 279 ++++++++++++++++ .github/workflows/tests_windows.yml | 2 +- .github/workflows/tests_without_binary.yml | 2 +- .github/workflows/update_dev_version.yml | 2 +- .github/workflows/wheel_linux_x86_64.yml | 2 +- .github/workflows/wheel_macos_arm64.yml | 2 +- .github/workflows/wheel_macos_x86_64.yml | 2 +- .github/workflows/wheel_noarch.yml | 2 +- .github/workflows/wheel_win_x86_64.yml | 2 +- 14 files changed, 599 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/tests_linux_x86_mpich.yml create mode 100644 .github/workflows/tests_linux_x86_openmpi.yml 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 f82d2813fa..859cb6f9aa 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_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml new file mode 100644 index 0000000000..dbdeb7a6b6 --- /dev/null +++ b/.github/workflows/tests_linux_x86_mpich.yml @@ -0,0 +1,308 @@ +name: Tests::Linux::x86_64_MPICH +on: + workflow_call: + inputs: + lightning-gpu-version: + type: string + required: true + description: The version of lightning to use. Valid values are either 'stable' (most recent git-tag) or 'latest' (most recent commit from master) + pennylane-version: + 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) + release: + push: + branches: + - main + pull_request: + +env: + COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native" + GCC_VERSION: 11 + OMP_NUM_THREADS: "2" + CI_CUDA_ARCH: 86 + +concurrency: + group: gpu-test-mpich-${{ github.ref }}-${{ inputs.lightning-gpu-version }}-${{ inputs.pennylane-version }} + cancel-in-progress: true + +jobs: + cpp_mpich_tests: + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + + runs-on: + - self-hosted + - linux + - x64 + - ubuntu-22.04 + - multi-gpu + + strategy: + max-parallel: 1 + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-tags: true + + - name: Switch to stable build of Lightning-GPU + if: inputs.lightning-gpu-version == 'stable' + run: git checkout $(git tag | sort -V | tail -1) + + - uses: actions/setup-python@v4 + id: setup_python + name: Install Python + with: + python-version: '3.9' + + # Since the self-hosted runner can be re-used. It is best to set up all package + # installations in a virtual environment that gets cleaned at the end of each workflow run + - name: Setup Python virtual environment + id: setup_venv + env: + VENV_NAME: ${{ github.workspace }}/venv_${{ steps.setup_python.outputs.python-version }}_${{ github.sha }} + run: | + # Clear any pre-existing venvs + rm -rf venv_* + + # Create new venv for this workflow_run + python --version + python -m venv ${{ env.VENV_NAME }} + + # Add the venv to PATH for subsequent steps + echo ${{ env.VENV_NAME }}/bin >> $GITHUB_PATH + + # Adding venv name as an output for subsequent steps to reference if needed + echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT + + - name: Display Python-Path + id: python_path + run: | + py_path=$(which python) + echo "Python Interpreter Path => $py_path" + echo "python=$py_path" >> $GITHUB_OUTPUT + + pip_path=$(which python) + echo "PIP Path => $pip_path" + echo "pip=$pip_path" >> $GITHUB_OUTPUT + + - name: Install required packages + run: | + python -m pip install ninja cmake custatevec-cu11 + + - name: Validate GPU version and installed compiler + run: | + source /etc/profile.d/modules.sh + module use /opt/modules + module load cuda/11.8 + which -a nvcc + nvcc --version + + - name: Validate Multi-GPU packages + # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + run: | + source /etc/profile.d/modules.sh + + module use /opt/modules/ + + echo 'Checking for OpenMPI' + module load openmpi + mpirun --version + which mpicc + which mpirun + module unload openmpi + + echo 'Checking for MPICH' + module load mpich + mpiexec --version + which mpicc + which mpiexec + module unload mpich + + - name: Install Latest PennyLane + if: inputs.pennylane-version == 'latest' + run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master + + - name: Build and run unit tests with MPICH backend + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load mpich + module unload mpich + export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK + cmake . -BBuild \ + -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ + -DPLLGPU_ENABLE_MPI=ON \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DPLLGPU_BUILD_TESTS=ON \ + -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ + -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ + -DCMAKE_CUDA_ARCHITECTURES="86" \ + -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ + -G Ninja + cmake --build ./Build + cd ./Build + mkdir -p ./tests/results + /opt/mpi/mpich/bin/mpirun -np 2 ./pennylane_lightning/src/tests/mpi_runner --order lex --reporter junit --out ./tests/results/report_${{ github.job }}.xml + + - name: Upload test results + uses: actions/upload-artifact@v3 + if: always() + with: + name: ubuntu-tests-reports + path: ./Build/tests/results/report_${{ github.job }}.xml + + - name: Build and run unit tests for code coverage for MPICH backend + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load mpich + module unload mpich + export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK + cmake . -BBuildCov \ + -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ + -DPLLGPU_ENABLE_MPI=ON \ + -DCMAKE_BUILD_TYPE=Debug \ + -DPLLGPU_BUILD_TESTS=ON \ + -DPLLGPU_ENABLE_COVERAGE=ON \ + -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ + -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ + -DCMAKE_CUDA_ARCHITECTURES="86" \ + -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ + -G Ninja + cmake --build ./BuildCov + cd ./BuildCov + /opt/mpi/mpich/bin/mpirun -np 2 ./pennylane_lightning/src/tests/mpi_runner + lcov --directory . -b ../pennylane_lightning/src --capture --output-file coverage.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info + mv coverage.info coverage-${{ github.job }}.info + + - name: Upload code coverage results for MPICH backend + uses: actions/upload-artifact@v3 + with: + name: ubuntu-codecov-results-cpp + path: ./BuildCov/coverage-${{ github.job }}.info + + - name: Cleanup + if: always() + run: | + rm -rf ${{ steps.setup_venv.outputs.venv_name }} + rm -rf * + rm -rf .git + rm -rf .gitignore + rm -rf .github + pip cache purge + + + python_mpich_tests: + # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + + runs-on: + - self-hosted + - linux + - x64 + - ubuntu-22.04 + - multi-gpu + + strategy: + max-parallel: 1 + + steps: + - name: Checkout pennyLane-lightning-gpu + uses: actions/checkout@v3 + with: + fetch-tags: true + + - name: Switch to stable build of Lightning-GPU + if: inputs.lightning-gpu-version == 'stable' + run: | + git fetch tags --force + git checkout $(git tag | sort -V | tail -1) + + - uses: actions/setup-python@v4 + id: setup_python + name: Install Python + with: + python-version: '3.9' + + # Since the self-hosted runner can be re-used. It is best to set up all package + # installations in a virtual environment that gets cleaned at the end of each workflow run + - name: Setup Python virtual environment + id: setup_venv + env: + VENV_NAME: ${{ github.workspace }}/venv_${{ steps.setup_python.outputs.python-version }}_${{ github.sha }} + run: | + # Clear any pre-existing venvs + rm -rf venv_* + + # Create new venv for this workflow_run + python --version + python -m venv ${{ env.VENV_NAME }} + + # Add the venv to PATH for subsequent steps + echo ${{ env.VENV_NAME }}/bin >> $GITHUB_PATH + + # Adding venv name as an output for subsequent steps to reference if needed + source ${{ env.VENV_NAME }}/bin/activate + echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT + + - name: Display Python-Path + id: python_path + run: | + py_path=$(which python) + echo "Python Interpreter Path => $py_path" + echo "python=$py_path" >> $GITHUB_OUTPUT + + pip_path=$(which python) + echo "PIP Path => $pip_path" + echo "pip=$pip_path" >> $GITHUB_OUTPUT + + - name: Install Latest PennyLane + # We want to install the latest PL on non workflow_call events + if: inputs.pennylane-version == 'latest' || inputs.pennylane-version == '' + run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master + + - name: Install required packages (MPICH backend) + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load mpich + module unload mpich + export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK + python -m pip install pip~=22.0 + python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py + # Sync with latest master branches + # python -m pip install git+https://github.com/PennyLaneAI/pennylane-lightning.git@master --force-reinstall --no-deps + + - name: Build and install package (MPICH backend) + env: + CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + run: | + SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv + PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" + PL_BACKEND=lightning_gpu python -m pip install -e . --verbose + + - name: Run PennyLane-Lightning-GPU unit tests (MPICH backend) + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load mpich + PL_DEVICE=lightning.gpu /opt/mpi/mpich/bin/mpirun -np 2 python -m pytest ./mpitests/ + PL_DEVICE=lightning.gpu python -m pytest ./tests/ + + - name: Cleanup + if: always() + run: | + rm -rf ${{ steps.setup_venv.outputs.venv_name }} + rm -rf * + rm -rf .git + rm -rf .gitignore + rm -rf .github + pip cache purge diff --git a/.github/workflows/tests_linux_x86_openmpi.yml b/.github/workflows/tests_linux_x86_openmpi.yml new file mode 100644 index 0000000000..3af6988644 --- /dev/null +++ b/.github/workflows/tests_linux_x86_openmpi.yml @@ -0,0 +1,279 @@ +name: Tests::Linux::x86_64_OPENMPI +on: + release: + push: + branches: + - main + #pull_request: + +env: + COVERAGE_FLAGS: "--cov=pennylane_lightning_gpu --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native" + GCC_VERSION: 11 + OMP_NUM_THREADS: "2" + CI_CUDA_ARCH: 86 + +concurrency: + group: gpu-test-openmpi-${{ github.ref }}-${{ inputs.lightning-gpu-version }}-${{ inputs.pennylane-version }} + cancel-in-progress: true + +jobs: + cpp_openmpi_tests: + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + + runs-on: + - self-hosted + - linux + - x64 + - ubuntu-22.04 + - multi-gpu + + strategy: + max-parallel: 1 + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + id: setup_python + name: Install Python + with: + python-version: '3.9' + + # Since the self-hosted runner can be re-used. It is best to set up all package + # installations in a virtual environment that gets cleaned at the end of each workflow run + - name: Setup Python virtual environment + id: setup_venv + env: + VENV_NAME: ${{ github.workspace }}/venv_${{ steps.setup_python.outputs.python-version }}_${{ github.sha }} + run: | + # Clear any pre-existing venvs + rm -rf venv_* + + # Create new venv for this workflow_run + python --version + python -m venv ${{ env.VENV_NAME }} + + # Add the venv to PATH for subsequent steps + echo ${{ env.VENV_NAME }}/bin >> $GITHUB_PATH + + # Adding venv name as an output for subsequent steps to reference if needed + echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT + + - name: Display Python-Path + id: python_path + run: | + py_path=$(which python) + echo "Python Interpreter Path => $py_path" + echo "python=$py_path" >> $GITHUB_OUTPUT + + pip_path=$(which python) + echo "PIP Path => $pip_path" + echo "pip=$pip_path" >> $GITHUB_OUTPUT + + - name: Install required packages + run: | + python -m pip install ninja cmake custatevec-cu11 + + - name: Validate GPU version and installed compiler + run: | + source /etc/profile.d/modules.sh + module use /opt/modules + module load cuda/11.8 + nvidia-smi + which -a nvcc + nvcc --version + + - name: Validate Multi-GPU packages + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + run: | + source /etc/profile.d/modules.sh + + module use /opt/modules/ + + echo 'Checking for OpenMPI' + module load openmpi + mpirun --version + which mpicc + which mpirun + module unload openmpi + + echo 'Checking for MPICH' + module load mpich + mpiexec --version + which mpicc + which mpiexec + module unload mpich + + - name: Build and run unit tests with OpenMPI backend + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load openmpi + module unload openmpi + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/openmpi/include:/opt/mpi/openmpi/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/openmpi/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + cmake . -BBuild \ + -DCMAKE_PREFIX_PATH=/opt/mpi/openmpi/ \ + -DPLLGPU_ENABLE_MPI=On \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DPLLGPU_BUILD_TESTS=ON \ + -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ + -DLIGHTNING_RELEASE_TAG="master" \ + -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ + -DCMAKE_CUDA_ARCHITECTURES="86" \ + -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ + -G Ninja + cmake --build ./Build + cd ./Build + mkdir -p ./tests/results + /opt/mpi/openmpi/bin/mpirun -np 2 ./pennylane_lightning_gpu/src/tests/mpi_runner --order lex --reporter junit --out ./tests/results/report_${{ github.job }}.xml + + - name: Upload test results + uses: actions/upload-artifact@v3 + if: always() + with: + name: ubuntu-tests-reports + path: ./Build/tests/results/report_${{ github.job }}.xml + + - name: Build and run unit tests for code coverage for OpenMPI backend + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load openmpi + module unload openmpi + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/openmpi/include:/opt/mpi/openmpi/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/openmpi/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + cmake . -BBuildCov \ + -DCMAKE_PREFIX_PATH=/opt/mpi/openmpi/ \ + -DPLLGPU_ENABLE_MPI=On \ + -DCMAKE_BUILD_TYPE=Debug \ + -DPLLGPU_BUILD_TESTS=ON \ + -DPLLGPU_ENABLE_COVERAGE=ON \ + -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ + -DLIGHTNING_RELEASE_TAG="master" \ + -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ + -DCMAKE_CUDA_ARCHITECTURES="86" \ + -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ + -G Ninja + cmake --build ./BuildCov + cd ./BuildCov + /opt/mpi/openmpi/bin/mpirun -np 2 ./pennylane_lightning_gpu/src/tests/mpi_runner + lcov --directory . -b ../pennylane_lightning_gpu/src --capture --output-file coverage.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info + mv coverage.info coverage-${{ github.job }}.info + + - name: Upload code coverage results for OpenMPI backend + uses: actions/upload-artifact@v3 + with: + name: ubuntu-codecov-results-cpp + path: ./BuildCov/coverage-${{ github.job }}.info + + - name: Cleanup + if: always() + run: | + rm -rf ${{ steps.setup_venv.outputs.venv_name }} + rm -rf * + rm -rf .git + rm -rf .gitignore + rm -rf .github + pip cache purge + + + python_openmpi_tests: + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') + + runs-on: + - self-hosted + - linux + - x64 + - ubuntu-22.04 + - multi-gpu + + strategy: + max-parallel: 1 + + steps: + - name: Checkout pennyLane-lightning-gpu + uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + id: setup_python + name: Install Python + with: + python-version: '3.9' + + # Since the self-hosted runner can be re-used. It is best to set up all package + # installations in a virtual environment that gets cleaned at the end of each workflow run + - name: Setup Python virtual environment + id: setup_venv + env: + VENV_NAME: ${{ github.workspace }}/venv_${{ steps.setup_python.outputs.python-version }}_${{ github.sha }} + run: | + # Clear any pre-existing venvs + rm -rf venv_* + + # Create new venv for this workflow_run + python --version + python -m venv ${{ env.VENV_NAME }} + + # Add the venv to PATH for subsequent steps + echo ${{ env.VENV_NAME }}/bin >> $GITHUB_PATH + + # Adding venv name as an output for subsequent steps to reference if needed + source ${{ env.VENV_NAME }}/bin/activate + echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT + + - name: Display Python-Path + id: python_path + run: | + py_path=$(which python) + echo "Python Interpreter Path => $py_path" + echo "python=$py_path" >> $GITHUB_OUTPUT + + pip_path=$(which python) + echo "PIP Path => $pip_path" + echo "pip=$pip_path" >> $GITHUB_OUTPUT + + - name: Install Latest PennyLane + # We want to install the latest PL on non workflow_call events + if: inputs.pennylane-version == 'latest' || inputs.pennylane-version == '' + run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master + + - name: Install required packages (OpenMPI backend) + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load openmpi + module unload openmpi + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/openmpi/include:/opt/mpi/openmpi/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/openmpi/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + python -m pip install pip~=22.0 + python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py + # Sync with latest master branches + python -m pip install git+https://github.com/PennyLaneAI/pennylane-lightning.git@master --force-reinstall --no-deps + + - name: Build and install package (OpenMPI backend) + env: + CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + run: | + python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/openmpi;PLLGPU_ENABLE_MPI=On;LIGHTNING_RELEASE_TAG=master;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" + python -m pip install -e . --verbose + + - name: Run PennyLane-Lightning-GPU unit tests (OpenMPI backend) + run: | + source /etc/profile.d/modules.sh + module use /opt/modules/ + module load openmpi + /opt/mpi/openmpi/bin/mpirun -np 2 python -m pytest ./mpitests/ + python -m pytest ./tests/ + + - name: Cleanup + if: always() + run: | + rm -rf ${{ steps.setup_venv.outputs.venv_name }} + rm -rf * + rm -rf .git + rm -rf .gitignore + rm -rf .github + pip cache purge 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_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 From 4027615193b00a6b02b2c1e0578a74454240d4e6 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Tue, 17 Oct 2023 09:07:41 -0400 Subject: [PATCH 33/44] Revert back. --- .github/workflows/changelog_reminder.yml | 2 +- .github/workflows/format.yml | 2 +- .github/workflows/test_gpu_cu11.yml | 2 +- .github/workflows/tests_linux.yml | 2 +- .github/workflows/tests_linux_x86_mpich.yml | 308 ------------------ .github/workflows/tests_linux_x86_openmpi.yml | 279 ---------------- .github/workflows/tests_windows.yml | 2 +- .github/workflows/tests_without_binary.yml | 2 +- .github/workflows/update_dev_version.yml | 2 +- .github/workflows/wheel_linux_x86_64.yml | 2 +- .github/workflows/wheel_macos_arm64.yml | 2 +- .github/workflows/wheel_macos_x86_64.yml | 2 +- .github/workflows/wheel_noarch.yml | 2 +- .github/workflows/wheel_win_x86_64.yml | 2 +- 14 files changed, 12 insertions(+), 599 deletions(-) delete mode 100644 .github/workflows/tests_linux_x86_mpich.yml delete mode 100644 .github/workflows/tests_linux_x86_openmpi.yml diff --git a/.github/workflows/changelog_reminder.yml b/.github/workflows/changelog_reminder.yml index 4d3b120541..2eb934c165 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 449feeacd9..6cbde05023 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 859cb6f9aa..f82d2813fa 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 b04ce5fe10..a51db27345 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_linux_x86_mpich.yml b/.github/workflows/tests_linux_x86_mpich.yml deleted file mode 100644 index dbdeb7a6b6..0000000000 --- a/.github/workflows/tests_linux_x86_mpich.yml +++ /dev/null @@ -1,308 +0,0 @@ -name: Tests::Linux::x86_64_MPICH -on: - workflow_call: - inputs: - lightning-gpu-version: - type: string - required: true - description: The version of lightning to use. Valid values are either 'stable' (most recent git-tag) or 'latest' (most recent commit from master) - pennylane-version: - 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) - release: - push: - branches: - - main - pull_request: - -env: - COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native" - GCC_VERSION: 11 - OMP_NUM_THREADS: "2" - CI_CUDA_ARCH: 86 - -concurrency: - group: gpu-test-mpich-${{ github.ref }}-${{ inputs.lightning-gpu-version }}-${{ inputs.pennylane-version }} - cancel-in-progress: true - -jobs: - cpp_mpich_tests: - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') - - runs-on: - - self-hosted - - linux - - x64 - - ubuntu-22.04 - - multi-gpu - - strategy: - max-parallel: 1 - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-tags: true - - - name: Switch to stable build of Lightning-GPU - if: inputs.lightning-gpu-version == 'stable' - run: git checkout $(git tag | sort -V | tail -1) - - - uses: actions/setup-python@v4 - id: setup_python - name: Install Python - with: - python-version: '3.9' - - # Since the self-hosted runner can be re-used. It is best to set up all package - # installations in a virtual environment that gets cleaned at the end of each workflow run - - name: Setup Python virtual environment - id: setup_venv - env: - VENV_NAME: ${{ github.workspace }}/venv_${{ steps.setup_python.outputs.python-version }}_${{ github.sha }} - run: | - # Clear any pre-existing venvs - rm -rf venv_* - - # Create new venv for this workflow_run - python --version - python -m venv ${{ env.VENV_NAME }} - - # Add the venv to PATH for subsequent steps - echo ${{ env.VENV_NAME }}/bin >> $GITHUB_PATH - - # Adding venv name as an output for subsequent steps to reference if needed - echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT - - - name: Display Python-Path - id: python_path - run: | - py_path=$(which python) - echo "Python Interpreter Path => $py_path" - echo "python=$py_path" >> $GITHUB_OUTPUT - - pip_path=$(which python) - echo "PIP Path => $pip_path" - echo "pip=$pip_path" >> $GITHUB_OUTPUT - - - name: Install required packages - run: | - python -m pip install ninja cmake custatevec-cu11 - - - name: Validate GPU version and installed compiler - run: | - source /etc/profile.d/modules.sh - module use /opt/modules - module load cuda/11.8 - which -a nvcc - nvcc --version - - - name: Validate Multi-GPU packages - # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') - run: | - source /etc/profile.d/modules.sh - - module use /opt/modules/ - - echo 'Checking for OpenMPI' - module load openmpi - mpirun --version - which mpicc - which mpirun - module unload openmpi - - echo 'Checking for MPICH' - module load mpich - mpiexec --version - which mpicc - which mpiexec - module unload mpich - - - name: Install Latest PennyLane - if: inputs.pennylane-version == 'latest' - run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master - - - name: Build and run unit tests with MPICH backend - run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load mpich - module unload mpich - export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK - cmake . -BBuild \ - -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ - -DPLLGPU_ENABLE_MPI=ON \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DPLLGPU_BUILD_TESTS=ON \ - -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ - -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ - -DCMAKE_CUDA_ARCHITECTURES="86" \ - -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ - -G Ninja - cmake --build ./Build - cd ./Build - mkdir -p ./tests/results - /opt/mpi/mpich/bin/mpirun -np 2 ./pennylane_lightning/src/tests/mpi_runner --order lex --reporter junit --out ./tests/results/report_${{ github.job }}.xml - - - name: Upload test results - uses: actions/upload-artifact@v3 - if: always() - with: - name: ubuntu-tests-reports - path: ./Build/tests/results/report_${{ github.job }}.xml - - - name: Build and run unit tests for code coverage for MPICH backend - run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load mpich - module unload mpich - export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK - cmake . -BBuildCov \ - -DCMAKE_PREFIX_PATH=/opt/mpi/mpich/ \ - -DPLLGPU_ENABLE_MPI=ON \ - -DCMAKE_BUILD_TYPE=Debug \ - -DPLLGPU_BUILD_TESTS=ON \ - -DPLLGPU_ENABLE_COVERAGE=ON \ - -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ - -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ - -DCMAKE_CUDA_ARCHITECTURES="86" \ - -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ - -G Ninja - cmake --build ./BuildCov - cd ./BuildCov - /opt/mpi/mpich/bin/mpirun -np 2 ./pennylane_lightning/src/tests/mpi_runner - lcov --directory . -b ../pennylane_lightning/src --capture --output-file coverage.info - lcov --remove coverage.info '/usr/*' --output-file coverage.info - mv coverage.info coverage-${{ github.job }}.info - - - name: Upload code coverage results for MPICH backend - uses: actions/upload-artifact@v3 - with: - name: ubuntu-codecov-results-cpp - path: ./BuildCov/coverage-${{ github.job }}.info - - - name: Cleanup - if: always() - run: | - rm -rf ${{ steps.setup_venv.outputs.venv_name }} - rm -rf * - rm -rf .git - rm -rf .gitignore - rm -rf .github - pip cache purge - - - python_mpich_tests: - # if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') - - runs-on: - - self-hosted - - linux - - x64 - - ubuntu-22.04 - - multi-gpu - - strategy: - max-parallel: 1 - - steps: - - name: Checkout pennyLane-lightning-gpu - uses: actions/checkout@v3 - with: - fetch-tags: true - - - name: Switch to stable build of Lightning-GPU - if: inputs.lightning-gpu-version == 'stable' - run: | - git fetch tags --force - git checkout $(git tag | sort -V | tail -1) - - - uses: actions/setup-python@v4 - id: setup_python - name: Install Python - with: - python-version: '3.9' - - # Since the self-hosted runner can be re-used. It is best to set up all package - # installations in a virtual environment that gets cleaned at the end of each workflow run - - name: Setup Python virtual environment - id: setup_venv - env: - VENV_NAME: ${{ github.workspace }}/venv_${{ steps.setup_python.outputs.python-version }}_${{ github.sha }} - run: | - # Clear any pre-existing venvs - rm -rf venv_* - - # Create new venv for this workflow_run - python --version - python -m venv ${{ env.VENV_NAME }} - - # Add the venv to PATH for subsequent steps - echo ${{ env.VENV_NAME }}/bin >> $GITHUB_PATH - - # Adding venv name as an output for subsequent steps to reference if needed - source ${{ env.VENV_NAME }}/bin/activate - echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT - - - name: Display Python-Path - id: python_path - run: | - py_path=$(which python) - echo "Python Interpreter Path => $py_path" - echo "python=$py_path" >> $GITHUB_OUTPUT - - pip_path=$(which python) - echo "PIP Path => $pip_path" - echo "pip=$pip_path" >> $GITHUB_OUTPUT - - - name: Install Latest PennyLane - # We want to install the latest PL on non workflow_call events - if: inputs.pennylane-version == 'latest' || inputs.pennylane-version == '' - run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master - - - name: Install required packages (MPICH backend) - run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load mpich - module unload mpich - export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/mpich/include:/opt/mpi/mpich/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/mpich/lib:$CUQUANTUM_SDK - python -m pip install pip~=22.0 - python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py - # Sync with latest master branches - # python -m pip install git+https://github.com/PennyLaneAI/pennylane-lightning.git@master --force-reinstall --no-deps - - - name: Build and install package (MPICH backend) - env: - CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - run: | - SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv - PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/mpich;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" - PL_BACKEND=lightning_gpu python -m pip install -e . --verbose - - - name: Run PennyLane-Lightning-GPU unit tests (MPICH backend) - run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load mpich - PL_DEVICE=lightning.gpu /opt/mpi/mpich/bin/mpirun -np 2 python -m pytest ./mpitests/ - PL_DEVICE=lightning.gpu python -m pytest ./tests/ - - - name: Cleanup - if: always() - run: | - rm -rf ${{ steps.setup_venv.outputs.venv_name }} - rm -rf * - rm -rf .git - rm -rf .gitignore - rm -rf .github - pip cache purge diff --git a/.github/workflows/tests_linux_x86_openmpi.yml b/.github/workflows/tests_linux_x86_openmpi.yml deleted file mode 100644 index 3af6988644..0000000000 --- a/.github/workflows/tests_linux_x86_openmpi.yml +++ /dev/null @@ -1,279 +0,0 @@ -name: Tests::Linux::x86_64_OPENMPI -on: - release: - push: - branches: - - main - #pull_request: - -env: - COVERAGE_FLAGS: "--cov=pennylane_lightning_gpu --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native" - GCC_VERSION: 11 - OMP_NUM_THREADS: "2" - CI_CUDA_ARCH: 86 - -concurrency: - group: gpu-test-openmpi-${{ github.ref }}-${{ inputs.lightning-gpu-version }}-${{ inputs.pennylane-version }} - cancel-in-progress: true - -jobs: - cpp_openmpi_tests: - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') - - runs-on: - - self-hosted - - linux - - x64 - - ubuntu-22.04 - - multi-gpu - - strategy: - max-parallel: 1 - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - id: setup_python - name: Install Python - with: - python-version: '3.9' - - # Since the self-hosted runner can be re-used. It is best to set up all package - # installations in a virtual environment that gets cleaned at the end of each workflow run - - name: Setup Python virtual environment - id: setup_venv - env: - VENV_NAME: ${{ github.workspace }}/venv_${{ steps.setup_python.outputs.python-version }}_${{ github.sha }} - run: | - # Clear any pre-existing venvs - rm -rf venv_* - - # Create new venv for this workflow_run - python --version - python -m venv ${{ env.VENV_NAME }} - - # Add the venv to PATH for subsequent steps - echo ${{ env.VENV_NAME }}/bin >> $GITHUB_PATH - - # Adding venv name as an output for subsequent steps to reference if needed - echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT - - - name: Display Python-Path - id: python_path - run: | - py_path=$(which python) - echo "Python Interpreter Path => $py_path" - echo "python=$py_path" >> $GITHUB_OUTPUT - - pip_path=$(which python) - echo "PIP Path => $pip_path" - echo "pip=$pip_path" >> $GITHUB_OUTPUT - - - name: Install required packages - run: | - python -m pip install ninja cmake custatevec-cu11 - - - name: Validate GPU version and installed compiler - run: | - source /etc/profile.d/modules.sh - module use /opt/modules - module load cuda/11.8 - nvidia-smi - which -a nvcc - nvcc --version - - - name: Validate Multi-GPU packages - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') - run: | - source /etc/profile.d/modules.sh - - module use /opt/modules/ - - echo 'Checking for OpenMPI' - module load openmpi - mpirun --version - which mpicc - which mpirun - module unload openmpi - - echo 'Checking for MPICH' - module load mpich - mpiexec --version - which mpicc - which mpiexec - module unload mpich - - - name: Build and run unit tests with OpenMPI backend - run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load openmpi - module unload openmpi - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/openmpi/include:/opt/mpi/openmpi/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/openmpi/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - cmake . -BBuild \ - -DCMAKE_PREFIX_PATH=/opt/mpi/openmpi/ \ - -DPLLGPU_ENABLE_MPI=On \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DPLLGPU_BUILD_TESTS=ON \ - -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ - -DLIGHTNING_RELEASE_TAG="master" \ - -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ - -DCMAKE_CUDA_ARCHITECTURES="86" \ - -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ - -G Ninja - cmake --build ./Build - cd ./Build - mkdir -p ./tests/results - /opt/mpi/openmpi/bin/mpirun -np 2 ./pennylane_lightning_gpu/src/tests/mpi_runner --order lex --reporter junit --out ./tests/results/report_${{ github.job }}.xml - - - name: Upload test results - uses: actions/upload-artifact@v3 - if: always() - with: - name: ubuntu-tests-reports - path: ./Build/tests/results/report_${{ github.job }}.xml - - - name: Build and run unit tests for code coverage for OpenMPI backend - run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load openmpi - module unload openmpi - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/openmpi/include:/opt/mpi/openmpi/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/openmpi/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - cmake . -BBuildCov \ - -DCMAKE_PREFIX_PATH=/opt/mpi/openmpi/ \ - -DPLLGPU_ENABLE_MPI=On \ - -DCMAKE_BUILD_TYPE=Debug \ - -DPLLGPU_BUILD_TESTS=ON \ - -DPLLGPU_ENABLE_COVERAGE=ON \ - -DCMAKE_CXX_COMPILER="$(which g++-${{ env.GCC_VERSION }})" \ - -DLIGHTNING_RELEASE_TAG="master" \ - -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ - -DCMAKE_CUDA_ARCHITECTURES="86" \ - -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ - -G Ninja - cmake --build ./BuildCov - cd ./BuildCov - /opt/mpi/openmpi/bin/mpirun -np 2 ./pennylane_lightning_gpu/src/tests/mpi_runner - lcov --directory . -b ../pennylane_lightning_gpu/src --capture --output-file coverage.info - lcov --remove coverage.info '/usr/*' --output-file coverage.info - mv coverage.info coverage-${{ github.job }}.info - - - name: Upload code coverage results for OpenMPI backend - uses: actions/upload-artifact@v3 - with: - name: ubuntu-codecov-results-cpp - path: ./BuildCov/coverage-${{ github.job }}.info - - - name: Cleanup - if: always() - run: | - rm -rf ${{ steps.setup_venv.outputs.venv_name }} - rm -rf * - rm -rf .git - rm -rf .gitignore - rm -rf .github - pip cache purge - - - python_openmpi_tests: - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-gpu-version != '' && inputs.pennylane-version != '') - - runs-on: - - self-hosted - - linux - - x64 - - ubuntu-22.04 - - multi-gpu - - strategy: - max-parallel: 1 - - steps: - - name: Checkout pennyLane-lightning-gpu - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - id: setup_python - name: Install Python - with: - python-version: '3.9' - - # Since the self-hosted runner can be re-used. It is best to set up all package - # installations in a virtual environment that gets cleaned at the end of each workflow run - - name: Setup Python virtual environment - id: setup_venv - env: - VENV_NAME: ${{ github.workspace }}/venv_${{ steps.setup_python.outputs.python-version }}_${{ github.sha }} - run: | - # Clear any pre-existing venvs - rm -rf venv_* - - # Create new venv for this workflow_run - python --version - python -m venv ${{ env.VENV_NAME }} - - # Add the venv to PATH for subsequent steps - echo ${{ env.VENV_NAME }}/bin >> $GITHUB_PATH - - # Adding venv name as an output for subsequent steps to reference if needed - source ${{ env.VENV_NAME }}/bin/activate - echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT - - - name: Display Python-Path - id: python_path - run: | - py_path=$(which python) - echo "Python Interpreter Path => $py_path" - echo "python=$py_path" >> $GITHUB_OUTPUT - - pip_path=$(which python) - echo "PIP Path => $pip_path" - echo "pip=$pip_path" >> $GITHUB_OUTPUT - - - name: Install Latest PennyLane - # We want to install the latest PL on non workflow_call events - if: inputs.pennylane-version == 'latest' || inputs.pennylane-version == '' - run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master - - - name: Install required packages (OpenMPI backend) - run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load openmpi - module unload openmpi - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/openmpi/include:/opt/mpi/openmpi/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/openmpi/lib:$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - python -m pip install pip~=22.0 - python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py - # Sync with latest master branches - python -m pip install git+https://github.com/PennyLaneAI/pennylane-lightning.git@master --force-reinstall --no-deps - - - name: Build and install package (OpenMPI backend) - env: - CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - run: | - python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=$(which g++-${{ env.GCC_VERSION }});CMAKE_PREFIX_PATH=/opt/mpi/openmpi;PLLGPU_ENABLE_MPI=On;LIGHTNING_RELEASE_TAG=master;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" - python -m pip install -e . --verbose - - - name: Run PennyLane-Lightning-GPU unit tests (OpenMPI backend) - run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load openmpi - /opt/mpi/openmpi/bin/mpirun -np 2 python -m pytest ./mpitests/ - python -m pytest ./tests/ - - - name: Cleanup - if: always() - run: | - rm -rf ${{ steps.setup_venv.outputs.venv_name }} - rm -rf * - rm -rf .git - rm -rf .gitignore - rm -rf .github - pip cache purge diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index 782831e269..7500152af1 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 845b215e96..bb21da4cfb 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 02062bdb5c..bfa66e1e8b 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 c8e99185bd..486c480b04 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_macos_arm64.yml b/.github/workflows/wheel_macos_arm64.yml index dde609f04a..4e0449038c 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 6f58cbf6a1..e63cfb46d3 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 000a800cf2..d3e6622730 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 54552cce90..2cbde98bbe 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 From f6e1eea7d703eadf165083681a5e6a58244f160f Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Tue, 17 Oct 2023 10:07:50 -0400 Subject: [PATCH 34/44] Update tests_linux_x86_mpi.yml [ci skip] --- .github/workflows/tests_linux_x86_mpi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_linux_x86_mpi.yml b/.github/workflows/tests_linux_x86_mpi.yml index 6c6c7ebb0d..2b9a78b088 100644 --- a/.github/workflows/tests_linux_x86_mpi.yml +++ b/.github/workflows/tests_linux_x86_mpi.yml @@ -1,4 +1,4 @@ -name: Tests::Linux::x86_64 +name: Tests::Linux::x86_64::LGPU::MPI on: workflow_call: inputs: From 3be766add60597651d32f5c62da21982d53b8dd3 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Tue, 17 Oct 2023 10:09:59 -0400 Subject: [PATCH 35/44] Add jobs dep. --- .github/workflows/test_gpu_cu11.yml | 4 ++-- .github/workflows/tests_linux_x86_mpi.yml | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test_gpu_cu11.yml b/.github/workflows/test_gpu_cu11.yml index f82d2813fa..c05c67a272 100644 --- a/.github/workflows/test_gpu_cu11.yml +++ b/.github/workflows/test_gpu_cu11.yml @@ -1,4 +1,4 @@ -name: Testing::Linux::x86_64 (Lightning-GPU) +name: Testing::Linux::x86_64::LGPU on: pull_request: push: @@ -144,7 +144,7 @@ jobs: if-no-files-found: error pythontestswithLGPU: - needs: [builddeps] + needs: [builddeps, cpptestswithLGPU_cu11] strategy: matrix: os: [ubuntu-22.04] diff --git a/.github/workflows/tests_linux_x86_mpi.yml b/.github/workflows/tests_linux_x86_mpi.yml index 2b9a78b088..36df4778e6 100644 --- a/.github/workflows/tests_linux_x86_mpi.yml +++ b/.github/workflows/tests_linux_x86_mpi.yml @@ -29,14 +29,12 @@ concurrency: jobs: cpp_tests: if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') - runs-on: - self-hosted - linux - x64 - ubuntu-22.04 - multi-gpu - strategy: max-parallel: 1 matrix: @@ -186,14 +184,13 @@ jobs: python_tests: if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') - runs-on: - self-hosted - linux - x64 - ubuntu-22.04 - multi-gpu - + needs: ["cpp_tests"] strategy: max-parallel: 1 matrix: From dbd251d46190202b6221d519325728db7daea0c3 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Tue, 17 Oct 2023 13:11:01 -0400 Subject: [PATCH 36/44] Remove module unload --- .github/workflows/tests_linux_x86_mpi.yml | 63 ++++++++++------------- 1 file changed, 28 insertions(+), 35 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpi.yml b/.github/workflows/tests_linux_x86_mpi.yml index 36df4778e6..f403901b7d 100644 --- a/.github/workflows/tests_linux_x86_mpi.yml +++ b/.github/workflows/tests_linux_x86_mpi.yml @@ -128,33 +128,30 @@ jobs: - name: Build and run unit tests run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load ${{ matrix.mpilib }} - module unload ${{ matrix.mpilib }} - export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/${{ matrix.mpilib }}/include:/opt/mpi/${{ matrix.mpilib }}/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/${{ matrix.mpilib }}/lib:$CUQUANTUM_SDK - cmake . -BBuild \ - -DPL_BACKEND=lightning_gpu \ - -DCMAKE_PREFIX_PATH=/opt/mpi/${{ matrix.mpilib }}/ \ - -DENABLE_MPI=ON \ - -DCMAKE_BUILD_TYPE=Debug \ - -DENABLE_COVERAGE=ON \ - -DBUILD_TESTS=ON \ - -DCMAKE_CXX_COMPILER=mpicxx \ - -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ - -DCMAKE_CUDA_ARCHITECTURES="86" \ - -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ - -G Ninja - cmake --build ./Build - cd ./Build - mkdir -p ./tests/results - for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done; - for file in *runner_mpi ; do /opt/mpi/${{ matrix.mpilib }}/bin/mpirun -np 2 ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done; - lcov --directory . -b ../pennylane_lightning/src --capture --output-file coverage.info - lcov --remove coverage.info '/usr/*' --output-file coverage.info - mv coverage.info coverage-${{ github.job }}-lightning_gpu.info + source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }} + export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") + export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/${{ matrix.mpilib }}/include:/opt/mpi/${{ matrix.mpilib }}/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/${{ matrix.mpilib }}/lib:$CUQUANTUM_SDK + cmake . -BBuild \ + -DPL_BACKEND=lightning_gpu \ + -DCMAKE_PREFIX_PATH=/opt/mpi/${{ matrix.mpilib }}/ \ + -DENABLE_MPI=ON \ + -DCMAKE_BUILD_TYPE=Debug \ + -DENABLE_COVERAGE=ON \ + -DBUILD_TESTS=ON \ + -DCMAKE_CXX_COMPILER=mpicxx \ + -DCMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" \ + -DCMAKE_CUDA_ARCHITECTURES="86" \ + -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ + -G Ninja + cmake --build ./Build + cd ./Build + mkdir -p ./tests/results + for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done; + for file in *runner_mpi ; do /opt/mpi/${{ matrix.mpilib }}/bin/mpirun -np 2 ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done; + lcov --directory . -b ../pennylane_lightning/src --capture --output-file coverage.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info + mv coverage.info coverage-${{ github.job }}-lightning_gpu.info - name: Upload test results uses: actions/upload-artifact@v3 @@ -254,10 +251,7 @@ jobs: - name: Install required packages run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load ${{ matrix.mpilib }} - module unload ${{ matrix.mpilib }} + source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }} export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/${{ matrix.mpilib }}/include:/opt/mpi/${{ matrix.mpilib }}/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/${{ matrix.mpilib }}/lib:$CUQUANTUM_SDK @@ -269,16 +263,15 @@ jobs: env: CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") run: | + source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }} PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=mpicxx;CMAKE_PREFIX_PATH=/opt/mpi/${{ matrix.mpilib }};ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" PL_BACKEND=lightning_gpu python -m pip install -e . --verbose - name: Run PennyLane-Lightning-GPU unit tests run: | - source /etc/profile.d/modules.sh - module use /opt/modules/ - module load ${{ matrix.mpilib }} + source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }} PL_DEVICE=lightning.gpu python -m pytest ./tests/ - PL_DEVICE=lightning.gpu /opt/mpi/${{ matrix.mpilib }}/bin/mpirun -np 2 python -m pytest ./mpitests/test_adjoint_jacobian.py + PL_DEVICE=lightning.gpu /opt/mpi/${{ matrix.mpilib }}/bin/mpirun -np 2 python -m pytest ./mpitests/ - name: Cleanup if: always() From 532364dc73b442249135057d634d43058b23a611 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Tue, 17 Oct 2023 13:23:25 -0400 Subject: [PATCH 37/44] Simplify mpi-gpu tests. --- .github/workflows/changelog_reminder.yml | 2 +- .github/workflows/format.yml | 2 +- .github/workflows/test_gpu_cu11.yml | 2 +- .github/workflows/tests_linux.yml | 2 +- .github/workflows/tests_linux_x86_mpi.yml | 31 +++++----------------- .github/workflows/tests_windows.yml | 2 +- .github/workflows/tests_without_binary.yml | 2 +- .github/workflows/update_dev_version.yml | 2 +- .github/workflows/wheel_linux_x86_64.yml | 2 +- .github/workflows/wheel_macos_arm64.yml | 2 +- .github/workflows/wheel_macos_x86_64.yml | 2 +- .github/workflows/wheel_noarch.yml | 2 +- .github/workflows/wheel_win_x86_64.yml | 2 +- 13 files changed, 19 insertions(+), 36 deletions(-) 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 c05c67a272..236599c148 100644 --- a/.github/workflows/test_gpu_cu11.yml +++ b/.github/workflows/test_gpu_cu11.yml @@ -1,6 +1,6 @@ name: Testing::Linux::x86_64::LGPU 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_linux_x86_mpi.yml b/.github/workflows/tests_linux_x86_mpi.yml index f403901b7d..ee4d0af285 100644 --- a/.github/workflows/tests_linux_x86_mpi.yml +++ b/.github/workflows/tests_linux_x86_mpi.yml @@ -96,31 +96,19 @@ jobs: - name: Validate GPU version and installed compiler run: | - source /etc/profile.d/modules.sh - module use /opt/modules - module load cuda/11.8 + source /etc/profile.d/modules.sh && module use /opt/modules && module load cuda/11.8 which -a nvcc nvcc --version - name: Validate Multi-GPU packages run: | - source /etc/profile.d/modules.sh - - module use /opt/modules/ - - echo 'Checking for OpenMPI' - module load openmpi - mpirun --version - which -a mpicc + source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }} + echo 'Checking for ${{ matrix.mpilib }}' which -a mpirun - module unload openmpi - - echo 'Checking for MPICH' - module load mpich - mpiexec --version - which -a mpicc - which -a mpiexec - module unload mpich + mpirun --version + which -a mpicxx + mpicxx --version + module unload ${{ matrix.mpilib }} - name: Install Latest PennyLane if: inputs.pennylane-version == 'latest' @@ -130,8 +118,6 @@ jobs: run: | source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }} export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/${{ matrix.mpilib }}/include:/opt/mpi/${{ matrix.mpilib }}/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/${{ matrix.mpilib }}/lib:$CUQUANTUM_SDK cmake . -BBuild \ -DPL_BACKEND=lightning_gpu \ -DCMAKE_PREFIX_PATH=/opt/mpi/${{ matrix.mpilib }}/ \ @@ -252,9 +238,6 @@ jobs: - name: Install required packages run: | source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }} - export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") - export PATH=$PATH:/usr/local/cuda/bin:/opt/mpi/${{ matrix.mpilib }}/include:/opt/mpi/${{ matrix.mpilib }}/bin - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/opt/mpi/${{ matrix.mpilib }}/lib:$CUQUANTUM_SDK python -m pip install pip~=22.0 python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv 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_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 From 816af1121ed11a1b033be7774bfb713e390c5bff Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 18 Oct 2023 09:14:36 -0400 Subject: [PATCH 38/44] trigger CI From 0326c06bcc22ad0e2e1d4b143514c69994264265 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 18 Oct 2023 09:58:53 -0400 Subject: [PATCH 39/44] unset CFLAGS. --- .github/workflows/tests_linux_x86_mpi.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpi.yml b/.github/workflows/tests_linux_x86_mpi.yml index ee4d0af285..da6fca19e6 100644 --- a/.github/workflows/tests_linux_x86_mpi.yml +++ b/.github/workflows/tests_linux_x86_mpi.yml @@ -117,10 +117,10 @@ jobs: - name: Build and run unit tests run: | source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }} + unset CFLAGS export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") cmake . -BBuild \ -DPL_BACKEND=lightning_gpu \ - -DCMAKE_PREFIX_PATH=/opt/mpi/${{ matrix.mpilib }}/ \ -DENABLE_MPI=ON \ -DCMAKE_BUILD_TYPE=Debug \ -DENABLE_COVERAGE=ON \ @@ -177,7 +177,7 @@ jobs: strategy: max-parallel: 1 matrix: - mpilib: ["openmpi"] + mpilib: ["mpich", "openmpi"] timeout-minutes: 30 steps: @@ -238,6 +238,7 @@ jobs: - name: Install required packages run: | source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }} + unset CFLAGS python -m pip install pip~=22.0 python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv @@ -247,7 +248,7 @@ jobs: CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") run: | source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }} - PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=mpicxx;CMAKE_PREFIX_PATH=/opt/mpi/${{ matrix.mpilib }};ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" + PL_BACKEND=lightning_gpu python setup.py build_ext -i --define="CMAKE_CXX_COMPILER=mpicxx;ENABLE_MPI=ON;CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc;CMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }};Python_EXECUTABLE=${{ steps.python_path.outputs.python }}" PL_BACKEND=lightning_gpu python -m pip install -e . --verbose - name: Run PennyLane-Lightning-GPU unit tests From f46a6aab227eb47be8f057e0dd226dad6a974226 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 18 Oct 2023 11:02:45 -0400 Subject: [PATCH 40/44] set CFLAGS --- .github/workflows/tests_linux_x86_mpi.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tests_linux_x86_mpi.yml b/.github/workflows/tests_linux_x86_mpi.yml index da6fca19e6..bca1cd4353 100644 --- a/.github/workflows/tests_linux_x86_mpi.yml +++ b/.github/workflows/tests_linux_x86_mpi.yml @@ -117,7 +117,6 @@ jobs: - name: Build and run unit tests run: | source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }} - unset CFLAGS export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") cmake . -BBuild \ -DPL_BACKEND=lightning_gpu \ @@ -238,7 +237,6 @@ jobs: - name: Install required packages run: | source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }} - unset CFLAGS python -m pip install pip~=22.0 python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv From 76f8e2d335cba45c1ba3579227f7dbe5b5e4e42f Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 18 Oct 2023 12:21:31 -0400 Subject: [PATCH 41/44] Revert triggers. --- .github/workflows/changelog_reminder.yml | 2 +- .github/workflows/format.yml | 2 +- .github/workflows/test_gpu_cu11.yml | 2 +- .github/workflows/tests_linux.yml | 2 +- .github/workflows/tests_linux_x86_mpi.yml | 2 +- .github/workflows/tests_windows.yml | 2 +- .github/workflows/tests_without_binary.yml | 2 +- .github/workflows/update_dev_version.yml | 2 +- .github/workflows/wheel_linux_x86_64.yml | 2 +- .github/workflows/wheel_macos_arm64.yml | 2 +- .github/workflows/wheel_macos_x86_64.yml | 2 +- .github/workflows/wheel_noarch.yml | 2 +- .github/workflows/wheel_win_x86_64.yml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/changelog_reminder.yml b/.github/workflows/changelog_reminder.yml index 4d3b120541..426312793c 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 449feeacd9..6fab24ec3a 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 236599c148..3f5ef8dc7c 100644 --- a/.github/workflows/test_gpu_cu11.yml +++ b/.github/workflows/test_gpu_cu11.yml @@ -1,6 +1,6 @@ name: Testing::Linux::x86_64::LGPU on: - #pull_request: + pull_request. push: branches: - master diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests_linux.yml index b04ce5fe10..42c5bc9098 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_linux_x86_mpi.yml b/.github/workflows/tests_linux_x86_mpi.yml index bca1cd4353..af162d42ce 100644 --- a/.github/workflows/tests_linux_x86_mpi.yml +++ b/.github/workflows/tests_linux_x86_mpi.yml @@ -253,7 +253,7 @@ jobs: run: | source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }} PL_DEVICE=lightning.gpu python -m pytest ./tests/ - PL_DEVICE=lightning.gpu /opt/mpi/${{ matrix.mpilib }}/bin/mpirun -np 2 python -m pytest ./mpitests/ + PL_DEVICE=lightning.gpu /opt/mpi/${{ matrix.mpilib }}/bin/mpirun -np 2 python -m pytest ./mpitests/test_adjoint_jacobian.py - name: Cleanup if: always() diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index 782831e269..c79b12c464 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 845b215e96..5a61ba2146 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 02062bdb5c..272c12347e 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 c8e99185bd..2bc777c76c 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_macos_arm64.yml b/.github/workflows/wheel_macos_arm64.yml index dde609f04a..91482ca864 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 6f58cbf6a1..c03e0627d7 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 000a800cf2..b31473c787 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 54552cce90..ca83b434a5 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 From e9589aedad14c1f7f1e70922991fdb1a26f9f224 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 18 Oct 2023 13:21:55 -0400 Subject: [PATCH 42/44] Fix pull_request: [skip ci] --- .github/workflows/changelog_reminder.yml | 2 +- .github/workflows/format.yml | 2 +- .github/workflows/test_gpu_cu11.yml | 2 +- .github/workflows/tests_linux.yml | 2 +- .github/workflows/tests_windows.yml | 2 +- .github/workflows/tests_without_binary.yml | 2 +- .github/workflows/update_dev_version.yml | 2 +- .github/workflows/wheel_linux_x86_64.yml | 2 +- .github/workflows/wheel_macos_arm64.yml | 2 +- .github/workflows/wheel_macos_x86_64.yml | 2 +- .github/workflows/wheel_noarch.yml | 2 +- .github/workflows/wheel_win_x86_64.yml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/changelog_reminder.yml b/.github/workflows/changelog_reminder.yml index 426312793c..2eb934c165 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 6fab24ec3a..6cbde05023 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 3f5ef8dc7c..c05c67a272 100644 --- a/.github/workflows/test_gpu_cu11.yml +++ b/.github/workflows/test_gpu_cu11.yml @@ -1,6 +1,6 @@ name: Testing::Linux::x86_64::LGPU on: - pull_request. + pull_request: push: branches: - master diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests_linux.yml index 42c5bc9098..a51db27345 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 c79b12c464..7500152af1 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 5a61ba2146..bb21da4cfb 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 272c12347e..bfa66e1e8b 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 2bc777c76c..486c480b04 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_macos_arm64.yml b/.github/workflows/wheel_macos_arm64.yml index 91482ca864..4e0449038c 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 c03e0627d7..e63cfb46d3 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 b31473c787..d3e6622730 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 ca83b434a5..2cbde98bbe 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 From 9bae63b9b1ad28539ea71f6916e844eec51c2f6d Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 18 Oct 2023 13:22:41 -0400 Subject: [PATCH 43/44] trigger CI From be492894cc0acb379e463b8f8a8e568cd88e5226 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 18 Oct 2023 14:12:11 -0400 Subject: [PATCH 44/44] Rename test_gpu_cu11.yml -> tests_gpu_cu11.yml [skip ci] --- .github/workflows/{test_gpu_cu11.yml => tests_gpu_cu11.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{test_gpu_cu11.yml => tests_gpu_cu11.yml} (100%) diff --git a/.github/workflows/test_gpu_cu11.yml b/.github/workflows/tests_gpu_cu11.yml similarity index 100% rename from .github/workflows/test_gpu_cu11.yml rename to .github/workflows/tests_gpu_cu11.yml