Skip to content

Commit

Permalink
Merge branch 'lk-control-generator' into lk-control-generator-NQ
Browse files Browse the repository at this point in the history
  • Loading branch information
josephleekl committed Nov 12, 2024
2 parents b70ca6b + 6abbda0 commit dd95cb3
Show file tree
Hide file tree
Showing 68 changed files with 6,709 additions and 1,192 deletions.
177 changes: 120 additions & 57 deletions .github/CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/workflows/compat-docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Docker release - Linux::x86_64
uses: ./.github/workflows/docker_linux_x86_64.yml
with:
lightning-version: v0.38.0_rc
pennylane-version: v0.38.0-rc0
lightning-version: v0.39.0_rc
pennylane-version: v0.39.0-rc0
push-to-dockerhub: false
secrets: inherit # pass all secrets
49 changes: 0 additions & 49 deletions .github/workflows/determine-workflow-runner.yml

This file was deleted.

24 changes: 22 additions & 2 deletions .github/workflows/tests_gpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,20 @@ jobs:
run: |
python -m pip install cutensornet-cu${{ matrix.cuda_version }}
- name: Checkout PennyLane for release build
if: inputs.pennylane-version == 'release'
- name: Checkout PennyLane for release or latest build
if: inputs.pennylane-version == 'release' || inputs.pennylane-version == 'latest'
uses: actions/checkout@v4
with:
path: pennylane
repository: PennyLaneAI/pennylane

