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

Build LTensor wheels on Linux x86_64 and aarch64 #862

Merged
merged 19 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 18 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
3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

### New features since last release

* Build and upload Lightning-Tensor wheels (x86_64, AARCH64) to PyPI.
[(#862)](https://github.com/PennyLaneAI/pennylane-lightning/pull/862)

* Add `Projector` observable support via diagonalization to Lightning-GPU.
[(#894)](https://github.com/PennyLaneAI/pennylane-lightning/pull/894)

Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/wheel_linux_aarch64_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ jobs:
with:
event_name: ${{ github.event_name }}

outputs:
python_version: ${{ steps.pyver.outputs.python_version }}

maliasadi marked this conversation as resolved.
Show resolved Hide resolved
linux-wheels-aarch64:
needs: [set_wheel_build_matrix]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
arch: [aarch64]
pl_backend: ["lightning_gpu"]
pl_backend: ["lightning_gpu", "lightning_tensor"]
cuda_version: ["12"]
cibw_build: ${{ fromJson(needs.set_wheel_build_matrix.outputs.python_version) }}
container_img: ["quay.io/pypa/manylinux_2_28_aarch64"]
Expand Down Expand Up @@ -67,7 +70,7 @@ jobs:

# Python build settings
CIBW_BEFORE_BUILD: |
python -m pip install ninja cmake~=3.24.3 auditwheel~=5.0 custatevec-cu${{ matrix.cuda_version }}
python -m pip install ninja cmake~=3.24.3 auditwheel~=5.0 custatevec-cu${{ matrix.cuda_version }} cutensornet-cu${{ matrix.cuda_version }}
dnf clean all -y
dnf install gcc-toolset-12 dnf-utils -y
source /opt/rh/gcc-toolset-12/enable -y
Expand Down Expand Up @@ -116,7 +119,7 @@ jobs:
strategy:
matrix:
arch: [aarch64]
pl_backend: ["lightning_gpu"]
pl_backend: ["lightning_gpu", "lightning_tensor"]
cuda_version: ["12"]
cibw_build: ${{ fromJson(needs.set_wheel_build_matrix.outputs.python_version) }}
runs-on: ubuntu-latest
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/wheel_linux_x86_64_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
fail-fast: false
matrix:
arch: [x86_64]
pl_backend: ["lightning_gpu"]
pl_backend: ["lightning_gpu", "lightning_tensor"]
cuda_version: ["12"]
cibw_build: ${{ fromJson(needs.set_wheel_build_matrix.outputs.python_version) }}
container_img: ["quay.io/pypa/manylinux_2_28_x86_64"]
Expand Down Expand Up @@ -83,22 +83,21 @@ jobs:

CIBW_SKIP: "*-musllinux*"

CIBW_CONFIG_SETTINGS: --global-option=build_ext --global-option=--define="LIGHTNING_RELEASE_TAG=master"

# Python build settings
CIBW_BEFORE_BUILD: |
python -m pip install ninja cmake~=3.24.3 auditwheel~=5.0 custatevec-cu${{ matrix.cuda_version }} scipy
python -m pip install ninja cmake~=3.24.3 auditwheel~=5.0 custatevec-cu${{ matrix.cuda_version }} cutensornet-cu${{ matrix.cuda_version }}
dnf clean all -y
dnf install gcc-toolset-12 dnf-utils -y
source /opt/rh/gcc-toolset-12/enable -y
yum-config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo -y
dnf -y install cuda-toolkit-${{ matrix.cuda_version }}-0 git openssh wget
dnf -y install cuda-toolkit-${{ matrix.cuda_version }}-0 git

# ensure nvcc is available
CIBW_ENVIRONMENT: |
PATH=/opt/rh/gcc-toolset-12/root/usr/bin:$PATH:/usr/local/cuda-${{ matrix.cuda_version }}/bin \
LD_LIBRARY_PATH=/opt/rh/gcc-toolset-12/root/usr/lib64:/opt/rh/gcc-toolset-12/root/usr/lib:/opt/rh/gcc-toolset-12/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-12/root/usr/lib/dyninst:$LD_LIBRARY_PATH:/usr/local/cuda-${{ matrix.cuda_version }}/lib64 \
PKG_CONFIG_PATH=/opt/rh/gcc-toolset-12/root/usr/lib64/pkgconfig:$PKG_CONFIG_PATH
PKG_CONFIG_PATH=/opt/rh/gcc-toolset-12/root/usr/lib64/pkgconfig:$PKG_CONFIG_PATH \
CMAKE_ARGS="-DENABLE_LAPACK=OFF"

CIBW_REPAIR_WHEEL_COMMAND_LINUX: "./bin/auditwheel repair -w {dest_dir} {wheel}"

Expand Down Expand Up @@ -136,7 +135,7 @@ jobs:
strategy:
matrix:
arch: [x86_64]
pl_backend: ["lightning_gpu"]
pl_backend: ["lightning_gpu", "lightning_tensor"]
cuda_version: ["12"]
cibw_build: ${{ fromJson(needs.set_wheel_build_matrix.outputs.python_version) }}
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ The following table summarizes the supported platforms and the primary installat
+-----------+---------+--------+-------------+----------------+-----------------+----------------+----------------+
| | L-Qubit | L-GPU | L-GPU (MPI) | L-Kokkos (OMP) | L-Kokkos (CUDA) | L-Kokkos (HIP) | L-Tensor |
+===========+=========+========+=============+================+=================+================+================+
| Linux x86 | pip | pip | source | pip | source | source | source |
| Linux x86 | pip | pip | source | pip | source | source | pip |
+-----------+---------+--------+-------------+----------------+-----------------+----------------+----------------+
| Linux ARM | pip | pip | | pip | source | source | |
| Linux ARM | pip | pip | | pip | source | source | pip |
+-----------+---------+--------+-------------+----------------+-----------------+----------------+----------------+
| Linux PPC | pip | source | | source | source | source | |
+-----------+---------+--------+-------------+----------------+-----------------+----------------+----------------+
Expand Down
5 changes: 5 additions & 0 deletions bin/auditwheel
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ libs = [
"libcublas.so",
"libcublas.so.11",
"libcublas.so.12",
"libcusolver.so.11",
maliasadi marked this conversation as resolved.
Show resolved Hide resolved
"libcusolver.so.12",
"libcusparse.so",
"libcusparse.so.11",
"libcusparse.so.12",
"libcustatevec.so",
"libcustatevec.so.0",
"libcustatevec.so.1",
"libcutensor.so.2",
"libcutensornet.so.2",
"libnvJitLink.so.12",
]

print(f"Excluding {libs}")
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.39.0-dev12"
__version__ = "0.39.0-dev13"
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ text = "Apache License 2.0"
[project.optional-dependencies]
gpu = [ "pennylane-lightning-gpu",]
kokkos = [ "pennylane-lightning-kokkos",]
tensor = [ "pennylane-lightning-tensor",]

[project.urls]
Homepage = "https://github.com/PennyLaneAI/pennylane-lightning"
Expand Down
Loading