Skip to content

Commit

Permalink
Merge branch 'main' into update-from-plxpr
Browse files Browse the repository at this point in the history
  • Loading branch information
albi3ro authored Jan 6, 2025
2 parents 0a32b43 + 4ec0a4e commit 9dae2f3
Show file tree
Hide file tree
Showing 19 changed files with 394 additions and 299 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-wheel-linux-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ jobs:
- name: Install PennyLane Plugins
run: |
python${{ matrix.python_version }} -m pip install PennyLane-Lightning-Kokkos
python${{ matrix.python_version }} -m pip install 'amazon-braket-pennylane-plugin>1.27.1' "boto3==1.26"
python${{ matrix.python_version }} -m pip install 'amazon-braket-pennylane-plugin>=1.31.0'
- name: Install OQC client
run: |
Expand All @@ -492,7 +492,7 @@ jobs:
python${{ matrix.python_version }} -m pytest frontend/test/pytest -n auto
python${{ matrix.python_version }} -m pytest frontend/test/pytest --backend="lightning.kokkos" -n auto
python${{ matrix.python_version }} -m pytest frontend/test/async_tests
# python${{ matrix.python_version }} -m pytest frontend/test/pytest --runbraket=LOCAL -n auto
python${{ matrix.python_version }} -m pytest frontend/test/pytest --runbraket=LOCAL -n auto
python${{ matrix.python_version }} -m pytest frontend/test/test_oqc/oqc -n auto
- name: Run Standalone Plugin Tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-wheel-macos-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ jobs:
python${{ matrix.python_version }} -m pytest frontend/test/pytest -n auto
python${{ matrix.python_version }} -m pytest frontend/test/pytest --backend="lightning.kokkos" -n auto
python${{ matrix.python_version }} -m pytest frontend/test/async_tests
# python${{ matrix.python_version }} -m pytest frontend/test/pytest --runbraket=LOCAL -n auto
python${{ matrix.python_version }} -m pytest frontend/test/pytest --runbraket=LOCAL -n auto
python${{ matrix.python_version }} -m pytest frontend/test/test_oqc/oqc -n auto
- name: Run Standalone Plugin Tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-wheel-macos-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ jobs:
# TODO: Uncomment after fixing https://github.com/PennyLaneAI/pennylane-lightning/issues/552
# python${{ matrix.python_version }} -m pytest frontend/test/pytest --backend="lightning.kokkos" -n auto
python${{ matrix.python_version }} -m pytest frontend/test/async_tests
# python${{ matrix.python_version }} -m pytest frontend/test/pytest --runbraket=LOCAL -n auto
python${{ matrix.python_version }} -m pytest frontend/test/pytest --runbraket=LOCAL -n auto
python${{ matrix.python_version }} -m pytest frontend/test/test_oqc/oqc -n auto
- name: Run Standalone Plugin Tests
Expand Down
112 changes: 56 additions & 56 deletions .github/workflows/check-catalyst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -565,62 +565,62 @@ jobs:
run: |
make pytest TEST_BACKEND="lightning.kokkos" SKIP_OQD="true"
# frontend-tests-openqasm-device:
# name: Frontend Tests (backend="openqasm3")
# needs: [constants, llvm, runtime, quantum, determine_runner]
# runs-on: ${{ needs.determine_runner.outputs.runner_group }}
# strategy:
# matrix:
# compiler: ${{ fromJson(needs.constants.outputs.compilers) }}
#
# steps:
# - name: Checkout Catalyst repo
# uses: actions/checkout@v4
#
# - name: Install device dependencies (OpenQasm device)
# run: |
# pip install amazon-braket-pennylane-plugin
# echo "AWS_DEFAULT_REGION=us-east-1" >> $GITHUB_ENV
#
# - name: Install Deps
# run: |
# sudo apt-get update
# sudo apt-get install -y python3 python3-pip libomp-dev libasan6 make ninja-build
# python3 --version | grep ${{ needs.constants.outputs.primary_python_version }}
# python3 -m pip install -r requirements.txt
# make frontend
#
# - name: Get Cached LLVM Build
# id: cache-llvm-build
# uses: actions/cache@v4
# with:
# path: llvm-build
# key: ${{ runner.os }}-llvm-${{ needs.constants.outputs.llvm_version }}-default-build-${{ matrix.compiler }}
# fail-on-cache-miss: true
#
# - name: Download Quantum Build Artifact
# uses: actions/download-artifact@v4
# with:
# name: quantum-build-${{ matrix.compiler }}
# path: quantum-build
#
# - name: Download Catalyst-Runtime Artifact
# uses: actions/download-artifact@v4
# with:
# name: runtime-build-${{ matrix.compiler }}
# path: runtime-build/lib
#
# - 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
# echo "CATALYST_BIN_DIR=$(pwd)/quantum-build/bin" >> $GITHUB_ENV
# chmod +x $(pwd)/quantum-build/bin/catalyst-cli # artifact upload does not preserve permissions
#
# - name: Run Python Pytest Tests
# run: |
# make pytest TEST_BRAKET=LOCAL
frontend-tests-openqasm-device:
name: Frontend Tests (backend="openqasm3")
needs: [constants, llvm, runtime, quantum, determine_runner]
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
strategy:
matrix:
compiler: ${{ fromJson(needs.constants.outputs.compilers) }}

