Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the missing ninja in AARCH64 Linux wheel recipe #1007

Merged
merged 18 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@

### Improvements

* Enable N-controlled gate and matrix support to `lightning.gpu` simulator for Catalyst.
[(#1005)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1005)

* Reverse Lightning Qubit generators vector insertion order.
[(#1009)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1009)

* Update Kokkos version support to 4.5.
[(#1007)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1007)

* Enable N-controlled gate and matrix support to `lightning.gpu` simulator for Catalyst.
[(#1005)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1005)

* Update Kokkos version support to 4.4.1 and enable Lightning-Kokkos[CUDA] C++ tests on CI.
[(#1000)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1000)

Expand All @@ -54,6 +57,9 @@
* Fix Lightning Kokkos editable mode path.
[(#1010)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1010)

* Fix the missing `ninja` in Linux AARCH64 wheels recipe.
[(#1007)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1007)

* Fix version switch condition the GPU workflow tests for LGPU and LKokkos.
[(#1006)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1006)

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_and_cache_Kokkos_linux.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build and Cache Kokkos

env:
GCC_VERSION: 11
GCC_VERSION: 13

on:
workflow_call:
Expand All @@ -20,7 +20,7 @@ on:
kokkos_version:
required: false
type: string
default: 4.4.01
default: 4.5.00
outputs:
exec_model:
description: "The execution model for Kokkos."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/set_wheel_build_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

- name: Kokkos version
id: kokkos_version
run: echo "kokkos_version=[\"4.4.01\"]" >> $GITHUB_OUTPUT
run: echo "kokkos_version=[\"4.5.00\"]" >> $GITHUB_OUTPUT

outputs:
python_version: ${{ steps.pyver.outputs.python_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_lkcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
uses: ./.github/workflows/build_and_cache_Kokkos_linux.yml
with:
os: ubuntu-22.04
kokkos_version: "4.4.01"
kokkos_version: "4.5.00"

build_lightning_kokkos_wheels:
needs: [build_and_cache_Kokkos]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_lkcuda_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
matrix:
os: [ubuntu-22.04]
exec_model: ["CUDA"]
kokkos_version: ["4.4.01"]
kokkos_version: ["4.5.00"]

steps:
- name: Validate GPU version and installed compiler
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
os: [ubuntu-22.04]
pl_backend: ["lightning_kokkos"]
exec_model: ["CUDA"]
kokkos_version: ["4.4.01"]
kokkos_version: ["4.5.00"]

name: C++ Tests (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }})
runs-on:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_lkcuda_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
matrix:
os: [ubuntu-22.04]
exec_model: ["CUDA"]
kokkos_version: ["4.4.01"]
kokkos_version: ["4.5.00"]

steps:
- name: Validate GPU version and installed compiler
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
os: [ubuntu-22.04]
pl_backend: ["lightning_kokkos", "all"]
exec_model: ["CUDA"]
kokkos_version: ["4.4.01"]
kokkos_version: ["4.5.00"]

name: Python Tests (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }})
runs-on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_windows_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: Kokkos version
id: kokkos_version
run: echo "kokkos_version=[\"4.4.01\"]" >> $GITHUB_OUTPUT
run: echo "kokkos_version=[\"4.5.00\"]" >> $GITHUB_OUTPUT

outputs:
exec_model: ${{ steps.exec_model.outputs.exec_model }}
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/wheel_linux_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ concurrency:
group: wheel_linux_aarch64-${{ github.ref }}
cancel-in-progress: true

env:
GCC_VERSION: 13

jobs:
set_wheel_build_matrix:
if: |
Expand Down Expand Up @@ -76,7 +79,7 @@ jobs:
bash -c "git config --global --add safe.directory /io && \
cd /io && \
python3.10 -m pip install ninja && \
ln -s /opt/python/cp310-cp10/bin/ninja /usr/bin/ninja && \
ln -s /opt/python/cp310-cp310/bin/ninja /usr/bin/ninja && \
cmake -BBuild . -DCMAKE_INSTALL_PREFIX=/install \
-DKokkos_ENABLE_COMPLEX_ALIGN=OFF \
-DKokkos_ENABLE_SERIAL=ON \
Expand Down Expand Up @@ -132,7 +135,7 @@ jobs:
run: python3.10 -m pip install cibuildwheel~=2.20.0 tomlkit

- name: Configure pyproject.toml file
run: PL_BACKEND="${{ matrix.pl_backend }}" python scripts/configure_pyproject_toml.py
run: PL_BACKEND="${{ matrix.pl_backend }}" python3.10 scripts/configure_pyproject_toml.py

- uses: docker/setup-qemu-action@v3
name: Set up QEMU
Expand All @@ -149,16 +152,22 @@ jobs:
CIBW_BEFORE_BUILD: |
cat /etc/yum.conf | sed "s/\[main\]/\[main\]\ntimeout=5/g" > /etc/yum.conf
python -m pip install ninja cmake~=3.27.0
dnf clean all -y
dnf install gcc-toolset-13 -y
source /opt/rh/gcc-toolset-13/enable -y
PATH="/opt/rh/gcc-toolset-13/root/usr/bin:$PATH"

CIBW_ENVIRONMENT: |
CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release"
PATH="/opt/rh/gcc-toolset-13/root/usr/bin:$PATH" CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release"

CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28

CIBW_BUILD_VERBOSITY: 3

CIBW_BEFORE_TEST: |
python -m pip install -r requirements-tests.txt
# FIXME(v0.40.0): install PennyLane/latest to fix pennylane.devices.capabilities requirements
python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master
if ${{ matrix.pl_backend == 'lightning_kokkos'}}
then
PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py
Expand All @@ -167,14 +176,18 @@ jobs:

CIBW_TEST_COMMAND: |
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
python -c "import pennylane as qml; print(qml.about())"
python -c "import pennylane as qml; dev = qml.device(\"lightning.qubit\", wires=3); print(dev); dev2 = qml.device(\"lightning.kokkos\", wires=5); print(dev2)"
which pl-device-test
ls
pl-device-test --device=${DEVICENAME} --skip-ops -x --tb=short --no-flaky-report

run: python3 -m cibuildwheel --output-dir wheelhouse
run: python3.10 -m cibuildwheel --output-dir wheelhouse

- name: Validate wheels
run: |
python3 -m pip install twine
python3 -m twine check ./wheelhouse/*.whl
python3.10 -m pip install twine
python3.10 -m twine check ./wheelhouse/*.whl

- uses: actions-ecosystem/action-regex-match@main
id: rc_build
Expand Down
24 changes: 12 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ You can also pass ``cmake`` options with ``CMAKE_ARGS`` as follows:
.. code-block:: bash

CMAKE_ARGS="-DENABLE_OPENMP=OFF -DENABLE_BLAS=OFF" pip install -e . --config-settings editable_mode=compat -vv


Supported options are ``-DENABLE_WARNINGS``, ``-DENABLE_NATIVE`` (for ``-march=native``) ``-DENABLE_BLAS``, ``-DENABLE_OPENMP``, and ``-DENABLE_CLANG_TIDY``.

Expand All @@ -162,7 +162,7 @@ Then a common command will work.
.. code-block:: bash

pip install -r requirements.txt
pip install -e .
pip install -e .

Note that OpenMP and BLAS are disabled on this platform.

Expand All @@ -173,24 +173,24 @@ Testing
To test that a plugin is working correctly, one can check both Python and C++ unit tests for each device.

Python Test
^^^^^^^^^^^
^^^^^^^^^^^

Test the Python code with:

.. code-block:: bash

make test-python device=${PL.DEVICE}

where ``${PL.DEVICE}`` differ from ``${PL_BACKEND}`` by replacing the underscore by a dot. And can be
where ``${PL.DEVICE}`` differ from ``${PL_BACKEND}`` by replacing the underscore by a dot. And can be

- ``lightning.qubit`` (default)
- ``lightning.gpu``
- ``lightning.qubit`` (default)
- ``lightning.gpu``
- ``lightning.kokkos``
- ``lightning.tensor``

C++ Test
^^^^^^^^

The C++ code can be tested with

.. code-block:: bash
Expand Down Expand Up @@ -317,12 +317,12 @@ Install Kokkos (Optional)
We suggest first installing Kokkos with the wanted configuration following the instructions found in the `Kokkos documentation <https://kokkos.github.io/kokkos-core-wiki/building.html>`_.
For example, the following will build Kokkos for NVIDIA A100 cards

Download the `Kokkos code <https://github.com/kokkos/kokkos/releases>`_. Lightning Kokkos was tested with Kokkos version <= 4.4.1
Download the `Kokkos code <https://github.com/kokkos/kokkos/releases>`_. Lightning Kokkos was tested with Kokkos version <= 4.5.0

.. code-block:: bash

# Replace x, y, and z by the correct version
wget https://github.com/kokkos/kokkos/archive/refs/tags/4.x.yz.tar.gz
wget https://github.com/kokkos/kokkos/archive/refs/tags/4.x.yz.tar.gz
tar -xvf 4.x.y.z.tar.gz
cd kokkos-4.x.y.z

Expand Down Expand Up @@ -365,9 +365,9 @@ The simplest way to install Lightning-Kokkos (OpenMP backend) through ``pip``.
PL_BACKEND="lightning_kokkos" python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DKokkos_ENABLE_OPENMP=ON" python -m pip install -e . --config-settings editable_mode=compat -vv

The supported backend options are
The supported backend options are

.. list-table::
.. list-table::
:align: center
:width: 100 %
:widths: 20 20 20 20 20
Expand All @@ -377,7 +377,7 @@ The supported backend options are
- ``OPENMP``
- ``THREADS``
- ``HIP``
- ``CUDA``
- ``CUDA``

and the corresponding build options are ``-DKokkos_ENABLE_XXX=ON``, where ``XXX`` needs be replaced by the backend name, for instance ``OPENMP``.

Expand Down
2 changes: 1 addition & 1 deletion cmake/support_kokkos.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Include this file only once
include_guard()

set(KOKKOS_VERSION 4.4.01)
set(KOKKOS_VERSION 4.5.00)

# Macro to aid in finding Kokkos with 3 potential install options:
# 1. Fully integrated Kokkos packages and CMake module files
Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.40.0-dev21"
__version__ = "0.40.0-dev22"
Loading