- name: Switch to latest build of PennyLane
if: inputs.pennylane-version == 'latest'
run: |
cd pennylane
git checkout master
python -m pip uninstall -y pennylane && python -m pip install . -vv --no-deps
- name: Switch to release build of PennyLane
if: inputs.pennylane-version == 'release'
run: |
Expand Down Expand Up @@ -199,6 +206,19 @@ jobs:
run: |
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS
- name: Test wheels for Lightning-GPU
if : matrix.pl_backend == 'lightning_gpu'
run: |
python -m pip install -r requirements-dev.txt
PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py
SKIP_COMPILATION=True python -m pip install . -vv
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
PL_BACKEND=${DEVICENAME} python scripts/configure_pyproject_toml.py
python -m build
python -m pip install dist/*.whl --force-reinstall --no-deps
PL_DEVICE=${DEVICENAME} python -m pytest tests/test_device.py $COVERAGE_FLAGS
- name: Move coverage file
run: |
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/tests_lgpumpi_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,20 @@ jobs:
python scripts/configure_pyproject_toml.py || true
python -m pip install . -vv
- name: Checkout PennyLane for release build
if: inputs.pennylane-version == 'release'
- name: Checkout PennyLane for release or latest build
if: inputs.pennylane-version == 'release' || inputs.pennylane-version == 'latest'
uses: actions/checkout@v4
with:
path: pennylane
repository: PennyLaneAI/pennylane

- name: Switch to latest build of PennyLane
if: inputs.pennylane-version == 'latest'
run: |
cd pennylane
git checkout master
python -m pip uninstall -y pennylane && python -m pip install . -vv --no-deps
- name: Switch to release build of PennyLane
if: inputs.pennylane-version == 'release'
run: |
Expand Down
24 changes: 7 additions & 17 deletions .github/workflows/tests_linux_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,8 @@ concurrency:
cancel-in-progress: true

jobs:
determine_runner:
if: github.event.pull_request.draft == false
name: Determine runner type to use
uses: ./.github/workflows/determine-workflow-runner.yml
with:
default_runner: ubuntu-22.04

cpptests:
if: ${{ !contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }}
needs: [determine_runner]
strategy:
matrix:
pl_backend: ["lightning_qubit"]
Expand All @@ -60,7 +52,7 @@ jobs:
enable_kernel_avx_streaming: ON
timeout-minutes: 60
name: C++ Tests (${{ matrix.pl_backend }}, ENABLE_KERNEL_OMP=${{ matrix.enable_kernel_omp }}, ENABLE_KERNEL_AVX_STREAMING=${{ matrix.enable_kernel_avx_streaming }}), ENABLE_LAPACK=${{ matrix.enable_lapack }})
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
runs-on: pl-4-core-large-runner

steps:
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -119,13 +111,12 @@ jobs:

cpptestswithOpenBLAS:
if: ${{ !contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }}
needs: [determine_runner]
strategy:
matrix:
pl_backend: ["lightning_qubit"]
timeout-minutes: 60
name: C++ Tests (${{ matrix.pl_backend }}, blas-ON)
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
runs-on: pl-4-core-large-runner

steps:
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -180,15 +171,14 @@ jobs:

build_and_cache_Kokkos:
name: "Build and cache Kokkos"
needs: [determine_runner]
uses: ./.github/workflows/build_and_cache_Kokkos_linux.yml
with:
runs_on: ${{ needs.determine_runner.outputs.runner_group }}
runs_on: pl-4-core-large-runner
os: ubuntu-22.04

cpptestswithKokkos:
if: ${{ !contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }}
needs: [build_and_cache_Kokkos, determine_runner]
needs: [build_and_cache_Kokkos]
strategy:
matrix:
os: [ubuntu-22.04]
Expand All @@ -197,7 +187,7 @@ jobs:
kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }}
timeout-minutes: 60
name: C++ Tests (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }})
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
runs-on: pl-4-core-large-runner

steps:
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -288,15 +278,15 @@ jobs:
cpptestsWithMultipleBackends:
# Device-specific tests are performed for both. Device-agnostic tests default to LightningQubit.
if: ${{ !contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }}
needs: [build_and_cache_Kokkos, determine_runner]
needs: [build_and_cache_Kokkos]
strategy:
matrix:
os: [ubuntu-22.04]
exec_model: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.exec_model) }}
kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }}
timeout-minutes: 60
name: C++ Tests (multiple-backends, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }})
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
runs-on: pl-4-core-large-runner

steps:
- uses: actions/setup-python@v5
Expand Down
42 changes: 25 additions & 17 deletions .github/workflows/tests_lkcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ concurrency:
cancel-in-progress: true

jobs:

determine_runner:
if: github.event.pull_request.draft == false
name: Determine runner type to use
uses: ./.github/workflows/determine-workflow-runner.yml
with:
default_runner: ubuntu-22.04

build_and_cache_Kokkos:
if: github.event.pull_request.draft == false
name: "Build and cache Kokkos"
Expand All @@ -60,7 +52,7 @@ jobs:
kokkos_version: "4.3.01"

build_lightning_kokkos_wheels:
needs: [determine_runner, build_and_cache_Kokkos]
needs: [build_and_cache_Kokkos]
strategy:
matrix:
os: [ubuntu-22.04]
Expand All @@ -69,7 +61,7 @@ jobs:
kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }}
timeout-minutes: 60
name: Build (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }})
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
runs-on: pl-4-core-large-runner

steps:
- name: Checkout PennyLane-Lightning
Expand Down Expand Up @@ -149,7 +141,7 @@ jobs:
${{ github.workspace }}/wheel_${{ matrix.pl_backend }}-${{ matrix.exec_model }}.whl
test_lightning_kokkos_wheels:
needs: [determine_runner, build_and_cache_Kokkos, build_lightning_kokkos_wheels]
needs: [build_and_cache_Kokkos, build_lightning_kokkos_wheels]
strategy:
matrix:
os: [ubuntu-22.04]
Expand All @@ -159,7 +151,7 @@ jobs:
kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }}
timeout-minutes: 60
name: Python Tests (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }}, test-group-${{ matrix.group }})
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
runs-on: pl-4-core-large-runner

steps:
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -191,7 +183,6 @@ jobs:
git log -1 --format='%H'
git status
- uses: actions/download-artifact@v4
with:
name: ${{ matrix.pl_backend }}-${{ matrix.exec_model }}_name.txt
Expand All @@ -214,13 +205,20 @@ jobs:
fi
python -m pip install ${{ github.workspace }}/$WHEEL_NAME --no-deps
- name: Checkout PennyLane for release build
if: inputs.pennylane-version == 'release'
- name: Checkout PennyLane for release or latest build
if: inputs.pennylane-version == 'release' || inputs.pennylane-version == 'latest'
uses: actions/checkout@v4
with:
path: pennylane
repository: PennyLaneAI/pennylane

- name: Switch to latest build of PennyLane
if: inputs.pennylane-version == 'latest'
run: |
cd pennylane
git checkout master
python -m pip uninstall -y pennylane && python -m pip install . -vv --no-deps
- name: Switch to release build of PennyLane
if: inputs.pennylane-version == 'release'
run: |
Expand Down Expand Up @@ -251,6 +249,16 @@ jobs:
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
mv .coverage ${{ github.workspace }}/.coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.group }}
- name: Test editable install
run: |
pip uninstall pennylane-lightning pennylane-lightning-kokkos -y
python scripts/configure_pyproject_toml.py
SKIP_COMPILATION=True python -m pip install -e . --config-settings editable_mode=compat
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
PL_BACKEND=${DEVICENAME} python scripts/configure_pyproject_toml.py
python -m pip install -e . --config-settings editable_mode=compat -vv
PL_DEVICE=${DEVICENAME} python -m pytest tests/test_device.py $COVERAGE_FLAGS
- name: Upload test durations
uses: actions/upload-artifact@v4
with:
Expand All @@ -271,9 +279,9 @@ jobs:

upload-to-codecov-linux-python:
if: github.event_name == 'pull_request'
needs: [determine_runner, test_lightning_kokkos_wheels]
needs: [test_lightning_kokkos_wheels]
name: Upload python coverage data to codecov
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/tests_lkcuda_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,20 @@ jobs:
python -m pip install -r requirements-dev.txt
python -m pip install openfermionpyscf
- name: Checkout PennyLane for release build
if: inputs.pennylane-version == 'release'
- name: Checkout PennyLane for release or latest build
if: inputs.pennylane-version == 'release' || inputs.pennylane-version == 'latest'
uses: actions/checkout@v4
with:
path: pennylane
repository: PennyLaneAI/pennylane

- name: Switch to latest build of PennyLane
if: inputs.pennylane-version == 'latest'
run: |
cd pennylane
git checkout master
python -m pip uninstall -y pennylane && python -m pip install . -vv --no-deps
- name: Switch to release build of PennyLane
if: inputs.pennylane-version == 'release'
run: |
Expand Down Expand Up @@ -252,7 +259,7 @@ jobs:
PL_BACKEND=${{ matrix.pl_backend }} python scripts/configure_pyproject_toml.py || true
PL_BACKEND=${{ matrix.pl_backend }} CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos" \
python -m pip install . -vv
- name: Run PennyLane-Lightning unit tests
if: ${{ matrix.pl_backend != 'all'}}
env:
Expand Down
Loading

0 comments on commit dd95cb3

Please sign in to comment.