steps:
- name: Checkout Catalyst repo
uses: actions/checkout@v4

- name: Install device dependencies (OpenQasm device)
run: |
pip install amazon-braket-pennylane-plugin
echo "AWS_DEFAULT_REGION=us-east-1" >> $GITHUB_ENV
- name: Install Deps
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-pip libomp-dev libasan6 make ninja-build
python3 --version | grep ${{ needs.constants.outputs.primary_python_version }}
python3 -m pip install -r requirements.txt
make frontend
- name: Get Cached LLVM Build
id: cache-llvm-build
uses: actions/cache@v4
with:
path: llvm-build
key: ${{ runner.os }}-llvm-${{ needs.constants.outputs.llvm_version }}-default-build-${{ matrix.compiler }}
fail-on-cache-miss: true

- name: Download Quantum Build Artifact
uses: actions/download-artifact@v4
with:
name: quantum-build-${{ matrix.compiler }}
path: quantum-build

- name: Download Catalyst-Runtime Artifact
uses: actions/download-artifact@v4
with:
name: runtime-build-${{ matrix.compiler }}
path: runtime-build/lib

- 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
echo "CATALYST_BIN_DIR=$(pwd)/quantum-build/bin" >> $GITHUB_ENV
chmod +x $(pwd)/quantum-build/bin/catalyst-cli # artifact upload does not preserve permissions
- name: Run Python Pytest Tests
run: |
make pytest TEST_BRAKET=LOCAL
runtime-device-tests:
name: Runtime Tests (Linux)
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/check-pl-compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
git checkout $(git tag | sort -V | tail -1)
- if: ${{ inputs.catalyst == 'release-candidate' }}
run: |
git checkout v0.9.0-rc
git checkout v0.10.0-rc
- name: Install deps
run: |
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: PennyLaneAI/pennylane-lightning
ref: v0.39.0_rc
ref: v0.40.0_rc
path: lightning_build
fetch-depth: 0

Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
- name: Install PennyLane (release-candidate)
if: ${{ inputs.pennylane == 'release-candidate' }}
run: |
pip install --no-deps --force git+https://github.com/PennyLaneAI/pennylane@v0.39.0-rc0
pip install --no-deps --force git+https://github.com/PennyLaneAI/pennylane@v0.40.0-rc0
- name: Add Frontend Dependencies to PATH
run: |
Expand All @@ -171,9 +171,9 @@ jobs:
run: |
make pytest TEST_BACKEND="lightning.kokkos"
# - name: Run Frontend Tests (Braket)
# run: |
# make pytest TEST_BRAKET=LOCAL
- name: Run Frontend Tests (Braket)
run: |
make pytest TEST_BRAKET=LOCAL
- name: Run Demos
run: | # Do not run demos in parallel, seems to cause package issues with numpy.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/linux_arm64/rh8/test_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ export PATH=/catalyst/llvm-build/bin:/opt/_internal/cpython-${PYTHON_MAJOR_MINOR
/usr/bin/python3 -m pytest -v /catalyst/frontend/test/pytest -n auto
/usr/bin/python3 -m pytest -v /catalyst/frontend/test/pytest --backend="lightning.kokkos" -n auto
/usr/bin/python3 -m pytest /catalyst/frontend/test/async_tests
# /usr/bin/python3 -m pytest -v /catalyst/frontend/test/pytest --runbraket=LOCAL -n auto
/usr/bin/python3 -m pytest -v /catalyst/frontend/test/pytest --runbraket=LOCAL -n auto
/usr/bin/python3 -m pytest /catalyst/frontend/test/test_oqc/oqc -n auto
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ recursive-include frontend/catalyst/lib *
recursive-include frontend/catalyst/enzyme *
recursive-include frontend/mlir_quantum *
recursive-include frontend/catalyst/third_party/cuda/ *.toml
recursive-include frontend/catalyst/third_party/oqd/ *.toml
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ wheel:
cp $(OQC_BUILD_DIR)/librtd_oqc* $(MK_DIR)/frontend/catalyst/lib
cp $(OQC_BUILD_DIR)/oqc_python_module.so $(MK_DIR)/frontend/catalyst/lib
cp $(OQC_BUILD_DIR)/backend/*.toml $(MK_DIR)/frontend/catalyst/lib/backend
cp $(OQD_BUILD_DIR)/librtd_oqd* $(MK_DIR)/frontend/catalyst/lib
cp $(OQD_BUILD_DIR)/backend/*.toml $(MK_DIR)/frontend/catalyst/lib/backend
cp $(COPY_FLAGS) $(LLVM_BUILD_DIR)/lib/libmlir_float16_utils.* $(MK_DIR)/frontend/catalyst/lib
cp $(COPY_FLAGS) $(LLVM_BUILD_DIR)/lib/libmlir_c_runner_utils.* $(MK_DIR)/frontend/catalyst/lib
cp $(COPY_FLAGS) $(LLVM_BUILD_DIR)/lib/libmlir_async_runtime.* $(MK_DIR)/frontend/catalyst/lib
Expand Down
13 changes: 0 additions & 13 deletions doc/dev/devices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,3 @@ Supported backend devices include:
See the `Catalyst configuration file <https://github.com/PennyLaneAI/catalyst/blob/main/frontend/catalyst/third_party/oqc/src/oqc.toml>`__
for natively supported instructions.

* - ``oqd.default``

- Experimental support for execution on `Open Quantum Design (OQD) <https://openquantumdesign.org/>`__
trapped-ion hardware. To use OQD with Catalyst, use the ``backend`` argument to specify the
OQD backend to use when initializing the device:

.. code-block:: python
dev = qml.device("oqd", backend="default", shots=1024, wires=2)
See the `Catalyst configuration file <https://github.com/PennyLaneAI/catalyst/blob/main/frontend/catalyst/third_party/oqd/src/oqd.toml>`__
for natively supported instructions.
12 changes: 10 additions & 2 deletions doc/dev/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,12 @@ If you require the Catalyst repository with all its submodules, clone it this wa
git clone --recurse-submodules --shallow-submodules git@github.com:PennyLaneAI/catalyst.git
If you need to work on an existing branch, provide its name as a second argument:

.. code-block:: console
bash ./setup_dev_from_wheel.sh /path/to/virtual/env branch-name
How Does it Work?
^^^^^^^^^^^^^^^^^

Expand All @@ -495,8 +501,7 @@ using the installed Catalyst wheel libraries, hence avoiding compilation.
Further Steps
^^^^^^^^^^^^^

If everything goes well, ``git status`` should not report any changed files.

``git status`` should not report any changed files when a branch name is not specified.
Before making changes to the frontend, make sure you create a new branch:

.. code-block:: console
Expand All @@ -505,6 +510,9 @@ Before making changes to the frontend, make sure you create a new branch:
Once in the new branch, make the wanted changes. Use the IDE of your preference.

When specifying a branch to switch to, ``git status`` might report changes in some files.
This is normal. Proceed to make changes in the selected branch.

You can test the changes by executing your sample code under the same virtual environment you used
with the scripts. As files in the repository are hard-linked to the Wheel code, you are actually
changing the code stored at the Python ``site-packages`` folder as well, and you will be automatically
Expand Down
2 changes: 2 additions & 0 deletions doc/dev/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This page contains the release notes for Catalyst.

.. mdinclude:: ../releases/changelog-dev.md

.. mdinclude:: ../releases/changelog-0.10.0.md

.. mdinclude:: ../releases/changelog-0.9.0.md

.. mdinclude:: ../releases/changelog-0.8.0.md
Expand Down
Loading

0 comments on commit 9dae2f3

Please sign in to comment.