From 052c106023d09882d0ecc427a42babc5ef6b21dc Mon Sep 17 00:00:00 2001 From: Rashid N H M <95639609+rashidnhm@users.noreply.github.com> Date: Wed, 6 Sep 2023 10:01:54 -0400 Subject: [PATCH 001/113] Adding test workflow to trigger self-hosted runner build --- .github/workflows/test-gpu.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/test-gpu.yml diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml new file mode 100644 index 0000000000..be910609aa --- /dev/null +++ b/.github/workflows/test-gpu.yml @@ -0,0 +1,20 @@ +name: Testing (GPU) +on: + pull_request: + + + +concurrency: + group: tests_gpu-${{ github.ref }} + cancel-in-progress: true + + +jobs: + gpu_test: + runs-on: + - self-hosted + - ubuntu-22.04 + - gpu + + steps: + - run: nvidia-smi From f13670caec187bb2154c25cf675b116d7c7cafc1 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 6 Sep 2023 15:12:24 -0400 Subject: [PATCH 002/113] Add Kokkos CUDA build. --- .github/workflows/test-gpu.yml | 248 ++++++++++++++++++++- .github/workflows/tests_linux.yml | 2 +- .github/workflows/tests_windows.yml | 2 +- .github/workflows/tests_without_binary.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 +- 9 files changed, 253 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index be910609aa..9d58e7d234 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -4,17 +4,259 @@ on: + +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 + CI_CUDA_ARCH: 86 + concurrency: group: tests_gpu-${{ github.ref }} cancel-in-progress: true - jobs: - gpu_test: + builddeps: runs-on: - self-hosted - ubuntu-22.04 - gpu + strategy: + max-parallel: 1 + matrix: + exec_model: ["CUDA"] + kokkos_version: ["4.1.00"] + steps: - - run: nvidia-smi + # - name: Checkout PennyLane-Lightning-Kokkos + # 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-kokkos-version == 'stable' && 0 || 2 }} + + # - name: Switch to stable build of Lightning-Kokkos + # if: inputs.lightning-kokkos-version == 'stable' + # run: git checkout $(git tag | sort -V | tail -1) + + - uses: actions/setup-python@v4 + 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 pip) + # echo "PIP Path => $pip_path" + # echo "pip=$pip_path" >> $GITHUB_OUTPUT + + # - name: Install required packages + # run: | + # python -m pip install ninja cmake + + - name: Install dependencies + run: sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov + + - name: Validate GPU version and installed compiler + run: | + nvidia-smi + /usr/local/cuda/bin/nvcc --version + + # - name: Install Latest PennyLane + # if: inputs.pennylane-version == 'latest' + # run: | + # python -m pip install --index-url https://test.pypi.org/simple/ pennylane-lightning --pre --force-reinstall --no-deps + # python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master + + # - name: Build and run unit tests + # run: | + # export PATH=/usr/local/cuda-11.8/bin:$PATH + # export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH + # cmake . -BBuild \ + # -DKokkos_ENABLE_CUDA=ON \ + # -DKokkos_ENABLE_SERIAL=ON \ + # -DPLKOKKOS_BUILD_TESTS=ON \ + # -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ + # -G Ninja + # cmake --build ./Build + # ./Build/pennylane_lightning_kokkos/src/tests/runner_kokkos + + # - 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: Cache installation directories + id: kokkos-cache + uses: actions/cache@v3 + with: + path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} + key: ${{ inputs.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + + - name: Clone Kokkos repository + if: steps.kokkos-cache.outputs.cache-hit != 'true' + run: | + git clone https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} + cd kokkos_${{ matrix.exec_model }} + git checkout ${{ matrix.kokkos_version }} + cd - + pushd . &> /dev/null + + - name: Install dependencies (Ubuntu) + if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} + run: | + sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build git + + - name: Build Kokkos core library (Ubuntu) + if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} + run: | + mkdir -p ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} + cd kokkos + cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} \ + -DKokkos_ENABLE_COMPLEX_ALIGN=OFF \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_${{ matrix.exec_model }}=ON \ + -DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF \ + -DCMAKE_CXX_COMPILER="$(which g++-$GCC_VERSION)" \ + -DCMAKE_CXX_STANDARD=20 \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -G Ninja + cmake --build ./Build --verbose + cmake --install ./Build + cd - + + - name: Cleanup + if: always() + run: | + rm -rf * + rm -rf .git + rm -rf .gitignore + rm -rf .github + + # pythontests: + # runs-on: + # - self-hosted + # - ubuntu-22.04 + # - 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-kokkos-version == 'stable' && 0 || 2 }} + + # - name: Switch to stable build of Lightning-Kokkos + # if: inputs.lightning-kokkos-version == 'stable' + # run: git checkout $(git tag | sort -V | tail -1) + + # - uses: actions/setup-python@v4 + # 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 + # run: | + # python -m pip install pip~=22.3 + # python -m pip install ninja cmake pytest pytest-mock flaky pytest-cov wheel + # # Sync with latest master branches + # python -m pip install --index-url https://test.pypi.org/simple/ pennylane-lightning --pre --force-reinstall --no-deps + + # - name: Build and install package + # env: + # CMAKE_ARGS: -DKokkos_ENABLE_CUDA=ON + # CC: gcc-${{ env.GCC_VERSION }} + # CXX: g++-${{ env.GCC_VERSION }} + # run: | + # export PATH=/usr/local/cuda-11.8/bin:$PATH + # export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH + # python -m pip install -e . --verbose + + # - name: Run PennyLane-Lightning-Kokkos unit tests + # env: + # OMP_PROC_BIND: false + # run: | + # python -m pytest ./tests/ ${{ env.COVERAGE_FLAGS }} + # pl-device-test --device lightning.kokkos --skip-ops --shots=20000 ${{ env.COVERAGE_FLAGS }} --cov-append + # pl-device-test --device lightning.kokkos --shots=None --skip-ops ${{ env.COVERAGE_FLAGS }} --cov-append + # mv coverage.xml coverage-${{ github.job }}.xml + + # - name: Upload code coverage results + # uses: actions/upload-artifact@v3 + # with: + # name: ubuntu-codecov-results-python + # path: ./coverage-${{ github.job }}.xml + + # - name: Cleanup + # if: always() + # run: | + # rm -rf * + # rm -rf .git + # rm -rf .gitignore + # rm -rf .github diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests_linux.yml index ac9057fbef..65794593dd 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -1,6 +1,6 @@ name: Testing (Linux) on: - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index 6ccc95f0c8..6e98dab796 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 e674728e95..27edc3725c 100644 --- a/.github/workflows/tests_without_binary.yml +++ b/.github/workflows/tests_without_binary.yml @@ -3,7 +3,7 @@ on: push: branches: - master - pull_request: + #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" diff --git a/.github/workflows/wheel_linux_x86_64.yml b/.github/workflows/wheel_linux_x86_64.yml index b704c63796..2f15ac97ab 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 ab0f8f27cb..a9fbdc6bbd 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 91950f54d1..fa1492a68b 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 9b3bcb57be..d96f3fd802 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 0396cabc6b..cd0f9f64ca 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 8e6aa464758b40b02940495ffccd0e87bcee191a Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 6 Sep 2023 15:16:26 -0400 Subject: [PATCH 003/113] Turn off format.yml --- .github/workflows/format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From bce8c49b190ad7227964150bdc7bd8307e1879bb Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 6 Sep 2023 15:25:27 -0400 Subject: [PATCH 004/113] Force 1cache-hit --- .github/workflows/test-gpu.yml | 82 +++------------------------------- 1 file changed, 6 insertions(+), 76 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 9d58e7d234..dc8482e843 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -1,9 +1,9 @@ name: Testing (GPU) on: pull_request: - - - + push: + branches: + - master env: COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native" @@ -28,56 +28,12 @@ jobs: kokkos_version: ["4.1.00"] steps: - # - name: Checkout PennyLane-Lightning-Kokkos - # 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-kokkos-version == 'stable' && 0 || 2 }} - - # - name: Switch to stable build of Lightning-Kokkos - # if: inputs.lightning-kokkos-version == 'stable' - # run: git checkout $(git tag | sort -V | tail -1) - uses: actions/setup-python@v4 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 pip) - # echo "PIP Path => $pip_path" - # echo "pip=$pip_path" >> $GITHUB_OUTPUT - - # - name: Install required packages - # run: | - # python -m pip install ninja cmake - - name: Install dependencies run: sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov @@ -86,32 +42,6 @@ jobs: nvidia-smi /usr/local/cuda/bin/nvcc --version - # - name: Install Latest PennyLane - # if: inputs.pennylane-version == 'latest' - # run: | - # python -m pip install --index-url https://test.pypi.org/simple/ pennylane-lightning --pre --force-reinstall --no-deps - # python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master - - # - name: Build and run unit tests - # run: | - # export PATH=/usr/local/cuda-11.8/bin:$PATH - # export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH - # cmake . -BBuild \ - # -DKokkos_ENABLE_CUDA=ON \ - # -DKokkos_ENABLE_SERIAL=ON \ - # -DPLKOKKOS_BUILD_TESTS=ON \ - # -DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \ - # -G Ninja - # cmake --build ./Build - # ./Build/pennylane_lightning_kokkos/src/tests/runner_kokkos - - # - 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: Cache installation directories id: kokkos-cache uses: actions/cache@v3 @@ -120,7 +50,7 @@ jobs: key: ${{ inputs.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Clone Kokkos repository - if: steps.kokkos-cache.outputs.cache-hit != 'true' + # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | git clone https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} @@ -129,12 +59,12 @@ jobs: pushd . &> /dev/null - name: Install dependencies (Ubuntu) - if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} + # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} run: | sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build git - name: Build Kokkos core library (Ubuntu) - if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} + # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} run: | mkdir -p ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} cd kokkos From 69b1e3bcefcd5e510c421d0c76fde4f7f1e60e4c Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 6 Sep 2023 15:26:25 -0400 Subject: [PATCH 005/113] Fix repo path. --- .github/workflows/test-gpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index dc8482e843..cdec2ca5ff 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -67,7 +67,7 @@ jobs: # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} run: | mkdir -p ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} - cd kokkos + cd kokkos_${{ matrix.exec_model }} cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} \ -DKokkos_ENABLE_COMPLEX_ALIGN=OFF \ -DKokkos_ENABLE_SERIAL=ON \ From e52ac1b6e16d7cccd948fb000e6e53860437a8c3 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 6 Sep 2023 15:27:50 -0400 Subject: [PATCH 006/113] Add nvcc to path. --- .github/workflows/test-gpu.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index cdec2ca5ff..a01b47e923 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -66,6 +66,8 @@ jobs: - name: Build Kokkos core library (Ubuntu) # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} run: | + export PATH=/usr/local/cuda-11.8/bin:$PATH + export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH mkdir -p ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} \ From 3a40df348a48fc971861f47366768c0bea5d1683 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 6 Sep 2023 15:29:12 -0400 Subject: [PATCH 007/113] CUDA 12.0 --- .github/workflows/test-gpu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index a01b47e923..a4bedd95c6 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -66,8 +66,8 @@ jobs: - name: Build Kokkos core library (Ubuntu) # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} run: | - export PATH=/usr/local/cuda-11.8/bin:$PATH - export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH + export PATH=/usr/local/cuda-12.0/bin:$PATH + export LD_LIBRARY_PATH=/usr/local/cuda-12.0/lib64:$LD_LIBRARY_PATH mkdir -p ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} \ From 55b45c671a5345cfe3eaa7423dd174961ffd535e Mon Sep 17 00:00:00 2001 From: Dev version update bot Date: Mon, 11 Sep 2023 18:09:00 +0000 Subject: [PATCH 008/113] Auto update version --- pennylane_lightning/core/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index 43aeb117b5..29b3206d58 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.33.0-dev7" +__version__ = "0.33.0-dev8" From c1629600c377b495a0880518ca9847a3f66db531 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 11 Sep 2023 11:23:34 -0700 Subject: [PATCH 009/113] Load module. --- .github/workflows/test-gpu.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index a4bedd95c6..34414648ec 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -66,8 +66,9 @@ jobs: - name: Build Kokkos core library (Ubuntu) # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} run: | - export PATH=/usr/local/cuda-12.0/bin:$PATH - export LD_LIBRARY_PATH=/usr/local/cuda-12.0/lib64:$LD_LIBRARY_PATH + source /etc/profile.d/modules.sh + module use /opt/modules + module load cuda/12.2 mkdir -p ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} \ From 341ad20d1088567e988b258b7fcba0a2830b84b4 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 11 Sep 2023 11:25:28 -0700 Subject: [PATCH 010/113] Move cuda module up. --- .github/workflows/test-gpu.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 34414648ec..68b1f1f48d 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -35,7 +35,11 @@ jobs: python-version: '3.9' - name: Install dependencies - run: sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov + run: | + sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov + source /etc/profile.d/modules.sh + module use /opt/modules + module load cuda/12.2 - name: Validate GPU version and installed compiler run: | @@ -66,9 +70,6 @@ jobs: - name: Build Kokkos core library (Ubuntu) # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} run: | - source /etc/profile.d/modules.sh - module use /opt/modules - module load cuda/12.2 mkdir -p ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} \ From 12d7cd45d56fb3e5b2a376286aaafc50712d58f9 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 11 Sep 2023 11:26:45 -0700 Subject: [PATCH 011/113] Mod spider cuda. --- .github/workflows/test-gpu.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 68b1f1f48d..fa7b068e88 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -39,6 +39,7 @@ jobs: sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov source /etc/profile.d/modules.sh module use /opt/modules + module spider cuda module load cuda/12.2 - name: Validate GPU version and installed compiler From 47c4af1fdafeb881fb4126c84c2243a9baa6b32e Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 11 Sep 2023 11:35:11 -0700 Subject: [PATCH 012/113] Remove apt-get statements. --- .github/workflows/test-gpu.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index fa7b068e88..308d27ee32 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -36,7 +36,6 @@ jobs: - name: Install dependencies run: | - sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov source /etc/profile.d/modules.sh module use /opt/modules module spider cuda @@ -63,10 +62,10 @@ jobs: cd - pushd . &> /dev/null - - name: Install dependencies (Ubuntu) - # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} - run: | - sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build git + # - name: Install dependencies (Ubuntu) + # # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} + # run: | + # sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build git - name: Build Kokkos core library (Ubuntu) # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} From 0446c547985226043a73b73fcac41646444619cc Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 11 Sep 2023 11:36:11 -0700 Subject: [PATCH 013/113] Remove mod spider. --- .github/workflows/test-gpu.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 308d27ee32..544d7d6a03 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -38,7 +38,6 @@ jobs: run: | source /etc/profile.d/modules.sh module use /opt/modules - module spider cuda module load cuda/12.2 - name: Validate GPU version and installed compiler From 6a7bcd6f7ee74fd948b706e128a0ca608514c0c2 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 11 Sep 2023 11:40:19 -0700 Subject: [PATCH 014/113] ls module/cuda --- .github/workflows/test-gpu.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 544d7d6a03..d36d6865cc 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -38,6 +38,7 @@ jobs: run: | source /etc/profile.d/modules.sh module use /opt/modules + ls -l /opt/modules/cuda/12.2 module load cuda/12.2 - name: Validate GPU version and installed compiler From ae70b6b33e3ed93714d17cdbf08dca912dc8bdf8 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 11 Sep 2023 11:46:14 -0700 Subject: [PATCH 015/113] ls modules --- .github/workflows/test-gpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index d36d6865cc..171a1df3e8 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -38,7 +38,7 @@ jobs: run: | source /etc/profile.d/modules.sh module use /opt/modules - ls -l /opt/modules/cuda/12.2 + ls -l /opt/modules module load cuda/12.2 - name: Validate GPU version and installed compiler From ec9976239e887adcadb50bde4c491a1e80a668cd Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 11 Sep 2023 11:47:01 -0700 Subject: [PATCH 016/113] ls -l /opt/modules/cuda --- .github/workflows/test-gpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 171a1df3e8..74f5ec6ffb 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -38,7 +38,7 @@ jobs: run: | source /etc/profile.d/modules.sh module use /opt/modules - ls -l /opt/modules + ls -l /opt/modules/cuda module load cuda/12.2 - name: Validate GPU version and installed compiler From ee074b256ed17b41dc41cf925b90f00d1a93feca Mon Sep 17 00:00:00 2001 From: Rashid N H M <95639609+rashidnhm@users.noreply.github.com> Date: Wed, 13 Sep 2023 11:46:46 -0400 Subject: [PATCH 017/113] Try see nvcc --- .github/workflows/test-gpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 74f5ec6ffb..7e74138334 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -44,7 +44,7 @@ jobs: - name: Validate GPU version and installed compiler run: | nvidia-smi - /usr/local/cuda/bin/nvcc --version + nvcc --version - name: Cache installation directories id: kokkos-cache From 9e622cc12447f5e5c1f07cc4d0415125fd85f870 Mon Sep 17 00:00:00 2001 From: Dev version update bot Date: Wed, 13 Sep 2023 15:47:10 +0000 Subject: [PATCH 018/113] Auto update version --- pennylane_lightning/core/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index 29b3206d58..eb64c1463c 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.33.0-dev8" +__version__ = "0.33.0-dev9" From aeb7fe069e912cf9becb3a223a0ee78be62bcf55 Mon Sep 17 00:00:00 2001 From: Rashid N H M <95639609+rashidnhm@users.noreply.github.com> Date: Wed, 13 Sep 2023 11:54:15 -0400 Subject: [PATCH 019/113] Debug --- .github/workflows/test-gpu.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 7e74138334..b6232f95fd 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -43,6 +43,10 @@ jobs: - name: Validate GPU version and installed compiler run: | + set -x + echo $PATH + echo $LD_LIBRARY_PATH + nvidia-smi nvcc --version From 547ce79802cb334215b4140efde7401f05510923 Mon Sep 17 00:00:00 2001 From: Rashid N H M <95639609+rashidnhm@users.noreply.github.com> Date: Wed, 13 Sep 2023 11:57:22 -0400 Subject: [PATCH 020/113] Debug --- .github/workflows/test-gpu.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index b6232f95fd..f0b0084ee0 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -40,6 +40,8 @@ jobs: module use /opt/modules ls -l /opt/modules/cuda module load cuda/12.2 + echo $PATH + echo $LD_LIBRARY_PATH - name: Validate GPU version and installed compiler run: | From fe34f729810a782d14cc550aa7db49db1a7ffe7d Mon Sep 17 00:00:00 2001 From: Rashid N H M <95639609+rashidnhm@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:02:44 -0400 Subject: [PATCH 021/113] Debug --- .github/workflows/test-gpu.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index f0b0084ee0..fc0c292576 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -34,6 +34,14 @@ jobs: with: python-version: '3.9' + - run: | + set -x + echo $GITHUB_PATH + cat $GITHUB_PATH + + echo $GITHUB_ENV + cat $GITHUB_ENV + - name: Install dependencies run: | source /etc/profile.d/modules.sh From acfdb9b5df3748194ccb0ee90e6dc5c2bbc163c2 Mon Sep 17 00:00:00 2001 From: Rashid N H M <95639609+rashidnhm@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:07:21 -0400 Subject: [PATCH 022/113] Debug --- .github/workflows/test-gpu.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index fc0c292576..908135a617 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -34,14 +34,6 @@ jobs: with: python-version: '3.9' - - run: | - set -x - echo $GITHUB_PATH - cat $GITHUB_PATH - - echo $GITHUB_ENV - cat $GITHUB_ENV - - name: Install dependencies run: | source /etc/profile.d/modules.sh @@ -56,7 +48,7 @@ jobs: set -x echo $PATH echo $LD_LIBRARY_PATH - + module load cuda/12.2 nvidia-smi nvcc --version From 63bd74f8f18cd5e0ba2a3605d271b41a67cbbf54 Mon Sep 17 00:00:00 2001 From: Rashid N H M <95639609+rashidnhm@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:12:17 -0400 Subject: [PATCH 023/113] Debug --- .github/workflows/test-gpu.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 908135a617..20eb5769bf 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -34,22 +34,12 @@ jobs: with: python-version: '3.9' - - name: Install dependencies + - name: Validate GPU version and installed compiler run: | + nvidia-smi source /etc/profile.d/modules.sh module use /opt/modules - ls -l /opt/modules/cuda - module load cuda/12.2 - echo $PATH - echo $LD_LIBRARY_PATH - - - name: Validate GPU version and installed compiler - run: | - set -x - echo $PATH - echo $LD_LIBRARY_PATH module load cuda/12.2 - nvidia-smi nvcc --version - name: Cache installation directories @@ -76,6 +66,9 @@ jobs: - name: Build Kokkos core library (Ubuntu) # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} run: | + source /etc/profile.d/modules.sh + module use /opt/modules + module load cuda/12.2 mkdir -p ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} \ From 82120aefbadce7073059b4dc538a23ade52ca3e6 Mon Sep 17 00:00:00 2001 From: Rashid N H M <95639609+rashidnhm@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:15:44 -0400 Subject: [PATCH 024/113] Trigger CI From a4c006cca29901c2edac57b5bd32738de4f02b89 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 13 Sep 2023 16:55:02 -0400 Subject: [PATCH 025/113] Try export path. --- .github/workflows/test-gpu.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 20eb5769bf..939daa0826 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -40,6 +40,8 @@ jobs: source /etc/profile.d/modules.sh module use /opt/modules module load cuda/12.2 + echo "${PATH}" >> $GITHUB_PATH + echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV nvcc --version - name: Cache installation directories @@ -66,9 +68,9 @@ jobs: - name: Build Kokkos core library (Ubuntu) # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} run: | - source /etc/profile.d/modules.sh - module use /opt/modules - module load cuda/12.2 + # source /etc/profile.d/modules.sh + # module use /opt/modules + # module load cuda/12.2 mkdir -p ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} \ From e8d635af83188307744ec679ecad208039018222 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 13 Sep 2023 17:03:10 -0400 Subject: [PATCH 026/113] Add gpu cpp tests. --- .github/workflows/test-gpu.yml | 294 ++++++++++++++++++++------------- 1 file changed, 182 insertions(+), 112 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 939daa0826..c79d9230a3 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -52,7 +52,7 @@ jobs: key: ${{ inputs.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Clone Kokkos repository - # if: steps.kokkos-cache.outputs.cache-hit != 'true' + if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | git clone https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} @@ -60,17 +60,9 @@ jobs: cd - pushd . &> /dev/null - # - name: Install dependencies (Ubuntu) - # # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} - # run: | - # sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build git - - name: Build Kokkos core library (Ubuntu) - # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} + if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} run: | - # source /etc/profile.d/modules.sh - # module use /opt/modules - # module load cuda/12.2 mkdir -p ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} \ @@ -93,105 +85,183 @@ jobs: rm -rf .git rm -rf .gitignore rm -rf .github - - # pythontests: - # runs-on: - # - self-hosted - # - ubuntu-22.04 - # - 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-kokkos-version == 'stable' && 0 || 2 }} - - # - name: Switch to stable build of Lightning-Kokkos - # if: inputs.lightning-kokkos-version == 'stable' - # run: git checkout $(git tag | sort -V | tail -1) - - # - uses: actions/setup-python@v4 - # 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 - # run: | - # python -m pip install pip~=22.3 - # python -m pip install ninja cmake pytest pytest-mock flaky pytest-cov wheel - # # Sync with latest master branches - # python -m pip install --index-url https://test.pypi.org/simple/ pennylane-lightning --pre --force-reinstall --no-deps - - # - name: Build and install package - # env: - # CMAKE_ARGS: -DKokkos_ENABLE_CUDA=ON - # CC: gcc-${{ env.GCC_VERSION }} - # CXX: g++-${{ env.GCC_VERSION }} - # run: | - # export PATH=/usr/local/cuda-11.8/bin:$PATH - # export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH - # python -m pip install -e . --verbose - - # - name: Run PennyLane-Lightning-Kokkos unit tests - # env: - # OMP_PROC_BIND: false - # run: | - # python -m pytest ./tests/ ${{ env.COVERAGE_FLAGS }} - # pl-device-test --device lightning.kokkos --skip-ops --shots=20000 ${{ env.COVERAGE_FLAGS }} --cov-append - # pl-device-test --device lightning.kokkos --shots=None --skip-ops ${{ env.COVERAGE_FLAGS }} --cov-append - # mv coverage.xml coverage-${{ github.job }}.xml - - # - name: Upload code coverage results - # uses: actions/upload-artifact@v3 - # with: - # name: ubuntu-codecov-results-python - # path: ./coverage-${{ github.job }}.xml - - # - name: Cleanup - # if: always() - # run: | - # rm -rf * - # rm -rf .git - # rm -rf .gitignore - # rm -rf .github + + cpptestswithKokkos: + needs: [builddeps] + strategy: + matrix: + os: [ubuntu-22.04] + pl_backend: ["lightning_kokkos"] + exec_model: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.exec_model) }} + kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }} + + name: C++ tests (Kokkos) + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/setup-python@v4 + name: Install Python + with: + python-version: '3.9' + + - name: Checkout PennyLane-Lightning + uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - name: Restoring cached dependencies + id: kokkos-cache + uses: actions/cache@v3 + with: + path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} + key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + + - name: Copy cached libraries + run: | + mkdir Kokkos/ + cp -rf ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + + - name: Install dependencies + run: sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov + + - name: Build and run unit tests + run: | + cmake . -BBuild -G Ninja \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DBUILD_TESTS=ON \ + -DENABLE_PYTHON=OFF \ + -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ + -DPL_BACKEND=${{ matrix.pl_backend }} \ + -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) + cmake --build ./Build + cd ./Build + mkdir -p ./tests/results_${{ github.job }}_${{ matrix.pl_backend }} + for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results_${{ github.job }}_${{ matrix.pl_backend }}/report_$file.xml; done; + + - name: Upload test results + uses: actions/upload-artifact@v3 + if: always() + with: + name: ubuntu-tests-reports-${{ github.job }}_${{ matrix.pl_backend }} + path: ./Build/tests/results_${{ github.job }}_${{ matrix.pl_backend }} + + - name: Build and run unit tests for code coverage + run: | + cmake . -BBuildCov -G Ninja \ + -DCMAKE_BUILD_TYPE=Debug \ + -DBUILD_TESTS=ON \ + -DENABLE_PYTHON=OFF \ + -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ + -DPL_BACKEND=${{ matrix.pl_backend }} \ + -DENABLE_COVERAGE=ON \ + -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) + cmake --build ./BuildCov + cd ./BuildCov + for file in *runner ; do ./$file; done; + lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info + mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info + + - name: Upload code coverage results + uses: actions/upload-artifact@v3 + with: + name: ubuntu-codecov-results-cpp + path: ./BuildCov/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info + + pythontestswithKokkos: + needs: [builddeps] + strategy: + matrix: + os: [ubuntu-22.04] + pl_backend: ["lightning_kokkos"] + exec_model: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.exec_model) }} + kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }} + + name: Python tests with Kokkos + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout PennyLane-Lightning + uses: actions/checkout@v3 + with: + path: main + fetch-depth: 2 + + - uses: actions/setup-python@v4 + name: Install Python + with: + python-version: '3.9' + + - name: Restoring cached dependencies + id: kokkos-cache + uses: actions/cache@v3 + with: + path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} + key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + + - name: Copy cached libraries + run: | + mkdir Kokkos/ + cp -rf ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + pwd + + - name: Install dependencies + run: sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION + + - name: Get required Python packages + run: | + cd main + python -m pip install -r requirements-dev.txt + + - name: Install ML libraries for interfaces + run: | + python -m pip install --upgrade torch==$TORCH_VERSION -f https://download.pytorch.org/whl/cpu/torch_stable.html + python -m pip install --upgrade "jax[cpu]" # This also installs jaxlib + python -m pip install --upgrade tensorflow~=$TF_VERSION keras~=$TF_VERSION + + - name: Install backend device + if: ${{ matrix.pl_backend != 'all'}} + run: | + cd main + SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv + CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + python -m pip install -e . -vv + + - name: Run PennyLane-Lightning unit tests + if: ${{ matrix.pl_backend != 'all'}} + run: | + cd main/ + DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` + PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS + pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append + pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append + mv coverage.xml coverage-${{ github.job }}.xml + + - name: Install all backend devices + if: ${{ matrix.pl_backend == 'all' }} + run: | + cd main + CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + python -m pip install -e . -vv + rm -rf build + CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + python -m pip install -e . -vv + + - name: Run PennyLane-Lightning unit tests for lightning.qubit with all devices installed + if: ${{ matrix.pl_backend == 'all' }} + run: | + cd main/ + PL_DEVICE=lightning.qubit python -m pytest tests/ $COVERAGE_FLAGS + pl-device-test --device lightning.qubit --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append + pl-device-test --device lightning.qubit --shots=None --skip-ops $COVERAGE_FLAGS --cov-append + PL_DEVICE=lightning.kokkos python -m pytest tests/ $COVERAGE_FLAGS + pl-device-test --device lightning.kokkos --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append + pl-device-test --device lightning.kokkos --shots=None --skip-ops $COVERAGE_FLAGS --cov-append + mv coverage.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml + + - name: Upload code coverage results + uses: actions/upload-artifact@v3 + with: + name: ubuntu-codecov-results-python + path: ./main/coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml + \ No newline at end of file From c05735b59b3666fca5bf1ba22a498af5735797f7 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 13 Sep 2023 17:12:20 -0400 Subject: [PATCH 027/113] Fix exec_model. --- .github/workflows/test-gpu.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index c79d9230a3..416c5fc84e 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -92,8 +92,8 @@ jobs: matrix: os: [ubuntu-22.04] pl_backend: ["lightning_kokkos"] - exec_model: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.exec_model) }} - kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }} + exec_model: ["CUDA"] + kokkos_version: ["4.1.00"] name: C++ tests (Kokkos) runs-on: ${{ matrix.os }} @@ -174,8 +174,8 @@ jobs: matrix: os: [ubuntu-22.04] pl_backend: ["lightning_kokkos"] - exec_model: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.exec_model) }} - kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }} + exec_model: ["CUDA"] + kokkos_version: ["4.1.00"] name: Python tests with Kokkos runs-on: ${{ matrix.os }} From ce241177493ea1d19b4fb009414b047045c3d4f1 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 13 Sep 2023 17:16:40 -0400 Subject: [PATCH 028/113] dont hit cache --- .github/workflows/test-gpu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 416c5fc84e..8dc75f534e 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -52,7 +52,7 @@ jobs: key: ${{ inputs.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Clone Kokkos repository - if: steps.kokkos-cache.outputs.cache-hit != 'true' + # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | git clone https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} @@ -61,7 +61,7 @@ jobs: pushd . &> /dev/null - name: Build Kokkos core library (Ubuntu) - if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} + # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} run: | mkdir -p ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} From 23e197f459471a018f80b9895801f0011ed18033 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 13 Sep 2023 17:20:58 -0400 Subject: [PATCH 029/113] key inputs.os --- .github/workflows/test-gpu.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 8dc75f534e..d6b1e3a0ec 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -90,13 +90,12 @@ jobs: needs: [builddeps] strategy: matrix: - os: [ubuntu-22.04] pl_backend: ["lightning_kokkos"] exec_model: ["CUDA"] kokkos_version: ["4.1.00"] name: C++ tests (Kokkos) - runs-on: ${{ matrix.os }} + runs-on: ubuntu-22.04 steps: - uses: actions/setup-python@v4 @@ -114,7 +113,7 @@ jobs: uses: actions/cache@v3 with: path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} - key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + key: ${{ inputs.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | @@ -172,13 +171,12 @@ jobs: needs: [builddeps] strategy: matrix: - os: [ubuntu-22.04] pl_backend: ["lightning_kokkos"] exec_model: ["CUDA"] kokkos_version: ["4.1.00"] name: Python tests with Kokkos - runs-on: ${{ matrix.os }} + runs-on: ubuntu-22.04 steps: - name: Checkout PennyLane-Lightning @@ -197,7 +195,7 @@ jobs: uses: actions/cache@v3 with: path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} - key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + key: ${{ inputs.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | From 3cf70049b8430ddbac7fd5802fa51b0823ad680b Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 13:47:37 -0400 Subject: [PATCH 030/113] Fix kokkos install? --- .github/workflows/test-gpu.yml | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index d6b1e3a0ec..e1252017b2 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -29,30 +29,26 @@ jobs: steps: - - uses: actions/setup-python@v4 - name: Install Python + - name: Cache installation directories + id: kokkos-cache + uses: actions/cache@v3 with: - python-version: '3.9' + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + key: ${{ inputs.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Validate GPU version and installed compiler + if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - nvidia-smi source /etc/profile.d/modules.sh module use /opt/modules module load cuda/12.2 echo "${PATH}" >> $GITHUB_PATH echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV nvcc --version - - - name: Cache installation directories - id: kokkos-cache - uses: actions/cache@v3 - with: - path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} - key: ${{ inputs.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + nvidia-smi - name: Clone Kokkos repository - # if: steps.kokkos-cache.outputs.cache-hit != 'true' + if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | git clone https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} @@ -61,11 +57,11 @@ jobs: pushd . &> /dev/null - name: Build Kokkos core library (Ubuntu) - # if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }} + if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - mkdir -p ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} + mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} - cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} \ + cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} \ -DKokkos_ENABLE_COMPLEX_ALIGN=OFF \ -DKokkos_ENABLE_SERIAL=ON \ -DKokkos_ENABLE_${{ matrix.exec_model }}=ON \ @@ -112,13 +108,13 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} key: ${{ inputs.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | mkdir Kokkos/ - cp -rf ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - name: Install dependencies run: sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov @@ -194,13 +190,13 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} key: ${{ inputs.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | mkdir Kokkos/ - cp -rf ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ pwd - name: Install dependencies From 96e095a631788e5b3aa5cbe26a8565b96d660040 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 13:48:23 -0400 Subject: [PATCH 031/113] Remove cleanup setp. --- .github/workflows/test-gpu.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index e1252017b2..45029737ec 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -74,14 +74,6 @@ jobs: cmake --install ./Build cd - - - name: Cleanup - if: always() - run: | - rm -rf * - rm -rf .git - rm -rf .gitignore - rm -rf .github - cpptestswithKokkos: needs: [builddeps] strategy: From 4bab1c4c6240251dc5748ac466949e7de7369466 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 14:00:29 -0400 Subject: [PATCH 032/113] Always source cuda-12 mod. --- .github/workflows/test-gpu.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 45029737ec..e2547fa80b 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -28,7 +28,6 @@ jobs: kokkos_version: ["4.1.00"] steps: - - name: Cache installation directories id: kokkos-cache uses: actions/cache@v3 @@ -37,7 +36,6 @@ jobs: key: ${{ inputs.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Validate GPU version and installed compiler - if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | source /etc/profile.d/modules.sh module use /opt/modules From c45643ad6faead6d767e2a1bc419144c9011f3f4 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 14:04:02 -0400 Subject: [PATCH 033/113] Try that --- .github/workflows/test-gpu.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index e2547fa80b..a483e608ba 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -46,16 +46,17 @@ jobs: nvidia-smi - name: Clone Kokkos repository - if: steps.kokkos-cache.outputs.cache-hit != 'true' + # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - git clone https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} + git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git kokkos_${{ matrix.exec_model }} + # git clone https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} git checkout ${{ matrix.kokkos_version }} cd - pushd . &> /dev/null - name: Build Kokkos core library (Ubuntu) - if: steps.kokkos-cache.outputs.cache-hit != 'true' + # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} From d4abc376bd9e20b332452ad53d5f003a362a7349 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 14:08:54 -0400 Subject: [PATCH 034/113] Fix key --- .github/workflows/test-gpu.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index a483e608ba..6a63f32b75 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -24,6 +24,7 @@ jobs: strategy: max-parallel: 1 matrix: + os: [ubuntu-22.04] exec_model: ["CUDA"] kokkos_version: ["4.1.00"] @@ -33,7 +34,7 @@ jobs: uses: actions/cache@v3 with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - key: ${{ inputs.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Validate GPU version and installed compiler run: | @@ -46,7 +47,7 @@ jobs: nvidia-smi - name: Clone Kokkos repository - # if: steps.kokkos-cache.outputs.cache-hit != 'true' + if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git kokkos_${{ matrix.exec_model }} # git clone https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} @@ -56,7 +57,7 @@ jobs: pushd . &> /dev/null - name: Build Kokkos core library (Ubuntu) - # if: steps.kokkos-cache.outputs.cache-hit != 'true' + if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} @@ -77,6 +78,7 @@ jobs: needs: [builddeps] strategy: matrix: + os: [ubuntu-22.04] pl_backend: ["lightning_kokkos"] exec_model: ["CUDA"] kokkos_version: ["4.1.00"] @@ -100,7 +102,7 @@ jobs: uses: actions/cache@v3 with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - key: ${{ inputs.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | @@ -158,6 +160,7 @@ jobs: needs: [builddeps] strategy: matrix: + os: [ubuntu-22.04] pl_backend: ["lightning_kokkos"] exec_model: ["CUDA"] kokkos_version: ["4.1.00"] @@ -182,7 +185,7 @@ jobs: uses: actions/cache@v3 with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - key: ${{ inputs.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | From 9112dee02513216255949191144018698c55f1b0 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 14:09:45 -0400 Subject: [PATCH 035/113] Clear before cloning kokkos. --- .github/workflows/test-gpu.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 6a63f32b75..8f2c2bcbde 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -49,6 +49,7 @@ jobs: - name: Clone Kokkos repository if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | + rm -rf kokkos_${{ matrix.exec_model }} git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git kokkos_${{ matrix.exec_model }} # git clone https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} From f76a96b0a133ff8d0dfdf90632a95e7d06650630 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 14:12:20 -0400 Subject: [PATCH 036/113] No need to checkout kokkos ver. --- .github/workflows/test-gpu.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 8f2c2bcbde..f597d559b5 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -52,9 +52,9 @@ jobs: rm -rf kokkos_${{ matrix.exec_model }} git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git kokkos_${{ matrix.exec_model }} # git clone https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} - cd kokkos_${{ matrix.exec_model }} - git checkout ${{ matrix.kokkos_version }} - cd - + # cd kokkos_${{ matrix.exec_model }} + # git checkout ${{ matrix.kokkos_version }} + # cd - pushd . &> /dev/null - name: Build Kokkos core library (Ubuntu) From b514740f895efe5185b8e6d10fc4d94eda006c0a Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 14:32:10 -0400 Subject: [PATCH 037/113] git clone --branch --- .../build_and_cache_Kokkos_linux.yml | 5 +--- .github/workflows/test-gpu.yml | 30 +++++++++---------- .github/workflows/tests_windows.yml | 5 +--- .github/workflows/wheel_linux_aarch64.yml | 5 +--- .github/workflows/wheel_linux_ppc64le.yml | 5 +--- .github/workflows/wheel_linux_x86_64.yml | 5 +--- .github/workflows/wheel_macos_x86_64.yml | 5 +--- .github/workflows/wheel_win_x86_64.yml | 5 +--- 8 files changed, 21 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build_and_cache_Kokkos_linux.yml b/.github/workflows/build_and_cache_Kokkos_linux.yml index 3129bcb0d8..a6bb7fdfbc 100644 --- a/.github/workflows/build_and_cache_Kokkos_linux.yml +++ b/.github/workflows/build_and_cache_Kokkos_linux.yml @@ -60,10 +60,7 @@ jobs: - name: Clone Kokkos repository if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - git clone https://github.com/kokkos/kokkos.git - cd kokkos - git checkout ${{ matrix.kokkos_version }} - cd - + git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git pushd . &> /dev/null - name: Install dependencies (Ubuntu) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index f597d559b5..378e4d09ec 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -51,15 +51,13 @@ jobs: run: | rm -rf kokkos_${{ matrix.exec_model }} git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git kokkos_${{ matrix.exec_model }} - # git clone https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} - # cd kokkos_${{ matrix.exec_model }} - # git checkout ${{ matrix.kokkos_version }} - # cd - + # git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} pushd . &> /dev/null - name: Build Kokkos core library (Ubuntu) if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | + rm -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} \ @@ -85,19 +83,9 @@ jobs: kokkos_version: ["4.1.00"] name: C++ tests (Kokkos) - runs-on: ubuntu-22.04 + runs-on: ${{ matrix.os }} steps: - - uses: actions/setup-python@v4 - name: Install Python - with: - python-version: '3.9' - - - name: Checkout PennyLane-Lightning - uses: actions/checkout@v3 - with: - fetch-depth: 2 - - name: Restoring cached dependencies id: kokkos-cache uses: actions/cache@v3 @@ -110,6 +98,16 @@ jobs: mkdir Kokkos/ cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + - uses: actions/setup-python@v4 + name: Install Python + with: + python-version: '3.9' + + - name: Checkout PennyLane-Lightning + uses: actions/checkout@v3 + with: + fetch-depth: 2 + - name: Install dependencies run: sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov @@ -167,7 +165,7 @@ jobs: kokkos_version: ["4.1.00"] name: Python tests with Kokkos - runs-on: ubuntu-22.04 + runs-on: ${{ matrix.os }} steps: - name: Checkout PennyLane-Lightning diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index 6e98dab796..54becc8095 100644 --- a/.github/workflows/tests_windows.yml +++ b/.github/workflows/tests_windows.yml @@ -114,10 +114,7 @@ jobs: if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | cd D:\a - git clone https://github.com/kokkos/kokkos.git - cd D:\a\kokkos - git checkout ${{ matrix.kokkos_version }} - cd .. + git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git - name: Create installation directory if: steps.kokkos-cache.outputs.cache-hit != 'true' diff --git a/.github/workflows/wheel_linux_aarch64.yml b/.github/workflows/wheel_linux_aarch64.yml index fe4fc1cf11..5b4a331818 100644 --- a/.github/workflows/wheel_linux_aarch64.yml +++ b/.github/workflows/wheel_linux_aarch64.yml @@ -47,10 +47,7 @@ jobs: - name: Clone Kokkos libs if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - git clone https://github.com/kokkos/kokkos.git - cd kokkos - git checkout ${{ matrix.kokkos_version }} - cd - + git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git pushd . &> /dev/null - uses: docker/setup-qemu-action@v2 diff --git a/.github/workflows/wheel_linux_ppc64le.yml b/.github/workflows/wheel_linux_ppc64le.yml index 98d22db51d..a0325b3f49 100644 --- a/.github/workflows/wheel_linux_ppc64le.yml +++ b/.github/workflows/wheel_linux_ppc64le.yml @@ -47,10 +47,7 @@ jobs: - name: Clone Kokkos libs if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - git clone https://github.com/kokkos/kokkos.git - cd kokkos - git checkout ${{ matrix.kokkos_version }} - cd - + git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git pushd . &> /dev/null - uses: docker/setup-qemu-action@v2 diff --git a/.github/workflows/wheel_linux_x86_64.yml b/.github/workflows/wheel_linux_x86_64.yml index 2f15ac97ab..e4c277b2ac 100644 --- a/.github/workflows/wheel_linux_x86_64.yml +++ b/.github/workflows/wheel_linux_x86_64.yml @@ -63,10 +63,7 @@ jobs: - name: Clone Kokkos libs if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - git clone https://github.com/kokkos/kokkos.git - cd kokkos - git checkout ${{ matrix.kokkos_version }} - cd - + git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git pushd . &> /dev/null - name: Build Kokkos core library diff --git a/.github/workflows/wheel_macos_x86_64.yml b/.github/workflows/wheel_macos_x86_64.yml index fa1492a68b..58dfbbd149 100644 --- a/.github/workflows/wheel_macos_x86_64.yml +++ b/.github/workflows/wheel_macos_x86_64.yml @@ -54,10 +54,7 @@ jobs: - name: Clone Kokkos libs if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - git clone https://github.com/kokkos/kokkos.git - cd kokkos - git checkout ${{ matrix.kokkos_version }} - cd - + git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git pushd . &> /dev/null - uses: actions/setup-python@v4 diff --git a/.github/workflows/wheel_win_x86_64.yml b/.github/workflows/wheel_win_x86_64.yml index cd0f9f64ca..e34db4b094 100644 --- a/.github/workflows/wheel_win_x86_64.yml +++ b/.github/workflows/wheel_win_x86_64.yml @@ -52,10 +52,7 @@ jobs: if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | cd D:\a - git clone https://github.com/kokkos/kokkos.git - cd D:\a\kokkos - git checkout ${{ matrix.kokkos_version }} - cd .. + git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git - name: Create installation directory if: steps.kokkos-cache.outputs.cache-hit != 'true' From 701fa3d2988dfa7c7e5e575c3c19d4b1eaa0807e Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 15:00:32 -0400 Subject: [PATCH 038/113] Merge coverage with tests. Move cache up in pythontests. --- .github/workflows/test-gpu.yml | 51 +++++++++++++--------------------- Makefile | 4 +-- README.rst | 5 ++-- 3 files changed, 23 insertions(+), 37 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 378e4d09ec..a01822cd97 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -34,7 +34,7 @@ jobs: uses: actions/cache@v3 with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Validate GPU version and installed compiler run: | @@ -91,7 +91,7 @@ jobs: uses: actions/cache@v3 with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | @@ -120,10 +120,15 @@ jobs: -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ -DPL_BACKEND=${{ matrix.pl_backend }} \ -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) + -DENABLE_COVERAGE=ON cmake --build ./Build cd ./Build mkdir -p ./tests/results_${{ github.job }}_${{ matrix.pl_backend }} for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results_${{ github.job }}_${{ matrix.pl_backend }}/report_$file.xml; done; + for file in *runner ; do ./$file; done; + lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info + mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info - name: Upload test results uses: actions/upload-artifact@v3 @@ -132,23 +137,6 @@ jobs: name: ubuntu-tests-reports-${{ github.job }}_${{ matrix.pl_backend }} path: ./Build/tests/results_${{ github.job }}_${{ matrix.pl_backend }} - - name: Build and run unit tests for code coverage - run: | - cmake . -BBuildCov -G Ninja \ - -DCMAKE_BUILD_TYPE=Debug \ - -DBUILD_TESTS=ON \ - -DENABLE_PYTHON=OFF \ - -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ - -DPL_BACKEND=${{ matrix.pl_backend }} \ - -DENABLE_COVERAGE=ON \ - -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) - cmake --build ./BuildCov - cd ./BuildCov - for file in *runner ; do ./$file; done; - lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info - lcov --remove coverage.info '/usr/*' --output-file coverage.info - mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info - - name: Upload code coverage results uses: actions/upload-artifact@v3 with: @@ -168,29 +156,28 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Checkout PennyLane-Lightning - uses: actions/checkout@v3 - with: - path: main - fetch-depth: 2 - - - uses: actions/setup-python@v4 - name: Install Python - with: - python-version: '3.9' - - name: Restoring cached dependencies id: kokkos-cache uses: actions/cache@v3 with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | mkdir Kokkos/ cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - pwd + + - name: Checkout PennyLane-Lightning + uses: actions/checkout@v3 + with: + path: main + fetch-depth: 2 + + - uses: actions/setup-python@v4 + name: Install Python + with: + python-version: '3.9' - name: Install dependencies run: sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION diff --git a/Makefile b/Makefile index 5c7e22d732..333eb6924d 100644 --- a/Makefile +++ b/Makefile @@ -80,12 +80,12 @@ coverage-cpp: build: rm -rf ./Build - cmake -BBuild -G Ninja -DENABLE_BLAS=ON -DENABLE_KOKKOS=ON -DENABLE_WARNINGS=ON -DPL_BACKEND=$(PL_BACKEND) + cmake -BBuild -G Ninja -DENABLE_BLAS=ON -DENABLE_WARNINGS=ON -DPL_BACKEND=$(PL_BACKEND) cmake --build ./Build $(VERBOSE) test-cpp: rm -rf ./BuildTests - cmake -BBuildTests -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DENABLE_KOKKOS=ON -DENABLE_OPENMP=ON -DENABLE_WARNINGS=ON -DPL_BACKEND=$(PL_BACKEND) + cmake -BBuildTests -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DENABLE_OPENMP=ON -DENABLE_WARNINGS=ON -DPL_BACKEND=$(PL_BACKEND) ifdef target cmake --build ./BuildTests $(VERBOSE) --target $(target) OMP_PROC_BIND=false ./BuildTests/$(target) diff --git a/README.rst b/README.rst index 8b406fc103..957e7501d1 100644 --- a/README.rst +++ b/README.rst @@ -100,13 +100,13 @@ You can also pass ``cmake`` options with ``CMAKE_ARGS`` as follows: .. code-block:: console - $ CMAKE_ARGS="-DENABLE_OPENMP=OFF -DENABLE_BLAS=OFF -DENABLE_KOKKOS=OFF" pip install -e . -vv + $ CMAKE_ARGS="-DENABLE_OPENMP=OFF -DENABLE_BLAS=OFF" pip install -e . -vv or with ``build_ext`` and the ``--define`` flag as follows: .. code-block:: console - $ python3 setup.py build_ext -i --define="ENABLE_OPENMP=OFF;ENABLE_BLAS=OFF;ENABLE_KOKKOS=OFF" + $ python3 setup.py build_ext -i --define="ENABLE_OPENMP=OFF;ENABLE_BLAS=OFF" $ python3 setup.py develop @@ -151,7 +151,6 @@ Other supported options are - ``-DENABLE_NATIVE=ON`` (for ``-march=native``) - ``-DENABLE_BLAS=ON`` - ``-DENABLE_OPENMP=ON`` -- ``-DENABLE_KOKKOS=ON`` - ``-DENABLE_CLANG_TIDY=ON`` Compile on Windows with MSVC From ad78afd399772e753968fe522de3ca4a7cd2cc6f Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 15:04:27 -0400 Subject: [PATCH 039/113] trigger CI From 097c08f8d11bc7b2be5dfcc8027972f0a89315fd Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 15:06:56 -0400 Subject: [PATCH 040/113] Comment cache-hit. --- .github/workflows/test-gpu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index a01822cd97..29b681bab4 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -47,7 +47,7 @@ jobs: nvidia-smi - name: Clone Kokkos repository - if: steps.kokkos-cache.outputs.cache-hit != 'true' + # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | rm -rf kokkos_${{ matrix.exec_model }} git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git kokkos_${{ matrix.exec_model }} @@ -55,7 +55,7 @@ jobs: pushd . &> /dev/null - name: Build Kokkos core library (Ubuntu) - if: steps.kokkos-cache.outputs.cache-hit != 'true' + # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | rm -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} From 8fe637e92b8c563b793ea032eba4d46c553e1188 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 15:12:21 -0400 Subject: [PATCH 041/113] Clean Kokkos before copying. --- .github/workflows/test-gpu.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 29b681bab4..be24a2f247 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -95,6 +95,7 @@ jobs: - name: Copy cached libraries run: | + rm -rf Kokkos mkdir Kokkos/ cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ @@ -165,6 +166,7 @@ jobs: - name: Copy cached libraries run: | + rm -rf Kokkos mkdir Kokkos/ cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ From 15b4a834546d55667fb66850a22398b745461fff Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 15:13:55 -0400 Subject: [PATCH 042/113] Fix cmake -B step in cpp tests. --- .github/workflows/test-gpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index be24a2f247..c3c175f4a6 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -120,7 +120,7 @@ jobs: -DENABLE_PYTHON=OFF \ -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ -DPL_BACKEND=${{ matrix.pl_backend }} \ - -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) + -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \ -DENABLE_COVERAGE=ON cmake --build ./Build cd ./Build From a07dd4353cc3f1f44bf30aac62f96dc30fa6f1b6 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 15:15:07 -0400 Subject: [PATCH 043/113] trigger CI From 63cb42f2f7ca2602fd2a8693ceea755555782b65 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 15:24:01 -0400 Subject: [PATCH 044/113] fail-on-cache-miss --- .github/workflows/test-gpu.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index c3c175f4a6..ebc1adbb2d 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -92,6 +92,7 @@ jobs: with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + fail-on-cache-miss: true - name: Copy cached libraries run: | @@ -115,7 +116,7 @@ jobs: - name: Build and run unit tests run: | cmake . -BBuild -G Ninja \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_TESTS=ON \ -DENABLE_PYTHON=OFF \ -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ @@ -126,7 +127,6 @@ jobs: cd ./Build mkdir -p ./tests/results_${{ github.job }}_${{ matrix.pl_backend }} for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results_${{ github.job }}_${{ matrix.pl_backend }}/report_$file.xml; done; - for file in *runner ; do ./$file; done; lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info lcov --remove coverage.info '/usr/*' --output-file coverage.info mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info @@ -163,6 +163,7 @@ jobs: with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + fail-on-cache-miss: true - name: Copy cached libraries run: | From 4378148a83f2961425ee43e9483b84b287256758 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 15:25:07 -0400 Subject: [PATCH 045/113] Fix buildcov path --- .github/workflows/test-gpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index ebc1adbb2d..a31481f006 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -142,7 +142,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: ubuntu-codecov-results-cpp - path: ./BuildCov/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info + path: ./Build/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info pythontestswithKokkos: needs: [builddeps] From c6258ef8943ecaeec2b9370ee69efcd4454e39c5 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 15:29:48 -0400 Subject: [PATCH 046/113] sleep --- .github/workflows/test-gpu.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index a31481f006..aeddbc86da 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -73,6 +73,10 @@ jobs: cmake --install ./Build cd - + - name: Sleep for 10 seconds to upload cache + run: sleep 10s + shell: bash + cpptestswithKokkos: needs: [builddeps] strategy: From c56a85889d0883e548125fcfce1e7837f4f30b58 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 15:36:18 -0400 Subject: [PATCH 047/113] if-no-files-found: error --- .github/workflows/test-gpu.yml | 5 ++++- .github/workflows/tests_linux.yml | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index aeddbc86da..08f34c49db 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -6,9 +6,10 @@ on: - master env: + CI_CUDA_ARCH: 86 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 - CI_CUDA_ARCH: 86 + TORCH_VERSION: 1.11.0+cpu concurrency: group: tests_gpu-${{ github.ref }} @@ -141,12 +142,14 @@ jobs: with: name: ubuntu-tests-reports-${{ github.job }}_${{ matrix.pl_backend }} path: ./Build/tests/results_${{ github.job }}_${{ matrix.pl_backend }} + if-no-files-found: error - name: Upload code coverage results uses: actions/upload-artifact@v3 with: name: ubuntu-codecov-results-cpp path: ./Build/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info + if-no-files-found: error pythontestswithKokkos: needs: [builddeps] diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests_linux.yml index f1901d5d97..23f02f78f6 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -59,6 +59,7 @@ jobs: with: name: ubuntu-tests-reports-${{ github.job }}-${{ matrix.pl_backend }} path: ./Build/tests/results/ + if-no-files-found: error - name: Build and run unit tests for code coverage run: | @@ -81,7 +82,7 @@ jobs: with: name: ubuntu-codecov-results-cpp path: ./BuildCov/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info - + if-no-files-found: error pythontests: strategy: @@ -182,6 +183,7 @@ jobs: with: name: ubuntu-tests-reports-${{ github.job }}-${{ matrix.pl_backend }} path: ./Build/tests/results/ + if-no-files-found: error - name: Build and run unit tests for code coverage run: | @@ -205,6 +207,7 @@ jobs: with: name: ubuntu-codecov-results-cpp path: ./BuildCov/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info + if-no-files-found: error pythontestswithOpenBLAS: strategy: @@ -326,6 +329,7 @@ jobs: with: name: ubuntu-tests-reports-${{ github.job }}_${{ matrix.pl_backend }} path: ./Build/tests/results_${{ github.job }}_${{ matrix.pl_backend }} + if-no-files-found: error - name: Build and run unit tests for code coverage run: | @@ -349,6 +353,7 @@ jobs: with: name: ubuntu-codecov-results-cpp path: ./BuildCov/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info + if-no-files-found: error pythontestswithKokkos: needs: [build_and_cache_Kokkos] @@ -544,3 +549,4 @@ jobs: with: name: ubuntu-tests-reports-${{ github.job }}-multiple-backends path: ./Build/tests/results_multiple_backends/ + if-no-files-found: error From 4a665928dd51cace56948ff790cb90d48841cd4a Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 15:49:43 -0400 Subject: [PATCH 048/113] fail-on-cache-miss everywhere. --- .github/workflows/format.yml | 1 + .github/workflows/tests_linux.yml | 3 +++ .github/workflows/wheel_linux_ppc64le.yml | 1 + .github/workflows/wheel_linux_x86_64.yml | 1 + .github/workflows/wheel_macos_x86_64.yml | 1 + .github/workflows/wheel_win_x86_64.yml | 1 + 6 files changed, 8 insertions(+) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 449feeacd9..4d93162337 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -77,6 +77,7 @@ jobs: with: path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + fail-on-cache-miss: true - name: Copy cached libraries run: | diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests_linux.yml index 23f02f78f6..cbba54ba75 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -300,6 +300,7 @@ jobs: with: path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + fail-on-cache-miss: true - name: Copy cached libraries run: | @@ -388,6 +389,7 @@ jobs: with: path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + fail-on-cache-miss: true - name: Copy cached libraries run: | @@ -520,6 +522,7 @@ jobs: with: path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + fail-on-cache-miss: true - name: Copy cached libraries run: | diff --git a/.github/workflows/wheel_linux_ppc64le.yml b/.github/workflows/wheel_linux_ppc64le.yml index a0325b3f49..0060749dad 100644 --- a/.github/workflows/wheel_linux_ppc64le.yml +++ b/.github/workflows/wheel_linux_ppc64le.yml @@ -105,6 +105,7 @@ jobs: with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + fail-on-cache-miss: true - name: Copy cached libraries run: | diff --git a/.github/workflows/wheel_linux_x86_64.yml b/.github/workflows/wheel_linux_x86_64.yml index e4c277b2ac..6fd64ad9eb 100644 --- a/.github/workflows/wheel_linux_x86_64.yml +++ b/.github/workflows/wheel_linux_x86_64.yml @@ -108,6 +108,7 @@ jobs: with: path: /root/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + fail-on-cache-miss: true - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 diff --git a/.github/workflows/wheel_macos_x86_64.yml b/.github/workflows/wheel_macos_x86_64.yml index 58dfbbd149..377d769a62 100644 --- a/.github/workflows/wheel_macos_x86_64.yml +++ b/.github/workflows/wheel_macos_x86_64.yml @@ -108,6 +108,7 @@ jobs: with: path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + fail-on-cache-miss: true - name: Copy cached libraries run: | diff --git a/.github/workflows/wheel_win_x86_64.yml b/.github/workflows/wheel_win_x86_64.yml index e34db4b094..c3044861f4 100644 --- a/.github/workflows/wheel_win_x86_64.yml +++ b/.github/workflows/wheel_win_x86_64.yml @@ -103,6 +103,7 @@ jobs: with: path: D:\a\install_dir\${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-RelWithDebInfo + fail-on-cache-miss: true - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 From a822e4299323161f26163929d13e605399e7a45e Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 15:53:43 -0400 Subject: [PATCH 049/113] Reenable pull_request trigger. --- .github/workflows/format.yml | 2 +- .github/workflows/test-gpu.yml | 8 ++------ .github/workflows/tests_linux.yml | 2 +- .github/workflows/tests_windows.yml | 2 +- .github/workflows/tests_without_binary.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 +- 10 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 4d93162337..653ca82abd 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.yml b/.github/workflows/test-gpu.yml index 08f34c49db..48edb12f69 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -48,7 +48,7 @@ jobs: nvidia-smi - name: Clone Kokkos repository - # if: steps.kokkos-cache.outputs.cache-hit != 'true' + if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | rm -rf kokkos_${{ matrix.exec_model }} git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git kokkos_${{ matrix.exec_model }} @@ -56,7 +56,7 @@ jobs: pushd . &> /dev/null - name: Build Kokkos core library (Ubuntu) - # if: steps.kokkos-cache.outputs.cache-hit != 'true' + if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | rm -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} @@ -74,10 +74,6 @@ jobs: cmake --install ./Build cd - - - name: Sleep for 10 seconds to upload cache - run: sleep 10s - shell: bash - cpptestswithKokkos: needs: [builddeps] strategy: diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests_linux.yml index cbba54ba75..b3ea9706db 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -1,6 +1,6 @@ name: Testing (Linux) on: - #pull_request: + pull_request: push: branches: - master diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index 54becc8095..ad9897a514 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 27edc3725c..e674728e95 100644 --- a/.github/workflows/tests_without_binary.yml +++ b/.github/workflows/tests_without_binary.yml @@ -3,7 +3,7 @@ on: push: branches: - master - #pull_request: + 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" diff --git a/.github/workflows/wheel_linux_x86_64.yml b/.github/workflows/wheel_linux_x86_64.yml index 6fd64ad9eb..ed7042f6e7 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 a9fbdc6bbd..ab0f8f27cb 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 377d769a62..aef525f968 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 d96f3fd802..9b3bcb57be 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 c3044861f4..b0981ff808 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 7d19a03bbfd77890041d63fa5332e4a4cb31a9f3 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 16:04:09 -0400 Subject: [PATCH 050/113] Replace cache path. --- .github/workflows/test-gpu.yml | 16 ++++++++-------- .github/workflows/wheel_linux_aarch64.yml | 10 +++++----- .github/workflows/wheel_linux_ppc64le.yml | 10 +++++----- .github/workflows/wheel_macos_x86_64.yml | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 48edb12f69..3e44d3efbe 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -34,7 +34,7 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + path: $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Validate GPU version and installed compiler @@ -58,10 +58,10 @@ jobs: - name: Build Kokkos core library (Ubuntu) if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - rm -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + rm -rf $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + mkdir -p $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} - cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} \ + cmake -BBuild . -DCMAKE_INSTALL_PREFIX=$/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} \ -DKokkos_ENABLE_COMPLEX_ALIGN=OFF \ -DKokkos_ENABLE_SERIAL=ON \ -DKokkos_ENABLE_${{ matrix.exec_model }}=ON \ @@ -91,7 +91,7 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + path: $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} fail-on-cache-miss: true @@ -99,7 +99,7 @@ jobs: run: | rm -rf Kokkos mkdir Kokkos/ - cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + cp -rf $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - uses: actions/setup-python@v4 name: Install Python @@ -164,7 +164,7 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + path: $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} fail-on-cache-miss: true @@ -172,7 +172,7 @@ jobs: run: | rm -rf Kokkos mkdir Kokkos/ - cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + cp -rf $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 diff --git a/.github/workflows/wheel_linux_aarch64.yml b/.github/workflows/wheel_linux_aarch64.yml index 5b4a331818..2e85b478e3 100644 --- a/.github/workflows/wheel_linux_aarch64.yml +++ b/.github/workflows/wheel_linux_aarch64.yml @@ -41,7 +41,7 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + path: $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Clone Kokkos libs @@ -56,12 +56,12 @@ jobs: - name: Build Kokkos core library if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + mkdir -p $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} cd kokkos docker run --platform linux/aarch64 \ -v /var/run/docker.sock:/var/run/docker.sock \ -v `pwd`:/io \ - -v ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}:/install \ + -v $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}:/install \ -i ${{ matrix.container_img }} \ bash -c "git config --global --add safe.directory /io && \ cd /io && \ @@ -103,13 +103,13 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + path: $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | mkdir Kokkos - cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + cp -rf $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - name: Install cibuildwheel run: python -m pip install cibuildwheel~=2.11.0 diff --git a/.github/workflows/wheel_linux_ppc64le.yml b/.github/workflows/wheel_linux_ppc64le.yml index 0060749dad..9252e5c82e 100644 --- a/.github/workflows/wheel_linux_ppc64le.yml +++ b/.github/workflows/wheel_linux_ppc64le.yml @@ -41,7 +41,7 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + path: $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Clone Kokkos libs @@ -56,12 +56,12 @@ jobs: - name: Build Kokkos core library if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + mkdir -p $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} cd kokkos docker run --platform linux/ppc64le \ -v /var/run/docker.sock:/var/run/docker.sock \ -v `pwd`:/io \ - -v ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}:/install \ + -v $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}:/install \ -i ${{ matrix.container_img }} \ bash -c "git config --global --add safe.directory /io && \ cd /io && \ @@ -103,14 +103,14 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + path: $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} fail-on-cache-miss: true - name: Copy cached libraries run: | mkdir Kokkos - cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + cp -rf $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - name: Install cibuildwheel run: python -m pip install cibuildwheel~=2.11.0 diff --git a/.github/workflows/wheel_macos_x86_64.yml b/.github/workflows/wheel_macos_x86_64.yml index aef525f968..253c9d337a 100644 --- a/.github/workflows/wheel_macos_x86_64.yml +++ b/.github/workflows/wheel_macos_x86_64.yml @@ -113,7 +113,7 @@ jobs: - name: Copy cached libraries run: | mkdir Kokkos - cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + cp -rf $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - uses: actions/setup-python@v4 name: Install Python From d89002ff0f321d921fa266896ce372a47331bcf1 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 16:08:29 -0400 Subject: [PATCH 051/113] Fix cache path. --- .github/workflows/test-gpu.yml | 16 ++++++++-------- .github/workflows/wheel_linux_aarch64.yml | 10 +++++----- .github/workflows/wheel_linux_ppc64le.yml | 10 +++++----- .github/workflows/wheel_macos_x86_64.yml | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 3e44d3efbe..065fe02942 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -34,7 +34,7 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Validate GPU version and installed compiler @@ -58,10 +58,10 @@ jobs: - name: Build Kokkos core library (Ubuntu) if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - rm -rf $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} - mkdir -p $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + rm -rf /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + mkdir -p /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} - cmake -BBuild . -DCMAKE_INSTALL_PREFIX=$/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} \ + cmake -BBuild . -DCMAKE_INSTALL_PREFIX=/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} \ -DKokkos_ENABLE_COMPLEX_ALIGN=OFF \ -DKokkos_ENABLE_SERIAL=ON \ -DKokkos_ENABLE_${{ matrix.exec_model }}=ON \ @@ -91,7 +91,7 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} fail-on-cache-miss: true @@ -99,7 +99,7 @@ jobs: run: | rm -rf Kokkos mkdir Kokkos/ - cp -rf $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + cp -rf /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - uses: actions/setup-python@v4 name: Install Python @@ -164,7 +164,7 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} fail-on-cache-miss: true @@ -172,7 +172,7 @@ jobs: run: | rm -rf Kokkos mkdir Kokkos/ - cp -rf $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + cp -rf /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 diff --git a/.github/workflows/wheel_linux_aarch64.yml b/.github/workflows/wheel_linux_aarch64.yml index 2e85b478e3..48bbe02c23 100644 --- a/.github/workflows/wheel_linux_aarch64.yml +++ b/.github/workflows/wheel_linux_aarch64.yml @@ -41,7 +41,7 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Clone Kokkos libs @@ -56,12 +56,12 @@ jobs: - name: Build Kokkos core library if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - mkdir -p $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + mkdir -p /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} cd kokkos docker run --platform linux/aarch64 \ -v /var/run/docker.sock:/var/run/docker.sock \ -v `pwd`:/io \ - -v $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}:/install \ + -v /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}:/install \ -i ${{ matrix.container_img }} \ bash -c "git config --global --add safe.directory /io && \ cd /io && \ @@ -103,13 +103,13 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | mkdir Kokkos - cp -rf $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + cp -rf /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - name: Install cibuildwheel run: python -m pip install cibuildwheel~=2.11.0 diff --git a/.github/workflows/wheel_linux_ppc64le.yml b/.github/workflows/wheel_linux_ppc64le.yml index 9252e5c82e..b162d855f8 100644 --- a/.github/workflows/wheel_linux_ppc64le.yml +++ b/.github/workflows/wheel_linux_ppc64le.yml @@ -41,7 +41,7 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Clone Kokkos libs @@ -56,12 +56,12 @@ jobs: - name: Build Kokkos core library if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - mkdir -p $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + mkdir -p /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} cd kokkos docker run --platform linux/ppc64le \ -v /var/run/docker.sock:/var/run/docker.sock \ -v `pwd`:/io \ - -v $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}:/install \ + -v /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}:/install \ -i ${{ matrix.container_img }} \ bash -c "git config --global --add safe.directory /io && \ cd /io && \ @@ -103,14 +103,14 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} fail-on-cache-miss: true - name: Copy cached libraries run: | mkdir Kokkos - cp -rf $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + cp -rf /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - name: Install cibuildwheel run: python -m pip install cibuildwheel~=2.11.0 diff --git a/.github/workflows/wheel_macos_x86_64.yml b/.github/workflows/wheel_macos_x86_64.yml index 253c9d337a..2a228892ec 100644 --- a/.github/workflows/wheel_macos_x86_64.yml +++ b/.github/workflows/wheel_macos_x86_64.yml @@ -113,7 +113,7 @@ jobs: - name: Copy cached libraries run: | mkdir Kokkos - cp -rf $/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + cp -rf /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - uses: actions/setup-python@v4 name: Install Python From 74263832e0da2ed01e630540fd17a215c72da32a Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 16:16:06 -0400 Subject: [PATCH 052/113] Restore ${{ github.workspace }} paths except test-gpu --- .github/workflows/test-gpu.yml | 1 + .github/workflows/wheel_linux_aarch64.yml | 10 +++++----- .github/workflows/wheel_linux_ppc64le.yml | 10 +++++----- .github/workflows/wheel_macos_x86_64.yml | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 065fe02942..11e979987c 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -9,6 +9,7 @@ env: CI_CUDA_ARCH: 86 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 + TF_VERSION: 2.10.0 TORCH_VERSION: 1.11.0+cpu concurrency: diff --git a/.github/workflows/wheel_linux_aarch64.yml b/.github/workflows/wheel_linux_aarch64.yml index 48bbe02c23..5b4a331818 100644 --- a/.github/workflows/wheel_linux_aarch64.yml +++ b/.github/workflows/wheel_linux_aarch64.yml @@ -41,7 +41,7 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Clone Kokkos libs @@ -56,12 +56,12 @@ jobs: - name: Build Kokkos core library if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - mkdir -p /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} cd kokkos docker run --platform linux/aarch64 \ -v /var/run/docker.sock:/var/run/docker.sock \ -v `pwd`:/io \ - -v /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}:/install \ + -v ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}:/install \ -i ${{ matrix.container_img }} \ bash -c "git config --global --add safe.directory /io && \ cd /io && \ @@ -103,13 +103,13 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | mkdir Kokkos - cp -rf /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - name: Install cibuildwheel run: python -m pip install cibuildwheel~=2.11.0 diff --git a/.github/workflows/wheel_linux_ppc64le.yml b/.github/workflows/wheel_linux_ppc64le.yml index b162d855f8..0060749dad 100644 --- a/.github/workflows/wheel_linux_ppc64le.yml +++ b/.github/workflows/wheel_linux_ppc64le.yml @@ -41,7 +41,7 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Clone Kokkos libs @@ -56,12 +56,12 @@ jobs: - name: Build Kokkos core library if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - mkdir -p /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} cd kokkos docker run --platform linux/ppc64le \ -v /var/run/docker.sock:/var/run/docker.sock \ -v `pwd`:/io \ - -v /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}:/install \ + -v ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}:/install \ -i ${{ matrix.container_img }} \ bash -c "git config --global --add safe.directory /io && \ cd /io && \ @@ -103,14 +103,14 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} fail-on-cache-miss: true - name: Copy cached libraries run: | mkdir Kokkos - cp -rf /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - name: Install cibuildwheel run: python -m pip install cibuildwheel~=2.11.0 diff --git a/.github/workflows/wheel_macos_x86_64.yml b/.github/workflows/wheel_macos_x86_64.yml index 2a228892ec..aef525f968 100644 --- a/.github/workflows/wheel_macos_x86_64.yml +++ b/.github/workflows/wheel_macos_x86_64.yml @@ -113,7 +113,7 @@ jobs: - name: Copy cached libraries run: | mkdir Kokkos - cp -rf /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - uses: actions/setup-python@v4 name: Install Python From 61ca98435be0682463f8cd726749365a368e9fc8 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 17:58:45 -0400 Subject: [PATCH 053/113] cache is lru. --- .github/workflows/test-gpu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 11e979987c..2d9b01c25d 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -94,9 +94,9 @@ jobs: with: path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - fail-on-cache-miss: true - name: Copy cached libraries + if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | rm -rf Kokkos mkdir Kokkos/ @@ -167,10 +167,10 @@ jobs: with: path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - fail-on-cache-miss: true - name: Copy cached libraries run: | + if: steps.kokkos-cache.outputs.cache-hit == 'true' rm -rf Kokkos mkdir Kokkos/ cp -rf /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ From d99c828ce0239f470da24fb03531fff463bfcc25 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 18:08:19 -0400 Subject: [PATCH 054/113] Copy cached if cache-hit. --- .github/workflows/changelog_reminder.yml | 2 +- .github/workflows/format.yml | 3 +-- .github/workflows/tests_linux.yml | 8 ++++---- .github/workflows/tests_windows.yml | 2 +- .github/workflows/tests_without_binary.yml | 2 +- .github/workflows/update_dev_version.yml | 2 +- .github/workflows/wheel_linux_aarch64.yml | 2 ++ .github/workflows/wheel_linux_ppc64le.yml | 2 +- .github/workflows/wheel_linux_x86_64.yml | 4 ++-- .github/workflows/wheel_macos_arm64.yml | 2 +- .github/workflows/wheel_macos_x86_64.yml | 3 +-- .github/workflows/wheel_noarch.yml | 2 +- .github/workflows/wheel_win_x86_64.yml | 3 +-- 13 files changed, 18 insertions(+), 19 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 653ca82abd..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 @@ -77,7 +77,6 @@ jobs: with: path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - fail-on-cache-miss: true - name: Copy cached libraries run: | diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests_linux.yml index b3ea9706db..68c783ce03 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -1,6 +1,6 @@ name: Testing (Linux) on: - pull_request: + #pull_request: push: branches: - master @@ -300,9 +300,9 @@ jobs: with: path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - fail-on-cache-miss: true - name: Copy cached libraries + if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | mkdir Kokkos/ cp -rf ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ @@ -389,9 +389,9 @@ jobs: with: path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - fail-on-cache-miss: true - name: Copy cached libraries + if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | mkdir Kokkos/ cp -rf ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ @@ -522,9 +522,9 @@ jobs: with: path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - fail-on-cache-miss: true - name: Copy cached libraries + if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | mkdir Kokkos/ cp -rf ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index ad9897a514..54becc8095 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 e674728e95..27edc3725c 100644 --- a/.github/workflows/tests_without_binary.yml +++ b/.github/workflows/tests_without_binary.yml @@ -3,7 +3,7 @@ on: push: branches: - master - pull_request: + #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" 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_aarch64.yml b/.github/workflows/wheel_linux_aarch64.yml index 5b4a331818..90b5b599ac 100644 --- a/.github/workflows/wheel_linux_aarch64.yml +++ b/.github/workflows/wheel_linux_aarch64.yml @@ -105,8 +105,10 @@ jobs: with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + fail-on-cache-miss: true - name: Copy cached libraries + if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | mkdir Kokkos cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ diff --git a/.github/workflows/wheel_linux_ppc64le.yml b/.github/workflows/wheel_linux_ppc64le.yml index 0060749dad..0f03fb7542 100644 --- a/.github/workflows/wheel_linux_ppc64le.yml +++ b/.github/workflows/wheel_linux_ppc64le.yml @@ -105,9 +105,9 @@ jobs: with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - fail-on-cache-miss: true - name: Copy cached libraries + if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | mkdir Kokkos cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ diff --git a/.github/workflows/wheel_linux_x86_64.yml b/.github/workflows/wheel_linux_x86_64.yml index ed7042f6e7..3441703b44 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 @@ -108,12 +108,12 @@ jobs: with: path: /root/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.container_img }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - fail-on-cache-miss: true - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 - name: Copy cached libraries + if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | mkdir Kokkos cp -rf /root/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ diff --git a/.github/workflows/wheel_macos_arm64.yml b/.github/workflows/wheel_macos_arm64.yml index ab0f8f27cb..a9fbdc6bbd 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 aef525f968..58dfbbd149 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 @@ -108,7 +108,6 @@ jobs: with: path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - fail-on-cache-miss: true - name: Copy cached libraries run: | diff --git a/.github/workflows/wheel_noarch.yml b/.github/workflows/wheel_noarch.yml index 9b3bcb57be..d96f3fd802 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 b0981ff808..e34db4b094 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 @@ -103,7 +103,6 @@ jobs: with: path: D:\a\install_dir\${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-RelWithDebInfo - fail-on-cache-miss: true - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 From 5f080219dd6ebfc09584405ea02ed42e5ebe4c5c Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 14 Sep 2023 18:11:30 -0400 Subject: [PATCH 055/113] Restore triggers. --- .github/workflows/changelog_reminder.yml | 2 +- .github/workflows/format.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 +- 11 files changed, 11 insertions(+), 11 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/tests_linux.yml b/.github/workflows/tests_linux.yml index 68c783ce03..aaa2aa32d9 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -1,6 +1,6 @@ name: Testing (Linux) on: - #pull_request: + pull_request: push: branches: - master diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index 54becc8095..ad9897a514 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 27edc3725c..e674728e95 100644 --- a/.github/workflows/tests_without_binary.yml +++ b/.github/workflows/tests_without_binary.yml @@ -3,7 +3,7 @@ on: push: branches: - master - #pull_request: + 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" 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 3441703b44..3bd08bcde1 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 a9fbdc6bbd..ab0f8f27cb 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 58dfbbd149..82ce7d1153 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 d96f3fd802..9b3bcb57be 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 e34db4b094..2195346756 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 47c71f2c82d3bc71b05b3e924fcb3bb11e3ef8cf Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 08:33:07 -0400 Subject: [PATCH 056/113] Update changelog. --- .github/CHANGELOG.md | 3 +++ .github/workflows/{test-gpu.yml => tests_gpu.yml} | 0 2 files changed, 3 insertions(+) rename .github/workflows/{test-gpu.yml => tests_gpu.yml} (100%) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index f4089f5404..cc2e6a8cad 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -7,6 +7,9 @@ ### Breaking changes +* Add `tests_gpu.yml` workflow to test the Lightning-Kokkos backend with CUDA-12. + [(#494)](https://github.com/PennyLaneAI/pennylane-lightning/pull/494) + * Enums defined in `GateOperation.hpp` start at `1` (previously `0`). `::BEGIN` is introduced in a few places where it was assumed `0` accordingly. [(#485)](https://github.com/PennyLaneAI/pennylane-lightning/pull/485) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/tests_gpu.yml similarity index 100% rename from .github/workflows/test-gpu.yml rename to .github/workflows/tests_gpu.yml From 882ece0a29bb3f9ae0f6a8c4eeaa71c6fbea717d Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 08:37:05 -0400 Subject: [PATCH 057/113] Combine tests with codecov. --- .github/workflows/tests_linux.yml | 74 ++++++++----------------------- 1 file changed, 18 insertions(+), 56 deletions(-) diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests_linux.yml index aaa2aa32d9..92f9156b94 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -47,11 +47,15 @@ jobs: -DBUILD_TESTS=ON \ -DENABLE_PYTHON=OFF \ -DPL_BACKEND=${{ matrix.pl_backend }} \ - -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) + -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \ + -DENABLE_COVERAGE=ON 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; + lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info + mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info - name: Upload test results uses: actions/upload-artifact@v3 @@ -61,27 +65,11 @@ jobs: path: ./Build/tests/results/ if-no-files-found: error - - name: Build and run unit tests for code coverage - run: | - cmake . -BBuildCov -G Ninja \ - -DCMAKE_BUILD_TYPE=Debug \ - -DBUILD_TESTS=ON \ - -DENABLE_PYTHON=OFF \ - -DPL_BACKEND=${{ matrix.pl_backend }} \ - -DENABLE_COVERAGE=ON \ - -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) - cmake --build ./BuildCov - cd ./BuildCov - for file in *runner ; do ./$file; done; - lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info - lcov --remove coverage.info '/usr/*' --output-file coverage.info - mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info - - name: Upload code coverage results uses: actions/upload-artifact@v3 with: name: ubuntu-codecov-results-cpp - path: ./BuildCov/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info + path: ./Build/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info if-no-files-found: error pythontests: @@ -171,11 +159,15 @@ jobs: -DENABLE_BLAS=ON \ -DPL_BACKEND=${{ matrix.pl_backend }} \ -DBUILD_TESTS=ON \ - -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) + -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \ + -DENABLE_COVERAGE=ON 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; + lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info + mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info - name: Upload test results uses: actions/upload-artifact@v3 @@ -185,28 +177,11 @@ jobs: path: ./Build/tests/results/ if-no-files-found: error - - name: Build and run unit tests for code coverage - run: | - cmake . -BBuildCov -G Ninja \ - -DCMAKE_BUILD_TYPE=Debug \ - -DBUILD_TESTS=ON \ - -DENABLE_PYTHON=OFF \ - -DENABLE_BLAS=ON \ - -DPL_BACKEND=${{ matrix.pl_backend }} \ - -DENABLE_COVERAGE=ON \ - -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) - cmake --build ./BuildCov - cd ./BuildCov - for file in *runner ; do ./$file; done; - lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info - lcov --remove coverage.info '/usr/*' --output-file coverage.info - mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info - - name: Upload code coverage results uses: actions/upload-artifact@v3 with: name: ubuntu-codecov-results-cpp - path: ./BuildCov/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info + path: ./Build/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info if-no-files-found: error pythontestswithOpenBLAS: @@ -318,11 +293,15 @@ jobs: -DENABLE_PYTHON=OFF \ -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ -DPL_BACKEND=${{ matrix.pl_backend }} \ - -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) + -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \ + -DENABLE_COVERAGE=ON cmake --build ./Build cd ./Build mkdir -p ./tests/results_${{ github.job }}_${{ matrix.pl_backend }} for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results_${{ github.job }}_${{ matrix.pl_backend }}/report_$file.xml; done; + lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info + mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info - name: Upload test results uses: actions/upload-artifact@v3 @@ -332,28 +311,11 @@ jobs: path: ./Build/tests/results_${{ github.job }}_${{ matrix.pl_backend }} if-no-files-found: error - - name: Build and run unit tests for code coverage - run: | - cmake . -BBuildCov -G Ninja \ - -DCMAKE_BUILD_TYPE=Debug \ - -DBUILD_TESTS=ON \ - -DENABLE_PYTHON=OFF \ - -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ - -DPL_BACKEND=${{ matrix.pl_backend }} \ - -DENABLE_COVERAGE=ON \ - -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) - cmake --build ./BuildCov - cd ./BuildCov - for file in *runner ; do ./$file; done; - lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info - lcov --remove coverage.info '/usr/*' --output-file coverage.info - mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info - - name: Upload code coverage results uses: actions/upload-artifact@v3 with: name: ubuntu-codecov-results-cpp - path: ./BuildCov/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info + path: ./Build/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info if-no-files-found: error pythontestswithKokkos: From cf59425688ad46b17c1f7d018d62d60e7107a1e5 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 08:54:11 -0400 Subject: [PATCH 058/113] No cp -rf. Use debug builds. --- .github/workflows/tests_gpu.yml | 10 ++++------ .github/workflows/tests_linux.yml | 8 ++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 2d9b01c25d..efd33edf67 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -98,9 +98,8 @@ jobs: - name: Copy cached libraries if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | - rm -rf Kokkos - mkdir Kokkos/ - cp -rf /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + mkdir -p Kokkos/ + cp -r /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - uses: actions/setup-python@v4 name: Install Python @@ -171,9 +170,8 @@ jobs: - name: Copy cached libraries run: | if: steps.kokkos-cache.outputs.cache-hit == 'true' - rm -rf Kokkos - mkdir Kokkos/ - cp -rf /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + mkdir -p Kokkos/ + cp -r /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests_linux.yml index 92f9156b94..651c5d5252 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -43,7 +43,7 @@ jobs: - name: Build and run unit tests run: | cmake . -BBuild -G Ninja \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_TESTS=ON \ -DENABLE_PYTHON=OFF \ -DPL_BACKEND=${{ matrix.pl_backend }} \ @@ -154,7 +154,7 @@ jobs: - name: Build and run unit tests run: | cmake . -BBuild -G Ninja \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_BUILD_TYPE=Debug \ -DENABLE_PYTHON=OFF \ -DENABLE_BLAS=ON \ -DPL_BACKEND=${{ matrix.pl_backend }} \ @@ -288,7 +288,7 @@ jobs: - name: Build and run unit tests run: | cmake . -BBuild -G Ninja \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_TESTS=ON \ -DENABLE_PYTHON=OFF \ -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ @@ -497,7 +497,7 @@ jobs: - name: Build and run unit tests run: | cmake . -BBuild -G Ninja \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_TESTS=ON \ -DENABLE_PYTHON=OFF \ -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ From a71a0e202f3f9d39496075d78737697c4989000d Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 09:00:00 -0400 Subject: [PATCH 059/113] Fix Kokkos/ tmp path. --- .github/workflows/tests_gpu.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index efd33edf67..6e616b1e79 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -98,8 +98,8 @@ jobs: - name: Copy cached libraries if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | - mkdir -p Kokkos/ - cp -r /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + mkdir -p ${{ github.workspace }}/Kokkos + cp -r /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos - uses: actions/setup-python@v4 name: Install Python @@ -170,8 +170,8 @@ jobs: - name: Copy cached libraries run: | if: steps.kokkos-cache.outputs.cache-hit == 'true' - mkdir -p Kokkos/ - cp -r /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ + mkdir -p ${{ github.workspace }}/Kokkos + cp -r /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 From ac1bdaeeddfb968342aaf32c8d6cc3ccb39b60c6 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 09:02:23 -0400 Subject: [PATCH 060/113] ls Kokkos --- .github/workflows/tests_gpu.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 6e616b1e79..ceee0628f0 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -98,8 +98,9 @@ jobs: - name: Copy cached libraries if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | - mkdir -p ${{ github.workspace }}/Kokkos - cp -r /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos + mkdir -p /opt/actions-runner/_work/Kokkos + cp -r /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* /opt/actions-runner/_work/Kokkos + ls -l /opt/actions-runner/_work/Kokkos - uses: actions/setup-python@v4 name: Install Python @@ -116,11 +117,12 @@ jobs: - name: Build and run unit tests run: | + ls -l /opt/actions-runner/_work/Kokkos cmake . -BBuild -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_TESTS=ON \ -DENABLE_PYTHON=OFF \ - -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ + -DCMAKE_PREFIX_PATH=/opt/actions-runner/_work/Kokkos \ -DPL_BACKEND=${{ matrix.pl_backend }} \ -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \ -DENABLE_COVERAGE=ON @@ -170,8 +172,8 @@ jobs: - name: Copy cached libraries run: | if: steps.kokkos-cache.outputs.cache-hit == 'true' - mkdir -p ${{ github.workspace }}/Kokkos - cp -r /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos + mkdir -p /opt/actions-runner/_work/Kokkos + cp -r /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* /opt/actions-runner/_work/Kokkos - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 @@ -203,7 +205,7 @@ jobs: run: | cd main SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv - CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=/opt/actions-runner/_work/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv - name: Run PennyLane-Lightning unit tests @@ -220,10 +222,10 @@ jobs: if: ${{ matrix.pl_backend == 'all' }} run: | cd main - CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=/opt/actions-runner/_work/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv rm -rf build - CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=/opt/actions-runner/_work/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv - name: Run PennyLane-Lightning unit tests for lightning.qubit with all devices installed From 93b9445c0d89e59a83cc4c72510e955193327886 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 09:13:39 -0400 Subject: [PATCH 061/113] Force build kokkos. --- .github/workflows/tests_gpu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index ceee0628f0..935a6f824a 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -49,7 +49,7 @@ jobs: nvidia-smi - name: Clone Kokkos repository - if: steps.kokkos-cache.outputs.cache-hit != 'true' + # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | rm -rf kokkos_${{ matrix.exec_model }} git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git kokkos_${{ matrix.exec_model }} @@ -57,7 +57,7 @@ jobs: pushd . &> /dev/null - name: Build Kokkos core library (Ubuntu) - if: steps.kokkos-cache.outputs.cache-hit != 'true' + # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | rm -rf /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} mkdir -p /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} From 87e786494c5b1c8bbcad9f50b8fbeb09c6a5b76d Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 09:24:02 -0400 Subject: [PATCH 062/113] Restore ${{ github.workspace }}/ path --- .github/workflows/tests_gpu.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 935a6f824a..9417ec4872 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -35,7 +35,7 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Validate GPU version and installed compiler @@ -59,10 +59,10 @@ jobs: - name: Build Kokkos core library (Ubuntu) # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - rm -rf /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} - mkdir -p /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + rm -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} - cmake -BBuild . -DCMAKE_INSTALL_PREFIX=/opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} \ + cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} \ -DKokkos_ENABLE_COMPLEX_ALIGN=OFF \ -DKokkos_ENABLE_SERIAL=ON \ -DKokkos_ENABLE_${{ matrix.exec_model }}=ON \ @@ -92,15 +92,15 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | - mkdir -p /opt/actions-runner/_work/Kokkos - cp -r /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* /opt/actions-runner/_work/Kokkos - ls -l /opt/actions-runner/_work/Kokkos + mkdir -p ${{ github.workspace }}/Kokkos + cp -r ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos + ls -l ${{ github.workspace }}/Kokkos - uses: actions/setup-python@v4 name: Install Python @@ -117,12 +117,12 @@ jobs: - name: Build and run unit tests run: | - ls -l /opt/actions-runner/_work/Kokkos + ls -l ${{ github.workspace }}/Kokkos cmake . -BBuild -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_TESTS=ON \ -DENABLE_PYTHON=OFF \ - -DCMAKE_PREFIX_PATH=/opt/actions-runner/_work/Kokkos \ + -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ -DPL_BACKEND=${{ matrix.pl_backend }} \ -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \ -DENABLE_COVERAGE=ON @@ -166,14 +166,14 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | if: steps.kokkos-cache.outputs.cache-hit == 'true' - mkdir -p /opt/actions-runner/_work/Kokkos - cp -r /opt/actions-runner/_work/Kokkos_install/${{ matrix.exec_model }}/* /opt/actions-runner/_work/Kokkos + mkdir -p ${{ github.workspace }}/Kokkos + cp -r ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 @@ -205,7 +205,7 @@ jobs: run: | cd main SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv - CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=/opt/actions-runner/_work/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv - name: Run PennyLane-Lightning unit tests @@ -222,10 +222,10 @@ jobs: if: ${{ matrix.pl_backend == 'all' }} run: | cd main - CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=/opt/actions-runner/_work/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv rm -rf build - CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=/opt/actions-runner/_work/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv - name: Run PennyLane-Lightning unit tests for lightning.qubit with all devices installed From 4d375402d1533227513daa0aebfe506a10081185 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 10:08:07 -0400 Subject: [PATCH 063/113] Use rel dirs. --- .github/workflows/tests_gpu.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 9417ec4872..80f0ab89cc 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -35,7 +35,7 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + path: Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Validate GPU version and installed compiler @@ -59,10 +59,10 @@ jobs: - name: Build Kokkos core library (Ubuntu) # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - rm -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + rm -rf Kokkos_install/${{ matrix.exec_model }} + mkdir -p Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} - cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} \ + cmake -BBuild . -DCMAKE_INSTALL_PREFIX=Kokkos_install/${{ matrix.exec_model }} \ -DKokkos_ENABLE_COMPLEX_ALIGN=OFF \ -DKokkos_ENABLE_SERIAL=ON \ -DKokkos_ENABLE_${{ matrix.exec_model }}=ON \ @@ -92,15 +92,15 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + path: Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | - mkdir -p ${{ github.workspace }}/Kokkos - cp -r ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos - ls -l ${{ github.workspace }}/Kokkos + mkdir -p Kokkos + cp -r Kokkos_install/${{ matrix.exec_model }}/* Kokkos + ls -l Kokkos - uses: actions/setup-python@v4 name: Install Python @@ -117,12 +117,12 @@ jobs: - name: Build and run unit tests run: | - ls -l ${{ github.workspace }}/Kokkos + ls -l Kokkos cmake . -BBuild -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_TESTS=ON \ -DENABLE_PYTHON=OFF \ - -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ + -DCMAKE_PREFIX_PATH=Kokkos \ -DPL_BACKEND=${{ matrix.pl_backend }} \ -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \ -DENABLE_COVERAGE=ON @@ -166,14 +166,14 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + path: Kokkos_install/${{ matrix.exec_model }} key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | if: steps.kokkos-cache.outputs.cache-hit == 'true' - mkdir -p ${{ github.workspace }}/Kokkos - cp -r ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos + mkdir -p Kokkos + cp -r Kokkos_install/${{ matrix.exec_model }}/* Kokkos - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 @@ -205,7 +205,7 @@ jobs: run: | cd main SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv - CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv - name: Run PennyLane-Lightning unit tests @@ -222,10 +222,10 @@ jobs: if: ${{ matrix.pl_backend == 'all' }} run: | cd main - CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv rm -rf build - CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv - name: Run PennyLane-Lightning unit tests for lightning.qubit with all devices installed From 1e718eee94183b2793bce7ae887bb1a1e2a22e63 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 10:27:50 -0400 Subject: [PATCH 064/113] ls -ltrh --- .github/workflows/tests_gpu.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 80f0ab89cc..773b43fdd9 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -99,6 +99,7 @@ jobs: if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | mkdir -p Kokkos + ls -ltrh cp -r Kokkos_install/${{ matrix.exec_model }}/* Kokkos ls -l Kokkos @@ -173,6 +174,7 @@ jobs: run: | if: steps.kokkos-cache.outputs.cache-hit == 'true' mkdir -p Kokkos + ls -ltrh cp -r Kokkos_install/${{ matrix.exec_model }}/* Kokkos - name: Checkout PennyLane-Lightning From 481e0eab9b035d702d56652c68bc4d61aea4608e Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 10:54:55 -0400 Subject: [PATCH 065/113] Pust back {{ github.workspace }}/ prefix path. --- .github/workflows/tests_gpu.yml | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 773b43fdd9..3845ecca17 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -35,8 +35,8 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: Kokkos_install/${{ matrix.exec_model }} - key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Validate GPU version and installed compiler run: | @@ -59,10 +59,10 @@ jobs: - name: Build Kokkos core library (Ubuntu) # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - rm -rf Kokkos_install/${{ matrix.exec_model }} - mkdir -p Kokkos_install/${{ matrix.exec_model }} + rm -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} - cmake -BBuild . -DCMAKE_INSTALL_PREFIX=Kokkos_install/${{ matrix.exec_model }} \ + cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} \ -DKokkos_ENABLE_COMPLEX_ALIGN=OFF \ -DKokkos_ENABLE_SERIAL=ON \ -DKokkos_ENABLE_${{ matrix.exec_model }}=ON \ @@ -92,16 +92,16 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: Kokkos_install/${{ matrix.exec_model }} - key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | - mkdir -p Kokkos + mkdir -p ${{ github.workspace }}/Kokkos ls -ltrh - cp -r Kokkos_install/${{ matrix.exec_model }}/* Kokkos - ls -l Kokkos + cp -r ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos + ls -l ${{ github.workspace }}/Kokkos - uses: actions/setup-python@v4 name: Install Python @@ -118,12 +118,12 @@ jobs: - name: Build and run unit tests run: | - ls -l Kokkos + ls -l ${{ github.workspace }}/Kokkos cmake . -BBuild -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_TESTS=ON \ -DENABLE_PYTHON=OFF \ - -DCMAKE_PREFIX_PATH=Kokkos \ + -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ -DPL_BACKEND=${{ matrix.pl_backend }} \ -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \ -DENABLE_COVERAGE=ON @@ -167,15 +167,15 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: Kokkos_install/${{ matrix.exec_model }} - key: ${{ matrix.os }}-kokkos-${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | if: steps.kokkos-cache.outputs.cache-hit == 'true' - mkdir -p Kokkos + mkdir -p ${{ github.workspace }}/Kokkos ls -ltrh - cp -r Kokkos_install/${{ matrix.exec_model }}/* Kokkos + cp -r ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 @@ -207,7 +207,7 @@ jobs: run: | cd main SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv - CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv - name: Run PennyLane-Lightning unit tests @@ -224,10 +224,10 @@ jobs: if: ${{ matrix.pl_backend == 'all' }} run: | cd main - CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv rm -rf build - CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv - name: Run PennyLane-Lightning unit tests for lightning.qubit with all devices installed From 25139b610bcc224efd694fd5d12e1ac1c3c8b89e Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 10:57:15 -0400 Subject: [PATCH 066/113] Comment pull_request: --- .github/workflows/changelog_reminder.yml | 2 +- .github/workflows/format.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 +- 11 files changed, 11 insertions(+), 11 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/tests_linux.yml b/.github/workflows/tests_linux.yml index 651c5d5252..4d138f7d86 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -1,6 +1,6 @@ name: Testing (Linux) on: - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index ad9897a514..54becc8095 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 e674728e95..27edc3725c 100644 --- a/.github/workflows/tests_without_binary.yml +++ b/.github/workflows/tests_without_binary.yml @@ -3,7 +3,7 @@ on: push: branches: - master - pull_request: + #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" 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 3bd08bcde1..3441703b44 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 ab0f8f27cb..a9fbdc6bbd 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 82ce7d1153..58dfbbd149 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 9b3bcb57be..d96f3fd802 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 2195346756..e34db4b094 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 5b80798e9d2d408114b0cf46cf1a38cb67f1c6bc Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 11:05:26 -0400 Subject: [PATCH 067/113] Change cache key. --- .github/workflows/tests_gpu.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 3845ecca17..ffba789e0e 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -36,7 +36,7 @@ jobs: uses: actions/cache@v3 with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + key: a-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Validate GPU version and installed compiler run: | @@ -93,7 +93,7 @@ jobs: uses: actions/cache@v3 with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + key: a-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries if: steps.kokkos-cache.outputs.cache-hit == 'true' @@ -168,7 +168,7 @@ jobs: uses: actions/cache@v3 with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + key: a-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | From ba55e28e7af0302a0d8e70a4919877621ee4a04f Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 11:13:43 -0400 Subject: [PATCH 068/113] Switch back to relative paths. --- .github/workflows/tests_gpu.yml | 41 ++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index ffba789e0e..1f465b22c0 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -35,8 +35,8 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - key: a-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + path: Kokkos_install/${{ matrix.exec_model }} + key: b-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Validate GPU version and installed compiler run: | @@ -59,10 +59,10 @@ jobs: - name: Build Kokkos core library (Ubuntu) # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - rm -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + rm -rf Kokkos_install/${{ matrix.exec_model }} + mkdir -p Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} - cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} \ + cmake -BBuild . -DCMAKE_INSTALL_PREFIX=Kokkos_install/${{ matrix.exec_model }} \ -DKokkos_ENABLE_COMPLEX_ALIGN=OFF \ -DKokkos_ENABLE_SERIAL=ON \ -DKokkos_ENABLE_${{ matrix.exec_model }}=ON \ @@ -92,16 +92,19 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - key: a-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + path: Kokkos_install/${{ matrix.exec_model }} + key: b-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | - mkdir -p ${{ github.workspace }}/Kokkos + mkdir -p Kokkos ls -ltrh - cp -r ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos - ls -l ${{ github.workspace }}/Kokkos + cp -r Kokkos_install/${{ matrix.exec_model }}/* Kokkos + ls -l Kokkos + ls -l Kokkos/bin + ls -l Kokkos/include + ls -l Kokkos/lib - uses: actions/setup-python@v4 name: Install Python @@ -118,12 +121,12 @@ jobs: - name: Build and run unit tests run: | - ls -l ${{ github.workspace }}/Kokkos + ls -l Kokkos cmake . -BBuild -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_TESTS=ON \ -DENABLE_PYTHON=OFF \ - -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ + -DCMAKE_PREFIX_PATH=Kokkos \ -DPL_BACKEND=${{ matrix.pl_backend }} \ -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \ -DENABLE_COVERAGE=ON @@ -167,15 +170,15 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - key: a-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + path: Kokkos_install/${{ matrix.exec_model }} + key: b-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | if: steps.kokkos-cache.outputs.cache-hit == 'true' - mkdir -p ${{ github.workspace }}/Kokkos + mkdir -p Kokkos ls -ltrh - cp -r ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos + cp -r Kokkos_install/${{ matrix.exec_model }}/* Kokkos - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 @@ -207,7 +210,7 @@ jobs: run: | cd main SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv - CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv - name: Run PennyLane-Lightning unit tests @@ -224,10 +227,10 @@ jobs: if: ${{ matrix.pl_backend == 'all' }} run: | cd main - CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv rm -rf build - CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv - name: Run PennyLane-Lightning unit tests for lightning.qubit with all devices installed From f1d29e0bac0588d3f2bf9d0eec5dfcfc90cab723 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 11:18:08 -0400 Subject: [PATCH 069/113] Try github.workspace paths and ls --- .github/workflows/tests_gpu.yml | 45 +++++++++++++++++---------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 1f465b22c0..0ead482e6c 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -35,8 +35,8 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: Kokkos_install/${{ matrix.exec_model }} - key: b-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + key: c-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Validate GPU version and installed compiler run: | @@ -59,10 +59,10 @@ jobs: - name: Build Kokkos core library (Ubuntu) # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | - rm -rf Kokkos_install/${{ matrix.exec_model }} - mkdir -p Kokkos_install/${{ matrix.exec_model }} + rm -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} - cmake -BBuild . -DCMAKE_INSTALL_PREFIX=Kokkos_install/${{ matrix.exec_model }} \ + cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} \ -DKokkos_ENABLE_COMPLEX_ALIGN=OFF \ -DKokkos_ENABLE_SERIAL=ON \ -DKokkos_ENABLE_${{ matrix.exec_model }}=ON \ @@ -92,19 +92,19 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: Kokkos_install/${{ matrix.exec_model }} - key: b-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + key: c-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | - mkdir -p Kokkos + mkdir -p ${{ github.workspace }}/Kokkos ls -ltrh - cp -r Kokkos_install/${{ matrix.exec_model }}/* Kokkos - ls -l Kokkos - ls -l Kokkos/bin - ls -l Kokkos/include - ls -l Kokkos/lib + cp -r ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos + ls -l ${{ github.workspace }}/Kokkos + ls -l ${{ github.workspace }}/Kokkos/bin + ls -l ${{ github.workspace }}/Kokkos/include + ls -l ${{ github.workspace }}/Kokkos/lib - uses: actions/setup-python@v4 name: Install Python @@ -121,12 +121,12 @@ jobs: - name: Build and run unit tests run: | - ls -l Kokkos + ls -l ${{ github.workspace }}/Kokkos cmake . -BBuild -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_TESTS=ON \ -DENABLE_PYTHON=OFF \ - -DCMAKE_PREFIX_PATH=Kokkos \ + -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ -DPL_BACKEND=${{ matrix.pl_backend }} \ -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \ -DENABLE_COVERAGE=ON @@ -170,15 +170,15 @@ jobs: id: kokkos-cache uses: actions/cache@v3 with: - path: Kokkos_install/${{ matrix.exec_model }} - key: b-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + key: c-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Copy cached libraries run: | if: steps.kokkos-cache.outputs.cache-hit == 'true' - mkdir -p Kokkos + mkdir -p ${{ github.workspace }}/Kokkos ls -ltrh - cp -r Kokkos_install/${{ matrix.exec_model }}/* Kokkos + cp -r ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 @@ -208,9 +208,10 @@ jobs: - name: Install backend device if: ${{ matrix.pl_backend != 'all'}} run: | + ls -l ${{ github.workspace }}/Kokkos cd main SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv - CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv - name: Run PennyLane-Lightning unit tests @@ -227,10 +228,10 @@ jobs: if: ${{ matrix.pl_backend == 'all' }} run: | cd main - CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv rm -rf build - CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv - name: Run PennyLane-Lightning unit tests for lightning.qubit with all devices installed From ef93fdc77c18cb5fc3388ae79d7d279fac3cc6b7 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 13:41:26 -0400 Subject: [PATCH 070/113] save/restore --- .github/workflows/tests_gpu.yml | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 0ead482e6c..dccb331ab1 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -33,10 +33,14 @@ jobs: steps: - name: Cache installation directories id: kokkos-cache - uses: actions/cache@v3 + # uses: actions/cache@v3 + # with: + # path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + # key: c-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + uses: actions/cache/save@v3 with: + key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-${{ github.ref }}-${{ github.sha }} path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - key: c-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - name: Validate GPU version and installed compiler run: | @@ -90,13 +94,18 @@ jobs: steps: - name: Restoring cached dependencies id: kokkos-cache - uses: actions/cache@v3 + # uses: actions/cache@v3 + # with: + # path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + # key: c-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + uses: actions/cache/restore@v3 with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - key: c-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-${{ github.ref }}-${{ github.sha }} + restore-keys: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-${{ github.ref }}- - name: Copy cached libraries - if: steps.kokkos-cache.outputs.cache-hit == 'true' + # if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | mkdir -p ${{ github.workspace }}/Kokkos ls -ltrh @@ -168,14 +177,19 @@ jobs: steps: - name: Restoring cached dependencies id: kokkos-cache - uses: actions/cache@v3 + # uses: actions/cache@v3 + # with: + # path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + # key: c-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + uses: actions/cache/restore@v3 with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - key: c-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-${{ github.ref }}-${{ github.sha }} + restore-keys: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-${{ github.ref }}- - name: Copy cached libraries run: | - if: steps.kokkos-cache.outputs.cache-hit == 'true' + # if: steps.kokkos-cache.outputs.cache-hit == 'true' mkdir -p ${{ github.workspace }}/Kokkos ls -ltrh cp -r ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos @@ -251,4 +265,3 @@ jobs: with: name: ubuntu-codecov-results-python path: ./main/coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml - \ No newline at end of file From 8c8089e0aaf95deff23330625adb99c5b3c36633 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 14:07:21 -0400 Subject: [PATCH 071/113] Fix syntax error. --- .github/workflows/tests_gpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index dccb331ab1..5763554171 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -188,8 +188,8 @@ jobs: restore-keys: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-${{ github.ref }}- - name: Copy cached libraries - run: | # if: steps.kokkos-cache.outputs.cache-hit == 'true' + run: | mkdir -p ${{ github.workspace }}/Kokkos ls -ltrh cp -r ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos From 55435a522d8c6d54bd5f810db6728f921716634a Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 14:16:14 -0400 Subject: [PATCH 072/113] Move save cache down. --- .github/workflows/tests_gpu.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 5763554171..a58aa6b0b4 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -31,17 +31,6 @@ jobs: kokkos_version: ["4.1.00"] steps: - - name: Cache installation directories - id: kokkos-cache - # uses: actions/cache@v3 - # with: - # path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - # key: c-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} - uses: actions/cache/save@v3 - with: - key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-${{ github.ref }}-${{ github.sha }} - path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - - name: Validate GPU version and installed compiler run: | source /etc/profile.d/modules.sh @@ -79,6 +68,17 @@ jobs: cmake --install ./Build cd - + - name: Cache installation directories + id: kokkos-cache + # uses: actions/cache@v3 + # with: + # path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + # key: c-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} + uses: actions/cache/save@v3 + with: + key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-${{ github.ref }}-${{ github.sha }} + path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + cpptestswithKokkos: needs: [builddeps] strategy: From f03027133ad78d0b9149ac9402491b952dac1e99 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 14:40:01 -0400 Subject: [PATCH 073/113] Add CUDA-12 to env. --- .github/workflows/tests_gpu.yml | 35 +++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index a58aa6b0b4..bc8c13d6f7 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -92,6 +92,16 @@ jobs: runs-on: ${{ matrix.os }} steps: + - name: Validate GPU version and installed compiler + run: | + source /etc/profile.d/modules.sh + module use /opt/modules + module load cuda/12.2 + echo "${PATH}" >> $GITHUB_PATH + echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV + nvcc --version + nvidia-smi + - name: Restoring cached dependencies id: kokkos-cache # uses: actions/cache@v3 @@ -110,27 +120,22 @@ jobs: mkdir -p ${{ github.workspace }}/Kokkos ls -ltrh cp -r ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* ${{ github.workspace }}/Kokkos - ls -l ${{ github.workspace }}/Kokkos - ls -l ${{ github.workspace }}/Kokkos/bin - ls -l ${{ github.workspace }}/Kokkos/include - ls -l ${{ github.workspace }}/Kokkos/lib - - - uses: actions/setup-python@v4 - name: Install Python - with: - python-version: '3.9' - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 with: fetch-depth: 2 + - uses: actions/setup-python@v4 + name: Install Python + with: + python-version: '3.9' + - name: Install dependencies run: sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov - name: Build and run unit tests run: | - ls -l ${{ github.workspace }}/Kokkos cmake . -BBuild -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_TESTS=ON \ @@ -175,6 +180,16 @@ jobs: runs-on: ${{ matrix.os }} steps: + - name: Validate GPU version and installed compiler + run: | + source /etc/profile.d/modules.sh + module use /opt/modules + module load cuda/12.2 + echo "${PATH}" >> $GITHUB_PATH + echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV + nvcc --version + nvidia-smi + - name: Restoring cached dependencies id: kokkos-cache # uses: actions/cache@v3 From ada5a3042ee863ba99792590b44b4a6cfb286633 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 14:49:12 -0400 Subject: [PATCH 074/113] cd main --- .github/workflows/tests_gpu.yml | 36 +++++++++++++++++---------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index bc8c13d6f7..b4306ca404 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -124,6 +124,7 @@ jobs: - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 with: + path: main fetch-depth: 2 - uses: actions/setup-python@v4 @@ -136,35 +137,36 @@ jobs: - name: Build and run unit tests run: | - cmake . -BBuild -G Ninja \ - -DCMAKE_BUILD_TYPE=Debug \ - -DBUILD_TESTS=ON \ - -DENABLE_PYTHON=OFF \ - -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ - -DPL_BACKEND=${{ matrix.pl_backend }} \ - -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \ - -DENABLE_COVERAGE=ON - cmake --build ./Build - cd ./Build - mkdir -p ./tests/results_${{ github.job }}_${{ matrix.pl_backend }} - for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results_${{ github.job }}_${{ matrix.pl_backend }}/report_$file.xml; done; - lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info - lcov --remove coverage.info '/usr/*' --output-file coverage.info - mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info + cd main + cmake . -BBuild -G Ninja \ + -DCMAKE_BUILD_TYPE=Debug \ + -DBUILD_TESTS=ON \ + -DENABLE_PYTHON=OFF \ + -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ + -DPL_BACKEND=${{ matrix.pl_backend }} \ + -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \ + -DENABLE_COVERAGE=ON + cmake --build ./Build + cd ./Build + mkdir -p ./tests/results_${{ github.job }}_${{ matrix.pl_backend }} + for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results_${{ github.job }}_${{ matrix.pl_backend }}/report_$file.xml; done; + lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info + mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info - name: Upload test results uses: actions/upload-artifact@v3 if: always() with: name: ubuntu-tests-reports-${{ github.job }}_${{ matrix.pl_backend }} - path: ./Build/tests/results_${{ github.job }}_${{ matrix.pl_backend }} + path: ./main/Build/tests/results_${{ github.job }}_${{ matrix.pl_backend }} if-no-files-found: error - name: Upload code coverage results uses: actions/upload-artifact@v3 with: name: ubuntu-codecov-results-cpp - path: ./Build/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info + path: ./main/Build/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info if-no-files-found: error pythontestswithKokkos: From e47acb4bba023233b44e051768559888e3c2752e Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 15:08:45 -0400 Subject: [PATCH 075/113] Skip c++ tests. --- .github/workflows/tests_gpu.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index b4306ca404..85a208031c 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -80,6 +80,7 @@ jobs: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} cpptestswithKokkos: + if: ${{ github.sha == 'xxxxxxxx' }} needs: [builddeps] strategy: matrix: @@ -250,9 +251,9 @@ jobs: run: | cd main/ DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` - PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append + PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS mv coverage.xml coverage-${{ github.job }}.xml - name: Install all backend devices From 3a32cafb69c67f61c86597f52bc520507bd350da Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 15 Sep 2023 15:36:49 -0400 Subject: [PATCH 076/113] Comment pl-device-test. --- .github/workflows/tests_gpu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 85a208031c..5edcde14e2 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -251,8 +251,8 @@ jobs: run: | cd main/ DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` - pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append - pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append + # pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append + # pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS mv coverage.xml coverage-${{ github.job }}.xml From fead29108ab646d519c69b98b58f58f27d16d466 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 18 Sep 2023 10:21:06 -0400 Subject: [PATCH 077/113] Mod OMP_ params. --- .github/workflows/tests_gpu.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 5edcde14e2..dbd81631a7 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -242,12 +242,14 @@ jobs: run: | ls -l ${{ github.workspace }}/Kokkos cd main - SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv - name: Run PennyLane-Lightning unit tests if: ${{ matrix.pl_backend != 'all'}} + env: + OMP_NUM_THREADS: 1 + OMP_PROC_BIND: false run: | cd main/ DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` @@ -268,6 +270,9 @@ jobs: - name: Run PennyLane-Lightning unit tests for lightning.qubit with all devices installed if: ${{ matrix.pl_backend == 'all' }} + env: + OMP_NUM_THREADS: 1 + OMP_PROC_BIND: false run: | cd main/ PL_DEVICE=lightning.qubit python -m pytest tests/ $COVERAGE_FLAGS From 7fe7d606c51c6ac2cef0f39d6fa964591b3ed348 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 18 Sep 2023 11:08:44 -0400 Subject: [PATCH 078/113] Try || true --- .github/workflows/tests_gpu.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index dbd81631a7..268f379263 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -253,9 +253,9 @@ jobs: run: | cd main/ DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` - # pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append - # pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append - PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS + pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append 2> /dev/null || echo Something went wrong with pl-device-test shot=20000 + pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append 2> /dev/null || echo Something went wrong with pl-device-test shot=None + PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS 2> /dev/null || echo Something went wrong with Pytest mv coverage.xml coverage-${{ github.job }}.xml - name: Install all backend devices From 84cac81d3e3ca04b8ef1554692cc7548c022f7c0 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 18 Sep 2023 15:11:17 -0400 Subject: [PATCH 079/113] trigger CI From b582371e65a37599206db463d444f2c645a42a87 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 18 Sep 2023 15:13:30 -0400 Subject: [PATCH 080/113] Sleep tests. --- .github/workflows/tests_gpu.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 268f379263..35438a468d 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -251,6 +251,7 @@ jobs: OMP_NUM_THREADS: 1 OMP_PROC_BIND: false run: | + sleep 7200 cd main/ DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append 2> /dev/null || echo Something went wrong with pl-device-test shot=20000 From 1d76edd80011797e2efc354ddd8b361f7bec9e62 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 21 Sep 2023 16:44:04 -0400 Subject: [PATCH 081/113] Add kokkos test. --- .github/workflows/tests_gpu.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 35438a468d..b6d0d787c9 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -68,6 +68,15 @@ jobs: cmake --install ./Build cd - + - name: Test Kokkos core library (Ubuntu) + env: + CMAKE_PREFIX_PATH: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} + run: | + cd kokkos_${{ matrix.exec_model }}/example/build_cmake_installed + cmake -B build + cmake --build build + cmake --build build --target test + - name: Cache installation directories id: kokkos-cache # uses: actions/cache@v3 @@ -251,7 +260,6 @@ jobs: OMP_NUM_THREADS: 1 OMP_PROC_BIND: false run: | - sleep 7200 cd main/ DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append 2> /dev/null || echo Something went wrong with pl-device-test shot=20000 From b49880515147311f56cc15176b62d5d79850c0df Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 21 Sep 2023 16:53:41 -0400 Subject: [PATCH 082/113] Install gfortran --- .github/workflows/tests_gpu.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index b6d0d787c9..573dede655 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -72,6 +72,7 @@ jobs: env: CMAKE_PREFIX_PATH: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} run: | + sudo apt-get update && sudo apt-get -y -q install gfortran-$GCC_VERSION cd kokkos_${{ matrix.exec_model }}/example/build_cmake_installed cmake -B build cmake --build build From b5148ce31c1a07fee5ab9d397100cc23809318e8 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 21 Sep 2023 16:57:59 -0400 Subject: [PATCH 083/113] Which gfortran. --- .github/workflows/tests_gpu.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 573dede655..4a9c455818 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -74,7 +74,9 @@ jobs: run: | sudo apt-get update && sudo apt-get -y -q install gfortran-$GCC_VERSION cd kokkos_${{ matrix.exec_model }}/example/build_cmake_installed - cmake -B build + which -a gfortran + which -a gfortran-$GCC_VERSION + cmake -B build -DCMAKE_Fortran_COMPILER=gfortran-$GCC_VERSION cmake --build build cmake --build build --target test From 9e3e4f775640610c87ddae14f350c608e819d6cc Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 21 Sep 2023 17:06:56 -0400 Subject: [PATCH 084/113] set -x --- .github/workflows/tests_gpu.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 4a9c455818..cce51d7ffd 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -72,6 +72,7 @@ jobs: env: CMAKE_PREFIX_PATH: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} run: | + set -x sudo apt-get update && sudo apt-get -y -q install gfortran-$GCC_VERSION cd kokkos_${{ matrix.exec_model }}/example/build_cmake_installed which -a gfortran @@ -79,6 +80,7 @@ jobs: cmake -B build -DCMAKE_Fortran_COMPILER=gfortran-$GCC_VERSION cmake --build build cmake --build build --target test + set +x - name: Cache installation directories id: kokkos-cache From 23457421b33100f74c4d8539b31801af1f20d86e Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 21 Sep 2023 17:08:46 -0400 Subject: [PATCH 085/113] or --- .github/workflows/tests_gpu.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index cce51d7ffd..5507460637 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -75,8 +75,7 @@ jobs: set -x sudo apt-get update && sudo apt-get -y -q install gfortran-$GCC_VERSION cd kokkos_${{ matrix.exec_model }}/example/build_cmake_installed - which -a gfortran - which -a gfortran-$GCC_VERSION + which -a gfortran || which -a gfortran-$GCC_VERSION cmake -B build -DCMAKE_Fortran_COMPILER=gfortran-$GCC_VERSION cmake --build build cmake --build build --target test From 797fbebe6bf7b15cd5e159b4e96fd8de229c205b Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 21 Sep 2023 17:14:42 -0400 Subject: [PATCH 086/113] Build on kokkos@dev --- .github/workflows/tests_gpu.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 5507460637..95f5485442 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -45,8 +45,9 @@ jobs: # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | rm -rf kokkos_${{ matrix.exec_model }} - git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git kokkos_${{ matrix.exec_model }} + # git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git kokkos_${{ matrix.exec_model }} # git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} + git clone --branch develop https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} pushd . &> /dev/null - name: Build Kokkos core library (Ubuntu) From 117ed047eacc030f856139231a247e56ea04b670 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 21 Sep 2023 17:19:54 -0400 Subject: [PATCH 087/113] Install lightning_qubit prior --- .github/workflows/tests_gpu.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 95f5485442..2a28b9378d 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -256,6 +256,7 @@ jobs: run: | ls -l ${{ github.workspace }}/Kokkos cd main + SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv From 81c3090fefaa761510db94affea50d86872ab874 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 09:13:28 -0400 Subject: [PATCH 088/113] Fix kokkos commit. --- .github/workflows/tests_gpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 2a28b9378d..aa3d6770ce 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -47,7 +47,7 @@ jobs: rm -rf kokkos_${{ matrix.exec_model }} # git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git kokkos_${{ matrix.exec_model }} # git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} - git clone --branch develop https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} + git clone --branch 2e743674a89dc133a6b16e0bc7aa992713e0dbc9 https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} pushd . &> /dev/null - name: Build Kokkos core library (Ubuntu) From 8182a3aca83df08cabbb6a283c3d95fbae559fc1 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 09:18:33 -0400 Subject: [PATCH 089/113] git checkout kokkos --- .github/workflows/tests_gpu.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index aa3d6770ce..8b9110da4e 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -47,7 +47,11 @@ jobs: rm -rf kokkos_${{ matrix.exec_model }} # git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git kokkos_${{ matrix.exec_model }} # git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} - git clone --branch 2e743674a89dc133a6b16e0bc7aa992713e0dbc9 https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} + git clone --branch develop https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} + cd kokkos_${{ matrix.exec_model }} + git checkout 2e743674a89dc133a6b16e0bc7aa992713e0dbc9 + git log | head + cd - pushd . &> /dev/null - name: Build Kokkos core library (Ubuntu) From 3fede7d8b6aa57eab2efcd8d0484d5aa666ed18d Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 09:27:27 -0400 Subject: [PATCH 090/113] Update kokkos commit. --- .github/workflows/tests_gpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 8b9110da4e..b78c2192d9 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -49,7 +49,7 @@ jobs: # git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} git clone --branch develop https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} - git checkout 2e743674a89dc133a6b16e0bc7aa992713e0dbc9 + git checkout e542e989af99cb87881ee2a0d06916541ee76006 git log | head cd - pushd . &> /dev/null From e97b3bf75f1b32891117dc0779954a8b9ffb04c9 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 09:37:44 -0400 Subject: [PATCH 091/113] Restore all --- .github/workflows/tests_gpu.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index b78c2192d9..1e25d08188 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -88,10 +88,6 @@ jobs: - name: Cache installation directories id: kokkos-cache - # uses: actions/cache@v3 - # with: - # path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - # key: c-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} uses: actions/cache/save@v3 with: key: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-${{ github.ref }}-${{ github.sha }} @@ -123,10 +119,6 @@ jobs: - name: Restoring cached dependencies id: kokkos-cache - # uses: actions/cache@v3 - # with: - # path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - # key: c-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} uses: actions/cache/restore@v3 with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} @@ -193,7 +185,7 @@ jobs: strategy: matrix: os: [ubuntu-22.04] - pl_backend: ["lightning_kokkos"] + pl_backend: ["lightning_kokkos", "all"] exec_model: ["CUDA"] kokkos_version: ["4.1.00"] @@ -213,10 +205,6 @@ jobs: - name: Restoring cached dependencies id: kokkos-cache - # uses: actions/cache@v3 - # with: - # path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} - # key: c-${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }} uses: actions/cache/restore@v3 with: path: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} From fbc05fefc808cf30f36259adece3ff90227a1c5d Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 14:17:36 +0000 Subject: [PATCH 092/113] Add kokkos init/finalize bindings. --- .../lightning_kokkos/bindings/LKokkosBindings.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pennylane_lightning/core/src/simulators/lightning_kokkos/bindings/LKokkosBindings.hpp b/pennylane_lightning/core/src/simulators/lightning_kokkos/bindings/LKokkosBindings.hpp index 4f54ca0a0f..bd9d89d72f 100644 --- a/pennylane_lightning/core/src/simulators/lightning_kokkos/bindings/LKokkosBindings.hpp +++ b/pennylane_lightning/core/src/simulators/lightning_kokkos/bindings/LKokkosBindings.hpp @@ -238,6 +238,12 @@ auto getBackendInfo() -> py::dict { * @param m Pybind11 module. */ void registerBackendSpecificInfo(py::module_ &m) { + m.def("kokkos_initialize", []() { Kokkos::initialize(); }); + m.def("kokkos_initialize", + [](const InitializationSettings &args) { Kokkos::initialize(args); }); + m.def("kokkos_finalize", []() { Kokkos::finalize(); }); + m.def("kokkos_is_initialized", []() { return Kokkos::is_initialized(); }); + m.def("kokkos_is_finalized", []() { return Kokkos::is_finalized(); }); m.def("backend_info", &getBackendInfo, "Backend-specific information."); m.def( "print_configuration", From f98189245a050b54df9614b5f164bee98e4a8a44 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 10:18:10 -0400 Subject: [PATCH 093/113] Restore pull_req triggers. --- .github/workflows/changelog_reminder.yml | 2 +- .github/workflows/format.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 +- 11 files changed, 11 insertions(+), 11 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/tests_linux.yml b/.github/workflows/tests_linux.yml index 180fde5e9b..244ca259c2 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -1,6 +1,6 @@ name: Testing (Linux) on: - #pull_request: + pull_request: push: branches: - master diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index b5935c8e66..65f033ce4f 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 c3df8d444c..d70669fa96 100644 --- a/.github/workflows/tests_without_binary.yml +++ b/.github/workflows/tests_without_binary.yml @@ -3,7 +3,7 @@ on: push: branches: - master - #pull_request: + 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" 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 abb74ca216..50a3f81c72 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 d5e1d53441..82e6220524 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 9654103161..0d0b0989ea 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 3c265f86981192c09abb6b817ffb7ee55e1003c5 Mon Sep 17 00:00:00 2001 From: Dev version update bot Date: Fri, 22 Sep 2023 14:18:32 +0000 Subject: [PATCH 094/113] Auto update version --- pennylane_lightning/core/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index 08baf0c551..046eb22c01 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.33.0-dev13" +__version__ = "0.33.0-dev14" From 420098bed03e10757e879b7005be98165f1296cc Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 10:19:21 -0400 Subject: [PATCH 095/113] Remove set-x --- .github/workflows/tests_gpu.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 1e25d08188..8dd039bfc3 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -77,14 +77,12 @@ jobs: env: CMAKE_PREFIX_PATH: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} run: | - set -x sudo apt-get update && sudo apt-get -y -q install gfortran-$GCC_VERSION cd kokkos_${{ matrix.exec_model }}/example/build_cmake_installed which -a gfortran || which -a gfortran-$GCC_VERSION cmake -B build -DCMAKE_Fortran_COMPILER=gfortran-$GCC_VERSION cmake --build build cmake --build build --target test - set +x - name: Cache installation directories id: kokkos-cache From 4f19bcb94dd2ac98323a2ed232cb9641c246313b Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 10:21:43 -0400 Subject: [PATCH 096/113] Remove commented ifs. --- .github/workflows/tests_gpu.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 8dd039bfc3..18be02e888 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -42,7 +42,6 @@ jobs: nvidia-smi - name: Clone Kokkos repository - # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | rm -rf kokkos_${{ matrix.exec_model }} # git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git kokkos_${{ matrix.exec_model }} @@ -55,7 +54,6 @@ jobs: pushd . &> /dev/null - name: Build Kokkos core library (Ubuntu) - # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | rm -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} @@ -124,7 +122,6 @@ jobs: restore-keys: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-${{ github.ref }}- - name: Copy cached libraries - # if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | mkdir -p ${{ github.workspace }}/Kokkos ls -ltrh @@ -183,7 +180,7 @@ jobs: strategy: matrix: os: [ubuntu-22.04] - pl_backend: ["lightning_kokkos", "all"] + pl_backend: ["all", "lightning_kokkos"] exec_model: ["CUDA"] kokkos_version: ["4.1.00"] @@ -210,7 +207,6 @@ jobs: restore-keys: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-${{ github.ref }}- - name: Copy cached libraries - # if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | mkdir -p ${{ github.workspace }}/Kokkos ls -ltrh From 60371aa73591c5eaff488be9dae187bc3fb3da68 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 10:28:41 -0400 Subject: [PATCH 097/113] Switch all order. --- .github/workflows/tests_gpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 18be02e888..a0c924d4b0 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -180,7 +180,7 @@ jobs: strategy: matrix: os: [ubuntu-22.04] - pl_backend: ["all", "lightning_kokkos"] + pl_backend: ["lightning_kokkos", "all"] exec_model: ["CUDA"] kokkos_version: ["4.1.00"] From 32e0c15eec712f9bb872588392f96649e9d39c27 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 10:44:51 -0400 Subject: [PATCH 098/113] trigger CI From 905a2000081bf25a3ab2eaa7327e5482c164ae37 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 11:32:12 -0400 Subject: [PATCH 099/113] trigger CI From ad0a4537e63451acda65f6ece3df9509faaac860 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 11:51:37 -0400 Subject: [PATCH 100/113] Revert to e97b3bf --- .github/workflows/tests_gpu.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index a0c924d4b0..1e25d08188 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -42,6 +42,7 @@ jobs: nvidia-smi - name: Clone Kokkos repository + # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | rm -rf kokkos_${{ matrix.exec_model }} # git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git kokkos_${{ matrix.exec_model }} @@ -54,6 +55,7 @@ jobs: pushd . &> /dev/null - name: Build Kokkos core library (Ubuntu) + # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | rm -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} @@ -75,12 +77,14 @@ jobs: env: CMAKE_PREFIX_PATH: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} run: | + set -x sudo apt-get update && sudo apt-get -y -q install gfortran-$GCC_VERSION cd kokkos_${{ matrix.exec_model }}/example/build_cmake_installed which -a gfortran || which -a gfortran-$GCC_VERSION cmake -B build -DCMAKE_Fortran_COMPILER=gfortran-$GCC_VERSION cmake --build build cmake --build build --target test + set +x - name: Cache installation directories id: kokkos-cache @@ -122,6 +126,7 @@ jobs: restore-keys: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-${{ github.ref }}- - name: Copy cached libraries + # if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | mkdir -p ${{ github.workspace }}/Kokkos ls -ltrh @@ -207,6 +212,7 @@ jobs: restore-keys: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-${{ github.ref }}- - name: Copy cached libraries + # if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | mkdir -p ${{ github.workspace }}/Kokkos ls -ltrh From 183a42dace4ff5b41e5596f53366ffdce99364bc Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 14:34:14 -0400 Subject: [PATCH 101/113] Comment pull_requests. --- .github/workflows/changelog_reminder.yml | 2 +- .github/workflows/format.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 +- 11 files changed, 11 insertions(+), 11 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/tests_linux.yml b/.github/workflows/tests_linux.yml index 244ca259c2..180fde5e9b 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -1,6 +1,6 @@ name: Testing (Linux) on: - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index 65f033ce4f..b5935c8e66 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 d70669fa96..c3df8d444c 100644 --- a/.github/workflows/tests_without_binary.yml +++ b/.github/workflows/tests_without_binary.yml @@ -3,7 +3,7 @@ on: push: branches: - master - pull_request: + #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" 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 50a3f81c72..abb74ca216 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 82e6220524..d5e1d53441 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 0d0b0989ea..9654103161 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 8964ec83f540cbe42b6f420ccc6cd81f553c9afd Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 14:56:35 -0400 Subject: [PATCH 102/113] Restore triggers. --- .github/workflows/changelog_reminder.yml | 2 +- .github/workflows/format.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 +- 11 files changed, 11 insertions(+), 11 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/tests_linux.yml b/.github/workflows/tests_linux.yml index 180fde5e9b..244ca259c2 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -1,6 +1,6 @@ name: Testing (Linux) on: - #pull_request: + pull_request: push: branches: - master diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index b5935c8e66..65f033ce4f 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 c3df8d444c..d70669fa96 100644 --- a/.github/workflows/tests_without_binary.yml +++ b/.github/workflows/tests_without_binary.yml @@ -3,7 +3,7 @@ on: push: branches: - master - #pull_request: + 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" 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 abb74ca216..50a3f81c72 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 d5e1d53441..82e6220524 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 9654103161..0d0b0989ea 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 00aa8540d19b1b895beb6b5ae29ccd6aa5d6af45 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 15:08:57 -0400 Subject: [PATCH 103/113] runs-on gpu --- .github/workflows/tests_gpu.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 1e25d08188..0d5653401b 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -104,8 +104,11 @@ jobs: kokkos_version: ["4.1.00"] name: C++ tests (Kokkos) - runs-on: ${{ matrix.os }} - + runs-on: + - ${{ matrix.os }} + - self-hosted + - gpu + steps: - name: Validate GPU version and installed compiler run: | @@ -190,8 +193,11 @@ jobs: kokkos_version: ["4.1.00"] name: Python tests with Kokkos - runs-on: ${{ matrix.os }} - + runs-on: + - ${{ matrix.os }} + - self-hosted + - gpu + steps: - name: Validate GPU version and installed compiler run: | From e8dcdb3d89399459c103e010840b5ac45a31f0a3 Mon Sep 17 00:00:00 2001 From: Dev version update bot Date: Fri, 22 Sep 2023 19:42:04 +0000 Subject: [PATCH 104/113] Auto update version --- pennylane_lightning/core/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index 046eb22c01..3e073e404a 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.33.0-dev14" +__version__ = "0.33.0-dev15" From 39a6b017a07c01eddfb15557eb450d24f06c826b Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 22 Sep 2023 15:45:16 -0400 Subject: [PATCH 105/113] trigger CI From 2aab32248d5b268ced0ab405c16586bc7e507541 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 2 Oct 2023 08:46:58 -0400 Subject: [PATCH 106/113] Set KOKKOS_VERSION in env. --- .github/workflows/tests_gpu.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index 0d5653401b..a6657d60e4 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -9,6 +9,7 @@ env: CI_CUDA_ARCH: 86 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 + KOKKOS_VERSION: e542e989af99cb87881ee2a0d06916541ee76006 TF_VERSION: 2.10.0 TORCH_VERSION: 1.11.0+cpu @@ -42,20 +43,18 @@ jobs: nvidia-smi - name: Clone Kokkos repository - # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | rm -rf kokkos_${{ matrix.exec_model }} # git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git kokkos_${{ matrix.exec_model }} # git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} git clone --branch develop https://github.com/kokkos/kokkos.git kokkos_${{ matrix.exec_model }} cd kokkos_${{ matrix.exec_model }} - git checkout e542e989af99cb87881ee2a0d06916541ee76006 + git checkout $KOKKOS_VERSION git log | head cd - pushd . &> /dev/null - name: Build Kokkos core library (Ubuntu) - # if: steps.kokkos-cache.outputs.cache-hit != 'true' run: | rm -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} mkdir -p ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} @@ -129,7 +128,6 @@ jobs: restore-keys: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-${{ github.ref }}- - name: Copy cached libraries - # if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | mkdir -p ${{ github.workspace }}/Kokkos ls -ltrh @@ -218,7 +216,6 @@ jobs: restore-keys: ${{ matrix.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}-${{ github.ref }}- - name: Copy cached libraries - # if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | mkdir -p ${{ github.workspace }}/Kokkos ls -ltrh From d70f920287b7944a0d41f04d7b8b21998b986896 Mon Sep 17 00:00:00 2001 From: Dev version update bot Date: Mon, 2 Oct 2023 12:47:45 +0000 Subject: [PATCH 107/113] Auto update version --- pennylane_lightning/core/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index a946116c88..49d70f2d90 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.33.0-dev16" +__version__ = "0.33.0-dev17" From 062393dd54193af7a42e3407a2df5c429cb647cf Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 2 Oct 2023 08:48:09 -0400 Subject: [PATCH 108/113] trigger CI From 0d013b1f4247af21c25ef45cc86ac1468042470a Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 5 Oct 2023 15:46:33 -0400 Subject: [PATCH 109/113] Remove unnecessary fetch-depth. --- .github/workflows/tests_gpu.yml | 2 - .../cpu_kernels/GateImplementationsLM.hpp | 198 ++++++++++++++++-- tests/test_gates.py | 144 +++++++++++++ 3 files changed, 330 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index a6657d60e4..a79c5ce791 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -137,7 +137,6 @@ jobs: uses: actions/checkout@v3 with: path: main - fetch-depth: 2 - uses: actions/setup-python@v4 name: Install Python @@ -225,7 +224,6 @@ jobs: uses: actions/checkout@v3 with: path: main - fetch-depth: 2 - uses: actions/setup-python@v4 name: Install Python diff --git a/pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/GateImplementationsLM.hpp b/pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/GateImplementationsLM.hpp index 58cd4a98f8..312cd82311 100644 --- a/pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/GateImplementationsLM.hpp +++ b/pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/GateImplementationsLM.hpp @@ -126,6 +126,22 @@ class GateImplementationsLM : public PauliGenerator { return parity; } + template + static constexpr auto + revWireParityN(const std::array &wire_list) + -> std::array { + auto rev_wire = wire_list; + std::sort(rev_wire.begin(), rev_wire.end()); + std::array parity; + parity[0] = fillTrailingOnes(rev_wire[0]); + for (std::size_t i = 1; i < wire_size; i++) { + parity[i] = fillLeadingOnes(rev_wire[i - 1] + 1) & + fillTrailingOnes(rev_wire[i]); + } + parity[wire_size] = fillLeadingOnes(rev_wire[-1] + 1); + return parity; + } + public: constexpr static KernelType kernel_id = KernelType::LM; constexpr static std::string_view name = "LM"; @@ -152,6 +168,7 @@ class GateImplementationsLM : public PauliGenerator { GateOperation::CY, GateOperation::CZ, GateOperation::SWAP, + GateOperation::ISWAP, GateOperation::CSWAP, GateOperation::Toffoli, GateOperation::IsingXX, @@ -212,6 +229,10 @@ class GateImplementationsLM : public PauliGenerator { const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); const auto [parity_high, parity_low] = revWireParity(rev_wire); + // const auto parities = + // revWireParityN(std::array{rev_wire}); + // const auto parity_low = parities[0]; + // const auto parity_high = parities[1]; if (inverse) { for (size_t k = 0; k < exp2(num_qubits - 1); k++) { @@ -241,6 +262,7 @@ class GateImplementationsLM : public PauliGenerator { } } } + /** * @brief Apply a two qubit gate to the statevector. * @@ -337,7 +359,6 @@ class GateImplementationsLM : public PauliGenerator { const size_t dim = static_cast(1U) << wires.size(); std::vector indices(dim); std::vector> coeffs_in(dim, 0.0); - if (inverse) { for (size_t k = 0; k < exp2(num_qubits); k += dim) { for (size_t inner_idx = 0; inner_idx < dim; inner_idx++) { @@ -388,6 +409,73 @@ class GateImplementationsLM : public PauliGenerator { } } + template + static void applyNQubitOp(std::complex *arr, size_t num_qubits, + const std::complex *matrix, + const std::vector &controlled_wires, + const std::vector &wires, bool inverse) { + using Pennylane::Util::bitswap; + const std::size_t nw_tot = controlled_wires.size() + wires.size(); + PL_ASSERT(num_qubits >= nw_tot); + const size_t step = static_cast(1U) << nw_tot; + const size_t dim = static_cast(1U) << wires.size(); + std::vector indices(dim); + std::vector> coeffs_in(dim, 0.0); + + if (inverse) { + for (size_t k = 0; k < exp2(num_qubits); k += dim) { + for (size_t inner_idx = 0; inner_idx < dim; inner_idx++) { + size_t idx = k | inner_idx; + const size_t n_wires = wires.size(); + for (size_t pos = 0; pos < n_wires; pos++) { + idx = bitswap(idx, n_wires - pos - 1, + num_qubits - wires[pos] - 1); + } + indices[inner_idx] = idx; + coeffs_in[inner_idx] = arr[idx]; + } + + for (size_t i = 0; i < dim; i++) { + const auto idx = indices[i]; + arr[idx] = 0.0; + + for (size_t j = 0; j < dim; j++) { + const size_t base_idx = j * dim; + arr[idx] += + std::conj(matrix[base_idx + i]) * coeffs_in[j]; + } + } + } + } else { + for (size_t k = 0; k < exp2(num_qubits); k += step) { + for (size_t inner_idx = 0; inner_idx < dim; inner_idx++) { + const size_t n_contr = controlled_wires.size(); + const size_t n_wires = wires.size(); + size_t idx = k | (inner_idx << n_contr) | + (fillTrailingOnes(n_contr)); + for (size_t pos = 0; pos < n_wires; pos++) { + idx = bitswap(idx, n_wires - (pos + n_contr) - 1, + num_qubits - (wires[pos] + n_contr) - 1); + } + for (size_t pos = 0; pos < n_contr; pos++) { + idx = bitswap(idx, n_wires - pos - 1, + num_qubits - controlled_wires[pos] - 1); + } + indices[inner_idx] = idx; + coeffs_in[inner_idx] = arr[idx]; + } + for (size_t i = 0; i < dim; i++) { + const auto idx = indices[i]; + const size_t base_idx = i * dim; + arr[idx] = 0.0; + for (size_t j = 0; j < dim; j++) { + arr[idx] += matrix[base_idx + j] * coeffs_in[j]; + } + } + } + } + } + template static void applyIdentity(std::complex *arr, const size_t num_qubits, @@ -409,7 +497,11 @@ class GateImplementationsLM : public PauliGenerator { const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - const auto [parity_high, parity_low] = revWireParity(rev_wire); + // const auto [parity_high, parity_low] = revWireParity(rev_wire); + const auto parities = + revWireParityN(std::array{rev_wire}); + const auto parity_low = parities[0]; + const auto parity_high = parities[1]; for (size_t k = 0; k < exp2(num_qubits - 1); k++) { const size_t i0 = ((k << 1U) & parity_high) | (parity_low & k); @@ -427,7 +519,11 @@ class GateImplementationsLM : public PauliGenerator { const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - const auto [parity_high, parity_low] = revWireParity(rev_wire); + // const auto [parity_high, parity_low] = revWireParity(rev_wire); + const auto parities = + revWireParityN(std::array{rev_wire}); + const auto parity_low = parities[0]; + const auto parity_high = parities[1]; for (size_t k = 0; k < exp2(num_qubits - 1); k++) { const size_t i0 = ((k << 1U) & parity_high) | (parity_low & k); @@ -447,7 +543,11 @@ class GateImplementationsLM : public PauliGenerator { PL_ASSERT(wires.size() == 1); const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - const auto [parity_high, parity_low] = revWireParity(rev_wire); + // const auto [parity_high, parity_low] = revWireParity(rev_wire); + const auto parities = + revWireParityN(std::array{rev_wire}); + const auto parity_low = parities[0]; + const auto parity_high = parities[1]; for (size_t k = 0; k < exp2(num_qubits - 1); k++) { const size_t i0 = ((k << 1U) & parity_high) | (parity_low & k); @@ -465,7 +565,11 @@ class GateImplementationsLM : public PauliGenerator { constexpr static auto isqrt2 = INVSQRT2(); const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - const auto [parity_high, parity_low] = revWireParity(rev_wire); + // const auto [parity_high, parity_low] = revWireParity(rev_wire); + const auto parities = + revWireParityN(std::array{rev_wire}); + const auto parity_low = parities[0]; + const auto parity_high = parities[1]; for (size_t k = 0; k < exp2(num_qubits - 1); k++) { const size_t i0 = ((k << 1U) & parity_high) | (parity_low & k); @@ -484,7 +588,11 @@ class GateImplementationsLM : public PauliGenerator { PL_ASSERT(wires.size() == 1); const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - const auto [parity_high, parity_low] = revWireParity(rev_wire); + // const auto [parity_high, parity_low] = revWireParity(rev_wire); + const auto parities = + revWireParityN(std::array{rev_wire}); + const auto parity_low = parities[0]; + const auto parity_high = parities[1]; const std::complex shift = (inverse) ? -Pennylane::Util::IMAG() @@ -504,7 +612,11 @@ class GateImplementationsLM : public PauliGenerator { PL_ASSERT(wires.size() == 1); const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - const auto [parity_high, parity_low] = revWireParity(rev_wire); + // const auto [parity_high, parity_low] = revWireParity(rev_wire); + const auto parities = + revWireParityN(std::array{rev_wire}); + const auto parity_low = parities[0]; + const auto parity_high = parities[1]; constexpr static auto isqrt2 = INVSQRT2(); @@ -526,7 +638,11 @@ class GateImplementationsLM : public PauliGenerator { PL_ASSERT(wires.size() == 1); const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - const auto [parity_high, parity_low] = revWireParity(rev_wire); + // const auto [parity_high, parity_low] = revWireParity(rev_wire); + const auto parities = + revWireParityN(std::array{rev_wire}); + const auto parity_low = parities[0]; + const auto parity_high = parities[1]; const std::complex s = inverse ? std::exp(-std::complex(0, angle)) @@ -546,7 +662,11 @@ class GateImplementationsLM : public PauliGenerator { PL_ASSERT(wires.size() == 1); const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - const auto [parity_high, parity_low] = revWireParity(rev_wire); + // const auto [parity_high, parity_low] = revWireParity(rev_wire); + const auto parities = + revWireParityN(std::array{rev_wire}); + const auto parity_low = parities[0]; + const auto parity_high = parities[1]; const PrecisionT c = std::cos(angle / 2); const PrecisionT js = @@ -571,7 +691,11 @@ class GateImplementationsLM : public PauliGenerator { PL_ASSERT(wires.size() == 1); const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - const auto [parity_high, parity_low] = revWireParity(rev_wire); + // const auto [parity_high, parity_low] = revWireParity(rev_wire); + const auto parities = + revWireParityN(std::array{rev_wire}); + const auto parity_low = parities[0]; + const auto parity_high = parities[1]; const PrecisionT c = std::cos(angle / 2); const PrecisionT s = @@ -597,7 +721,11 @@ class GateImplementationsLM : public PauliGenerator { const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - const auto [parity_high, parity_low] = revWireParity(rev_wire); + // const auto [parity_high, parity_low] = revWireParity(rev_wire); + const auto parities = + revWireParityN(std::array{rev_wire}); + const auto parity_low = parities[0]; + const auto parity_high = parities[1]; const std::complex first = std::complex{std::cos(angle / 2), -std::sin(angle / 2)}; @@ -765,6 +893,35 @@ class GateImplementationsLM : public PauliGenerator { } } + template + static void applyISWAP(std::complex *arr, size_t num_qubits, + const std::vector &wires, bool inverse) { + using ComplexT = std::complex; + PL_ASSERT(wires.size() == 2); + + const size_t rev_wire0 = num_qubits - wires[1] - 1; + const size_t rev_wire1 = num_qubits - wires[0] - 1; // Control qubit + + const size_t rev_wire0_shift = static_cast(1U) << rev_wire0; + const size_t rev_wire1_shift = static_cast(1U) << rev_wire1; + + const auto [parity_high, parity_middle, parity_low] = + revWireParity(rev_wire0, rev_wire1); + + for (size_t k = 0; k < exp2(num_qubits - 2); k++) { + const size_t i00 = ((k << 2U) & parity_high) | + ((k << 1U) & parity_middle) | (k & parity_low); + const size_t i10 = i00 | rev_wire1_shift; + const size_t i01 = i00 | rev_wire0_shift; + const ComplexT v01 = arr[i01]; + const ComplexT v10 = arr[i10]; + arr[i01] = inverse ? ComplexT{std::imag(v10), -std::real(v10)} + : ComplexT{-std::imag(v10), std::real(v10)}; + arr[i10] = inverse ? ComplexT{std::imag(v01), -std::real(v01)} + : ComplexT{-std::imag(v01), std::real(v01)}; + } + } + template static void applyIsingXX(std::complex *arr, size_t num_qubits, const std::vector &wires, bool inverse, @@ -1361,7 +1518,11 @@ class GateImplementationsLM : public PauliGenerator { [[maybe_unused]] bool adj) -> PrecisionT { PL_ASSERT(wires.size() == 1); const size_t rev_wire = num_qubits - wires[0] - 1; - const auto [parity_high, parity_low] = revWireParity(rev_wire); + // const auto [parity_high, parity_low] = revWireParity(rev_wire); + const auto parities = + revWireParityN(std::array{rev_wire}); + const auto parity_low = parities[0]; + const auto parity_high = parities[1]; for (size_t k = 0; k < exp2(num_qubits - 1); k++) { const size_t i0 = ((k << 1U) & parity_high) | (parity_low & k); @@ -1660,6 +1821,12 @@ extern template void GateImplementationsLM::applyMultiQubitOp( extern template void GateImplementationsLM::applyMultiQubitOp( std::complex *, size_t, const std::complex *, const std::vector &, bool); +extern template void GateImplementationsLM::applyNQubitOp( + std::complex *, size_t, const std::complex *, + const std::vector &, const std::vector &, bool); +extern template void GateImplementationsLM::applyNQubitOp( + std::complex *, size_t, const std::complex *, + const std::vector &, const std::vector &, bool); // Single-qubit gates extern template void @@ -1769,6 +1936,13 @@ extern template void GateImplementationsLM::applySWAP(std::complex *, size_t, const std::vector &, bool); +extern template void +GateImplementationsLM::applyISWAP(std::complex *, size_t, + const std::vector &, bool); +extern template void +GateImplementationsLM::applyISWAP(std::complex *, size_t, + const std::vector &, bool); + extern template void GateImplementationsLM::applyIsingXX( std::complex *, size_t, const std::vector &, bool, float); extern template void GateImplementationsLM::applyIsingXX( diff --git a/tests/test_gates.py b/tests/test_gates.py index d3d33b8ade..4f6d6987af 100644 --- a/tests/test_gates.py +++ b/tests/test_gates.py @@ -263,3 +263,147 @@ def circuit(): circ = qml.QNode(circuit, dev) circ_def = qml.QNode(circuit, dev_def) assert np.allclose(circ(), circ_def(), tol) + + +# @pytest.mark.parametrize("theta,phi", list(zip(THETA, PHI))) +# @pytest.mark.parametrize( +# "wires", +# [ +# [0, 1, 2], +# [0, 2, 1], +# [1, 0, 2], +# [1, 2, 0], +# [2, 0, 1], +# [2, 1, 0], +# ], +# ) +# def test_qubit_U3(wires, theta, phi, tol): +# """Test that Hadamard expectation value is correct""" +# n_qubits = 3 +# dev_def = qml.device("default.qubit", wires=n_qubits) +# dev = qml.device(device_name, wires=n_qubits) +# m = 2 ** len(wires) +# U = np.random.rand(m, m) + 1j * np.random.rand(m, m) +# U, _ = np.linalg.qr(U) +# init_state = np.random.rand(2**n_qubits) + 1j * np.random.rand(2**n_qubits) +# init_state /= np.sqrt(np.dot(np.conj(init_state), init_state)) + +# def circuit(): +# qml.StatePrep(init_state, wires=range(n_qubits)) +# qml.RY(theta, wires=[0]) +# qml.RY(phi, wires=[1]) +# qml.CNOT(wires=[0, 1]) +# qml.QubitUnitary(U, wires=[w for w in wires]) +# return qml.state() + +# circ = qml.QNode(circuit, dev) +# circ_def = qml.QNode(circuit, dev_def) +# assert np.allclose(circ(), circ_def(), tol) + + +# @pytest.mark.parametrize( +# "params", +# [ +# (2, [0], [1]), +# # (2, [1], [0]), +# # (3, [1], [2]), +# # (3, [2], [1]), +# # (3, [0], [2]), +# # (3, [2], [0]), +# # (4, [0], [1, 2]), +# # (4, [0], [2, 1]), +# ], +# ) +# def test_n0_controlled_qubit_unitary(params, tol): +# """Test that Hadamard expectation value is correct""" +# n_qubits, control_wires, wires = params +# dev_def = qml.device("default.qubit", wires=n_qubits) +# dev = qml.device(device_name, wires=n_qubits) +# m = 2 ** len(wires) +# U = np.random.rand(m, m) + 1.0j * np.random.rand(m, m) +# U, _ = np.linalg.qr(U) +# # U = qml.CY(wires=wires).matrix() +# init_state = np.random.rand(2**n_qubits) + 1.0j * np.random.rand(2**n_qubits) +# init_state /= np.sqrt(np.dot(np.conj(init_state), init_state)) + +# def circuit(): +# qml.StatePrep(init_state, wires=range(n_qubits)) +# qml.ControlledQubitUnitary(U, control_wires=control_wires, wires=wires) +# return qml.state() + +# circ = qml.QNode(circuit, dev) +# circ_def = qml.QNode(circuit, dev_def) +# print(init_state) +# print(circ_def()) +# print(circ()) +# assert np.allclose(circ(), circ_def(), tol) + + +# @pytest.mark.skipif(device_name != "lightning.qubit", reason="LightningQubit required") +# @pytest.mark.parametrize("theta,phi", list(zip(THETA, PHI))) +# @pytest.mark.parametrize( +# "wires", +# [ +# # [0], +# # [1], +# # [2], +# # [0, 3], +# # [1, 3], +# # [2, 3], +# [3, 0], +# [3, 1], +# [3, 2], +# # [0, 3, 5], +# # [1, 3, 5], +# # [2, 3, 5], +# ], +# ) +# @pytest.mark.parametrize( +# "controls", +# [ +# [0], +# [1], +# [2], +# [4], +# # [0, 4], +# # [1, 4], +# # [2, 4], +# # [0, 4, 6], +# # [1, 4, 6], +# # [2, 4, 6], +# ], +# ) +# def test_controlled_qubit_unitary(controls, wires, theta, phi, tol): +# """Test that Hadamard expectation value is correct""" +# if set(controls).intersection(wires) or set(wires).intersection(controls): +# return +# n_qubits = 8 +# n_wires = len(wires) +# dev_def = qml.device("default.qubit", wires=n_qubits) +# dev = qml.device(device_name, wires=n_qubits) +# m = 2**n_wires +# U = np.random.rand(m, m) + 1.0j * np.random.rand(m, m) +# U, _ = np.linalg.qr(U) +# # U = np.array(qml.PauliX([0]).matrix(), dtype=np.complex128) +# init_state = np.random.rand(2**n_qubits) + 1.0j * np.random.rand(2**n_qubits) +# init_state /= np.sqrt(np.dot(np.conj(init_state), init_state)) +# # print(f"norm={np.sqrt(np.dot(np.conj(init_state), init_state))}") + +# # print(wires) + +# def circuit(): +# qml.StatePrep(init_state, wires=range(n_qubits)) +# # qml.RY(theta, wires=[0]) +# # qml.RY(phi, wires=[1]) +# # qml.CNOT(wires=[0, 1]) +# qml.ControlledQubitUnitary(U, control_wires=controls, wires=wires) +# return qml.state() + +# circ = qml.QNode(circuit, dev) +# circ_def = qml.QNode(circuit, dev_def) +# # print(np.real(init_state)) +# # print(np.real(circ_def())) +# # print(np.real(circ())) +# # print(np.real(circ() - circ_def())) +# # print(np.imag(circ() - circ_def())) +# assert np.allclose(circ(), circ_def(), tol) From be0fa5ce05eb561b9f5849643f7852f41f722c1c Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Tue, 10 Oct 2023 09:28:25 -0400 Subject: [PATCH 110/113] Remove unwanted ISWAP changes. --- .../cpu_kernels/GateImplementationsLM.hpp | 198 ++---------------- tests/test_gates.py | 144 ------------- 2 files changed, 12 insertions(+), 330 deletions(-) diff --git a/pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/GateImplementationsLM.hpp b/pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/GateImplementationsLM.hpp index 312cd82311..58cd4a98f8 100644 --- a/pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/GateImplementationsLM.hpp +++ b/pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/GateImplementationsLM.hpp @@ -126,22 +126,6 @@ class GateImplementationsLM : public PauliGenerator { return parity; } - template - static constexpr auto - revWireParityN(const std::array &wire_list) - -> std::array { - auto rev_wire = wire_list; - std::sort(rev_wire.begin(), rev_wire.end()); - std::array parity; - parity[0] = fillTrailingOnes(rev_wire[0]); - for (std::size_t i = 1; i < wire_size; i++) { - parity[i] = fillLeadingOnes(rev_wire[i - 1] + 1) & - fillTrailingOnes(rev_wire[i]); - } - parity[wire_size] = fillLeadingOnes(rev_wire[-1] + 1); - return parity; - } - public: constexpr static KernelType kernel_id = KernelType::LM; constexpr static std::string_view name = "LM"; @@ -168,7 +152,6 @@ class GateImplementationsLM : public PauliGenerator { GateOperation::CY, GateOperation::CZ, GateOperation::SWAP, - GateOperation::ISWAP, GateOperation::CSWAP, GateOperation::Toffoli, GateOperation::IsingXX, @@ -229,10 +212,6 @@ class GateImplementationsLM : public PauliGenerator { const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); const auto [parity_high, parity_low] = revWireParity(rev_wire); - // const auto parities = - // revWireParityN(std::array{rev_wire}); - // const auto parity_low = parities[0]; - // const auto parity_high = parities[1]; if (inverse) { for (size_t k = 0; k < exp2(num_qubits - 1); k++) { @@ -262,7 +241,6 @@ class GateImplementationsLM : public PauliGenerator { } } } - /** * @brief Apply a two qubit gate to the statevector. * @@ -359,6 +337,7 @@ class GateImplementationsLM : public PauliGenerator { const size_t dim = static_cast(1U) << wires.size(); std::vector indices(dim); std::vector> coeffs_in(dim, 0.0); + if (inverse) { for (size_t k = 0; k < exp2(num_qubits); k += dim) { for (size_t inner_idx = 0; inner_idx < dim; inner_idx++) { @@ -409,73 +388,6 @@ class GateImplementationsLM : public PauliGenerator { } } - template - static void applyNQubitOp(std::complex *arr, size_t num_qubits, - const std::complex *matrix, - const std::vector &controlled_wires, - const std::vector &wires, bool inverse) { - using Pennylane::Util::bitswap; - const std::size_t nw_tot = controlled_wires.size() + wires.size(); - PL_ASSERT(num_qubits >= nw_tot); - const size_t step = static_cast(1U) << nw_tot; - const size_t dim = static_cast(1U) << wires.size(); - std::vector indices(dim); - std::vector> coeffs_in(dim, 0.0); - - if (inverse) { - for (size_t k = 0; k < exp2(num_qubits); k += dim) { - for (size_t inner_idx = 0; inner_idx < dim; inner_idx++) { - size_t idx = k | inner_idx; - const size_t n_wires = wires.size(); - for (size_t pos = 0; pos < n_wires; pos++) { - idx = bitswap(idx, n_wires - pos - 1, - num_qubits - wires[pos] - 1); - } - indices[inner_idx] = idx; - coeffs_in[inner_idx] = arr[idx]; - } - - for (size_t i = 0; i < dim; i++) { - const auto idx = indices[i]; - arr[idx] = 0.0; - - for (size_t j = 0; j < dim; j++) { - const size_t base_idx = j * dim; - arr[idx] += - std::conj(matrix[base_idx + i]) * coeffs_in[j]; - } - } - } - } else { - for (size_t k = 0; k < exp2(num_qubits); k += step) { - for (size_t inner_idx = 0; inner_idx < dim; inner_idx++) { - const size_t n_contr = controlled_wires.size(); - const size_t n_wires = wires.size(); - size_t idx = k | (inner_idx << n_contr) | - (fillTrailingOnes(n_contr)); - for (size_t pos = 0; pos < n_wires; pos++) { - idx = bitswap(idx, n_wires - (pos + n_contr) - 1, - num_qubits - (wires[pos] + n_contr) - 1); - } - for (size_t pos = 0; pos < n_contr; pos++) { - idx = bitswap(idx, n_wires - pos - 1, - num_qubits - controlled_wires[pos] - 1); - } - indices[inner_idx] = idx; - coeffs_in[inner_idx] = arr[idx]; - } - for (size_t i = 0; i < dim; i++) { - const auto idx = indices[i]; - const size_t base_idx = i * dim; - arr[idx] = 0.0; - for (size_t j = 0; j < dim; j++) { - arr[idx] += matrix[base_idx + j] * coeffs_in[j]; - } - } - } - } - } - template static void applyIdentity(std::complex *arr, const size_t num_qubits, @@ -497,11 +409,7 @@ class GateImplementationsLM : public PauliGenerator { const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - // const auto [parity_high, parity_low] = revWireParity(rev_wire); - const auto parities = - revWireParityN(std::array{rev_wire}); - const auto parity_low = parities[0]; - const auto parity_high = parities[1]; + const auto [parity_high, parity_low] = revWireParity(rev_wire); for (size_t k = 0; k < exp2(num_qubits - 1); k++) { const size_t i0 = ((k << 1U) & parity_high) | (parity_low & k); @@ -519,11 +427,7 @@ class GateImplementationsLM : public PauliGenerator { const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - // const auto [parity_high, parity_low] = revWireParity(rev_wire); - const auto parities = - revWireParityN(std::array{rev_wire}); - const auto parity_low = parities[0]; - const auto parity_high = parities[1]; + const auto [parity_high, parity_low] = revWireParity(rev_wire); for (size_t k = 0; k < exp2(num_qubits - 1); k++) { const size_t i0 = ((k << 1U) & parity_high) | (parity_low & k); @@ -543,11 +447,7 @@ class GateImplementationsLM : public PauliGenerator { PL_ASSERT(wires.size() == 1); const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - // const auto [parity_high, parity_low] = revWireParity(rev_wire); - const auto parities = - revWireParityN(std::array{rev_wire}); - const auto parity_low = parities[0]; - const auto parity_high = parities[1]; + const auto [parity_high, parity_low] = revWireParity(rev_wire); for (size_t k = 0; k < exp2(num_qubits - 1); k++) { const size_t i0 = ((k << 1U) & parity_high) | (parity_low & k); @@ -565,11 +465,7 @@ class GateImplementationsLM : public PauliGenerator { constexpr static auto isqrt2 = INVSQRT2(); const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - // const auto [parity_high, parity_low] = revWireParity(rev_wire); - const auto parities = - revWireParityN(std::array{rev_wire}); - const auto parity_low = parities[0]; - const auto parity_high = parities[1]; + const auto [parity_high, parity_low] = revWireParity(rev_wire); for (size_t k = 0; k < exp2(num_qubits - 1); k++) { const size_t i0 = ((k << 1U) & parity_high) | (parity_low & k); @@ -588,11 +484,7 @@ class GateImplementationsLM : public PauliGenerator { PL_ASSERT(wires.size() == 1); const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - // const auto [parity_high, parity_low] = revWireParity(rev_wire); - const auto parities = - revWireParityN(std::array{rev_wire}); - const auto parity_low = parities[0]; - const auto parity_high = parities[1]; + const auto [parity_high, parity_low] = revWireParity(rev_wire); const std::complex shift = (inverse) ? -Pennylane::Util::IMAG() @@ -612,11 +504,7 @@ class GateImplementationsLM : public PauliGenerator { PL_ASSERT(wires.size() == 1); const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - // const auto [parity_high, parity_low] = revWireParity(rev_wire); - const auto parities = - revWireParityN(std::array{rev_wire}); - const auto parity_low = parities[0]; - const auto parity_high = parities[1]; + const auto [parity_high, parity_low] = revWireParity(rev_wire); constexpr static auto isqrt2 = INVSQRT2(); @@ -638,11 +526,7 @@ class GateImplementationsLM : public PauliGenerator { PL_ASSERT(wires.size() == 1); const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - // const auto [parity_high, parity_low] = revWireParity(rev_wire); - const auto parities = - revWireParityN(std::array{rev_wire}); - const auto parity_low = parities[0]; - const auto parity_high = parities[1]; + const auto [parity_high, parity_low] = revWireParity(rev_wire); const std::complex s = inverse ? std::exp(-std::complex(0, angle)) @@ -662,11 +546,7 @@ class GateImplementationsLM : public PauliGenerator { PL_ASSERT(wires.size() == 1); const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - // const auto [parity_high, parity_low] = revWireParity(rev_wire); - const auto parities = - revWireParityN(std::array{rev_wire}); - const auto parity_low = parities[0]; - const auto parity_high = parities[1]; + const auto [parity_high, parity_low] = revWireParity(rev_wire); const PrecisionT c = std::cos(angle / 2); const PrecisionT js = @@ -691,11 +571,7 @@ class GateImplementationsLM : public PauliGenerator { PL_ASSERT(wires.size() == 1); const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - // const auto [parity_high, parity_low] = revWireParity(rev_wire); - const auto parities = - revWireParityN(std::array{rev_wire}); - const auto parity_low = parities[0]; - const auto parity_high = parities[1]; + const auto [parity_high, parity_low] = revWireParity(rev_wire); const PrecisionT c = std::cos(angle / 2); const PrecisionT s = @@ -721,11 +597,7 @@ class GateImplementationsLM : public PauliGenerator { const size_t rev_wire = num_qubits - wires[0] - 1; const size_t rev_wire_shift = (static_cast(1U) << rev_wire); - // const auto [parity_high, parity_low] = revWireParity(rev_wire); - const auto parities = - revWireParityN(std::array{rev_wire}); - const auto parity_low = parities[0]; - const auto parity_high = parities[1]; + const auto [parity_high, parity_low] = revWireParity(rev_wire); const std::complex first = std::complex{std::cos(angle / 2), -std::sin(angle / 2)}; @@ -893,35 +765,6 @@ class GateImplementationsLM : public PauliGenerator { } } - template - static void applyISWAP(std::complex *arr, size_t num_qubits, - const std::vector &wires, bool inverse) { - using ComplexT = std::complex; - PL_ASSERT(wires.size() == 2); - - const size_t rev_wire0 = num_qubits - wires[1] - 1; - const size_t rev_wire1 = num_qubits - wires[0] - 1; // Control qubit - - const size_t rev_wire0_shift = static_cast(1U) << rev_wire0; - const size_t rev_wire1_shift = static_cast(1U) << rev_wire1; - - const auto [parity_high, parity_middle, parity_low] = - revWireParity(rev_wire0, rev_wire1); - - for (size_t k = 0; k < exp2(num_qubits - 2); k++) { - const size_t i00 = ((k << 2U) & parity_high) | - ((k << 1U) & parity_middle) | (k & parity_low); - const size_t i10 = i00 | rev_wire1_shift; - const size_t i01 = i00 | rev_wire0_shift; - const ComplexT v01 = arr[i01]; - const ComplexT v10 = arr[i10]; - arr[i01] = inverse ? ComplexT{std::imag(v10), -std::real(v10)} - : ComplexT{-std::imag(v10), std::real(v10)}; - arr[i10] = inverse ? ComplexT{std::imag(v01), -std::real(v01)} - : ComplexT{-std::imag(v01), std::real(v01)}; - } - } - template static void applyIsingXX(std::complex *arr, size_t num_qubits, const std::vector &wires, bool inverse, @@ -1518,11 +1361,7 @@ class GateImplementationsLM : public PauliGenerator { [[maybe_unused]] bool adj) -> PrecisionT { PL_ASSERT(wires.size() == 1); const size_t rev_wire = num_qubits - wires[0] - 1; - // const auto [parity_high, parity_low] = revWireParity(rev_wire); - const auto parities = - revWireParityN(std::array{rev_wire}); - const auto parity_low = parities[0]; - const auto parity_high = parities[1]; + const auto [parity_high, parity_low] = revWireParity(rev_wire); for (size_t k = 0; k < exp2(num_qubits - 1); k++) { const size_t i0 = ((k << 1U) & parity_high) | (parity_low & k); @@ -1821,12 +1660,6 @@ extern template void GateImplementationsLM::applyMultiQubitOp( extern template void GateImplementationsLM::applyMultiQubitOp( std::complex *, size_t, const std::complex *, const std::vector &, bool); -extern template void GateImplementationsLM::applyNQubitOp( - std::complex *, size_t, const std::complex *, - const std::vector &, const std::vector &, bool); -extern template void GateImplementationsLM::applyNQubitOp( - std::complex *, size_t, const std::complex *, - const std::vector &, const std::vector &, bool); // Single-qubit gates extern template void @@ -1936,13 +1769,6 @@ extern template void GateImplementationsLM::applySWAP(std::complex *, size_t, const std::vector &, bool); -extern template void -GateImplementationsLM::applyISWAP(std::complex *, size_t, - const std::vector &, bool); -extern template void -GateImplementationsLM::applyISWAP(std::complex *, size_t, - const std::vector &, bool); - extern template void GateImplementationsLM::applyIsingXX( std::complex *, size_t, const std::vector &, bool, float); extern template void GateImplementationsLM::applyIsingXX( diff --git a/tests/test_gates.py b/tests/test_gates.py index 4f6d6987af..d3d33b8ade 100644 --- a/tests/test_gates.py +++ b/tests/test_gates.py @@ -263,147 +263,3 @@ def circuit(): circ = qml.QNode(circuit, dev) circ_def = qml.QNode(circuit, dev_def) assert np.allclose(circ(), circ_def(), tol) - - -# @pytest.mark.parametrize("theta,phi", list(zip(THETA, PHI))) -# @pytest.mark.parametrize( -# "wires", -# [ -# [0, 1, 2], -# [0, 2, 1], -# [1, 0, 2], -# [1, 2, 0], -# [2, 0, 1], -# [2, 1, 0], -# ], -# ) -# def test_qubit_U3(wires, theta, phi, tol): -# """Test that Hadamard expectation value is correct""" -# n_qubits = 3 -# dev_def = qml.device("default.qubit", wires=n_qubits) -# dev = qml.device(device_name, wires=n_qubits) -# m = 2 ** len(wires) -# U = np.random.rand(m, m) + 1j * np.random.rand(m, m) -# U, _ = np.linalg.qr(U) -# init_state = np.random.rand(2**n_qubits) + 1j * np.random.rand(2**n_qubits) -# init_state /= np.sqrt(np.dot(np.conj(init_state), init_state)) - -# def circuit(): -# qml.StatePrep(init_state, wires=range(n_qubits)) -# qml.RY(theta, wires=[0]) -# qml.RY(phi, wires=[1]) -# qml.CNOT(wires=[0, 1]) -# qml.QubitUnitary(U, wires=[w for w in wires]) -# return qml.state() - -# circ = qml.QNode(circuit, dev) -# circ_def = qml.QNode(circuit, dev_def) -# assert np.allclose(circ(), circ_def(), tol) - - -# @pytest.mark.parametrize( -# "params", -# [ -# (2, [0], [1]), -# # (2, [1], [0]), -# # (3, [1], [2]), -# # (3, [2], [1]), -# # (3, [0], [2]), -# # (3, [2], [0]), -# # (4, [0], [1, 2]), -# # (4, [0], [2, 1]), -# ], -# ) -# def test_n0_controlled_qubit_unitary(params, tol): -# """Test that Hadamard expectation value is correct""" -# n_qubits, control_wires, wires = params -# dev_def = qml.device("default.qubit", wires=n_qubits) -# dev = qml.device(device_name, wires=n_qubits) -# m = 2 ** len(wires) -# U = np.random.rand(m, m) + 1.0j * np.random.rand(m, m) -# U, _ = np.linalg.qr(U) -# # U = qml.CY(wires=wires).matrix() -# init_state = np.random.rand(2**n_qubits) + 1.0j * np.random.rand(2**n_qubits) -# init_state /= np.sqrt(np.dot(np.conj(init_state), init_state)) - -# def circuit(): -# qml.StatePrep(init_state, wires=range(n_qubits)) -# qml.ControlledQubitUnitary(U, control_wires=control_wires, wires=wires) -# return qml.state() - -# circ = qml.QNode(circuit, dev) -# circ_def = qml.QNode(circuit, dev_def) -# print(init_state) -# print(circ_def()) -# print(circ()) -# assert np.allclose(circ(), circ_def(), tol) - - -# @pytest.mark.skipif(device_name != "lightning.qubit", reason="LightningQubit required") -# @pytest.mark.parametrize("theta,phi", list(zip(THETA, PHI))) -# @pytest.mark.parametrize( -# "wires", -# [ -# # [0], -# # [1], -# # [2], -# # [0, 3], -# # [1, 3], -# # [2, 3], -# [3, 0], -# [3, 1], -# [3, 2], -# # [0, 3, 5], -# # [1, 3, 5], -# # [2, 3, 5], -# ], -# ) -# @pytest.mark.parametrize( -# "controls", -# [ -# [0], -# [1], -# [2], -# [4], -# # [0, 4], -# # [1, 4], -# # [2, 4], -# # [0, 4, 6], -# # [1, 4, 6], -# # [2, 4, 6], -# ], -# ) -# def test_controlled_qubit_unitary(controls, wires, theta, phi, tol): -# """Test that Hadamard expectation value is correct""" -# if set(controls).intersection(wires) or set(wires).intersection(controls): -# return -# n_qubits = 8 -# n_wires = len(wires) -# dev_def = qml.device("default.qubit", wires=n_qubits) -# dev = qml.device(device_name, wires=n_qubits) -# m = 2**n_wires -# U = np.random.rand(m, m) + 1.0j * np.random.rand(m, m) -# U, _ = np.linalg.qr(U) -# # U = np.array(qml.PauliX([0]).matrix(), dtype=np.complex128) -# init_state = np.random.rand(2**n_qubits) + 1.0j * np.random.rand(2**n_qubits) -# init_state /= np.sqrt(np.dot(np.conj(init_state), init_state)) -# # print(f"norm={np.sqrt(np.dot(np.conj(init_state), init_state))}") - -# # print(wires) - -# def circuit(): -# qml.StatePrep(init_state, wires=range(n_qubits)) -# # qml.RY(theta, wires=[0]) -# # qml.RY(phi, wires=[1]) -# # qml.CNOT(wires=[0, 1]) -# qml.ControlledQubitUnitary(U, control_wires=controls, wires=wires) -# return qml.state() - -# circ = qml.QNode(circuit, dev) -# circ_def = qml.QNode(circuit, dev_def) -# # print(np.real(init_state)) -# # print(np.real(circ_def())) -# # print(np.real(circ())) -# # print(np.real(circ() - circ_def())) -# # print(np.imag(circ() - circ_def())) -# assert np.allclose(circ(), circ_def(), tol) From 76c067639b18c8b581119493bfb88715a3d68130 Mon Sep 17 00:00:00 2001 From: Dev version update bot Date: Wed, 11 Oct 2023 21:21:48 +0000 Subject: [PATCH 111/113] Auto update version --- pennylane_lightning/core/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index 2d5b9ef9b7..64b04ce362 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.33.0-dev18" +__version__ = "0.33.0-dev19" From baba8e73618089f1d31bf508ce661aea8d7fa38c Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 11 Oct 2023 17:22:46 -0400 Subject: [PATCH 112/113] trigger CI From 105a6e0be4043206ca277cde32cba6e3d8174e60 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Wed, 11 Oct 2023 17:24:37 -0400 Subject: [PATCH 113/113] Remove remnants of ENABLE_KOKKOS. --- .github/workflows/tests_gpu.yml | 4 ++-- .github/workflows/tests_linux.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests_gpu.yml b/.github/workflows/tests_gpu.yml index a79c5ce791..bbf240d91c 100644 --- a/.github/workflows/tests_gpu.yml +++ b/.github/workflows/tests_gpu.yml @@ -270,10 +270,10 @@ jobs: if: ${{ matrix.pl_backend == 'all' }} run: | cd main - CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv rm -rf build - CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv - name: Run PennyLane-Lightning unit tests for lightning.qubit with all devices installed diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests_linux.yml index 5045356b86..ac8a05c593 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -447,10 +447,10 @@ jobs: if: ${{ matrix.pl_backend == 'all' }} run: | cd main - CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv rm -rf build - CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_KOKKOS=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ + CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \ python -m pip install -e . -vv - name: Run PennyLane-Lightning unit tests for lightning.qubit with all devices installed