From 6d00b62be76e2a08240e4cabedb8b6429c571d85 Mon Sep 17 00:00:00 2001 From: lillian542 Date: Thu, 14 Dec 2023 10:23:57 -0500 Subject: [PATCH] add a line to test Catalyst in feature freeze matrix --- .github/workflows/catalyst-latest-rc.yml | 201 +++++++++++++++++++++++ README.md | 5 +- 2 files changed, 204 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/catalyst-latest-rc.yml diff --git a/.github/workflows/catalyst-latest-rc.yml b/.github/workflows/catalyst-latest-rc.yml new file mode 100644 index 0000000..a04fe1c --- /dev/null +++ b/.github/workflows/catalyst-latest-rc.yml @@ -0,0 +1,201 @@ +#name: Check PennyLane/Lightning Compatibility +# +#on: +# workflow_call: +# inputs: +# catalyst: +# required: true +# type: string +# pennylane: +# required: true +# type: string +# lightning: +# required: true +# type: string + +################# +name: catalyst-latest-rc +on: +# push: +# branches: +# - master +# pull_request: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + + +env: + PLUGIN_REPO: PennyLaneAI/catalyst + PLUGIN_BRANCH: master + PLUGIN_PACKAGE: catalyst + PENNYLANE_BRANCH: master + GCC_VERSION: 11 # What is this?? +################ + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + constants: + name: "Set build matrix" + uses: ./.github/workflows/constants.yaml + + check-config: + name: Build Configuration + needs: [constants] + runs-on: ubuntu-latest + + steps: + - name: Checkout Catalyst repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 +# - if: ${{ inputs.catalyst == 'stable' }} +# run: | +# git checkout $(git tag | sort -V | tail -1) + + - name: Install deps + run: | + sudo apt-get install -y cmake ninja-build ccache libomp-dev libasan6 + python3 --version | grep ${{ needs.constants.outputs.primary_python_version }} + python3 -m pip install -r requirements.txt + pip install amazon-braket-pennylane-plugin + echo "AWS_DEFAULT_REGION=us-east-1" >> $GITHUB_ENV + + - name: Get Catalyst Build Dependencies (latest) + uses: actions/cache@v3 + with: + path: qir-stdlib-build + key: Linux-qir-stdlib-build + fail-on-cache-miss: True + - uses: actions/cache@v3 + with: + path: mlir/llvm-project + key: ${{ runner.os }}-llvm-${{ needs.constants.outputs.llvm_version }}-default-source + enableCrossOsArchive: True + fail-on-cache-miss: True + - uses: actions/cache@v3 + with: + path: llvm-build + key: ${{ runner.os }}-llvm-${{ needs.constants.outputs.llvm_version }}-default-build-gcc + fail-on-cache-miss: True + - name: Get Cached MHLO Source + id: cache-mhlo-source + uses: actions/cache@v3 + with: + path: mlir/mlir-hlo + key: ${{ runner.os }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-default-source + enableCrossOsArchive: True + fail-on-cache-miss: True + - uses: actions/cache@v3 + with: + path: mhlo-build + key: ${{ runner.os }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-default-build-gcc + fail-on-cache-miss: True + - uses: actions/cache@v3 + with: + path: enzyme-build + key: ${{ runner.os }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-default-build-gcc + fail-on-cache-miss: True + - uses: actions/cache@v3 + with: + path: .ccache + key: ${{ runner.os }}-ccache-${{ github.run_id }} + restore-keys: ${{ runner.os }}-ccache- + + - name: Clone Enzyme Submodule + uses: actions/checkout@v3 + with: + repository: EnzymeAD/Enzyme + ref: ${{ needs.constants.outputs.enzyme_version }} + path: mlir/Enzyme + + - name: Install Catalyst (latest/stable) + run: | + CCACHE_DIR="$(pwd)/.ccache" \ + C_COMPILER=$(which gcc }}) \ + CXX_COMPILER=$(which g++ }}) \ + ENABLE_LLD=OFF \ + LLVM_BUILD_DIR="$(pwd)/llvm-build" \ + MHLO_BUILD_DIR="$(pwd)/mhlo-build" \ + ENZYME_BUILD_DIR="$(pwd)/enzyme-build" \ + DIALECTS_BUILD_DIR="$(pwd)/quantum-build" \ + make dialects + pip install --upgrade . + + + - name: Build Lightning Runtime (latest) +# if: ${{ inputs.lightning == 'latest' }} + run: | + COMPILER_LAUNCHER="" \ + C_COMPILER=$(which gcc }}) \ + CXX_COMPILER=$(which g++ }}) \ + ENABLE_LLD=OFF \ + RT_BUILD_DIR="$(pwd)/runtime-build" \ + QIR_STDLIB_DIR="$(pwd)/qir-stdlib-build" \ + QIR_STDLIB_INCLUDES_DIR="$(pwd)/qir-stdlib-build/include" \ + LIGHTNING_GIT_TAG_VALUE=master \ + ENABLE_LIGHTNING_KOKKOS=ON \ + ENABLE_OPENQASM=ON \ + make runtime + +# - name: Build Lightning Runtime (stable) +## if: ${{ inputs.lightning == 'stable' }} +# run: | +# COMPILER_LAUNCHER="" \ +# C_COMPILER=$(which gcc }}) \ +# CXX_COMPILER=$(which g++ }}) \ +# RT_BUILD_DIR="$(pwd)/runtime-build" \ +# QIR_STDLIB_DIR="$(pwd)/qir-stdlib-build" \ +# QIR_STDLIB_INCLUDES_DIR="$(pwd)/qir-stdlib-build/include" \ +# LIGHTNING_GIT_TAG_VALUE=latest_release \ +# ENABLE_LIGHTNING_KOKKOS=ON \ +# ENABLE_OPENQASM=ON \ +# make runtime + + - name: Install PennyLane-Lightning (latest) +# if: ${{ inputs.lightning == 'latest' }} + run: | + pip install --upgrade git+https://github.com/PennyLaneAI/pennylane-lightning@master + PL_BACKEND="lightning_kokkos" pip install --upgrade git+https://github.com/PennyLaneAI/pennylane-lightning@master + +# - name: Install PennyLane-Lightning (stable) +## if: ${{ inputs.lightning == 'stable' }} +# run: | +# pip install --upgrade pennylane-lightning +# pip install --upgrade pennyLane-lightning-kokkos + + - name: Install PennyLane (latest) +# if: ${{ inputs.pennylane == 'latest' }} + run: | + pip install --upgrade git+https://github.com/PennyLaneAI/pennylane@master + +# - name: Install PennyLane (stable) +## if: ${{ inputs.pennylane == 'stable' }} +# run: | +# pip install --upgrade pennylane + + + - name: Add Frontend Dependencies to PATH + run: | + echo "PYTHONPATH=$PYTHONPATH:$(pwd)/quantum-build/python_packages/quantum" >> $GITHUB_ENV + echo "RUNTIME_LIB_DIR=$(pwd)/runtime-build/lib" >> $GITHUB_ENV + echo "MLIR_LIB_DIR=$(pwd)/llvm-build/lib" >> $GITHUB_ENV + + - name: Run Frontend Tests + run: | + make pytest + + - name: Run Frontend Tests (Kokkos) + run: | + make pytest TEST_BACKEND="lightning.kokkos" + + - name: Run Frontend Tests (Braket) + run: | + make pytest TEST_BRAKET=LOCAL + + - name: Run Demos + run: | + make test-demos diff --git a/README.md b/README.md index 3e895a7..d626542 100644 --- a/README.md +++ b/README.md @@ -117,8 +117,8 @@ The following table shows the current Catalyst compatibility with the Lightning All entries in the matrix are tested against the PennyLane release candidate branch (GitHub `v0.31.0-rc0` branch). -| | Latest plugin/ release candidate PennyLane | -| :-------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| | Latest plugin/ release candidate PennyLane | +|:----------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Qiskit](https://github.com/PennyLaneAI/pennylane-qiskit) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/qiskit-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/qiskit-latest-rc.yml) | | [Cirq](https://github.com/PennyLaneAI/pennylane-cirq) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/cirq-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/cirq-latest-rc.yml) | | [Qulacs](https://github.com/PennyLaneAI/pennylane-qulacs) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/qulacs-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/qulacs-latest-rc.yml) | @@ -128,6 +128,7 @@ All entries in the matrix are tested against the PennyLane release candidate bra | [Rigetti](https://github.com/PennyLaneAI/pennylane-rigetti) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/rigetti-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/rigetti-latest-rc.yml) | | [ProjectQ](https://github.com/PennyLaneAI/pennylane-pq) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/pq-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/pq-latest-rc.yml) | | [Lightning](https://github.com/PennyLaneAI/pennylane-lightning) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/lightning-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/lightning-latest-rc.yml) | +| [Catalyst](https://github.com/PennyLaneAI/catalyst) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/catalyst-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/catalyst-latest-rc.yml) | | [Braket](https://github.com/aws/amazon-braket-pennylane-plugin-python) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/braket-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/braket-latest-rc.yml) | | [Quantum Inspire](https://github.com/QuTech-Delft/pennylane-quantuminspire) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/quantuminspire-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/quantuminspire-latest-rc.yml) |