From fb6b471476e9b039c65426132aaf663e28f18ac9 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Mon, 6 Jan 2025 20:54:41 +0000 Subject: [PATCH 01/37] initial commit --- .github/workflows/wheel_linux_aarch64_cuda.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 6a7c4a9e22..9d6b8cb809 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -34,7 +34,7 @@ jobs: strategy: fail-fast: false matrix: - os: [pl-4-core-large-runner] + os: [arm-gpu] arch: [aarch64] pl_backend: ["lightning_gpu", "lightning_tensor"] cuda_version: ["12"] @@ -42,7 +42,9 @@ jobs: container_img: ["quay.io/pypa/manylinux_2_28_aarch64"] timeout-minutes: 45 name: ${{ matrix.os }}::${{ matrix.arch }} - ${{ matrix.pl_backend }} (Python ${{ fromJson('{ "cp310-*":"3.10","cp311-*":"3.11", "cp312-*":"3.12" }')[matrix.cibw_build] }}) - runs-on: ${{ matrix.os }} + runs-on: + - self-hosted + - ${{ matrix.os }} steps: - name: Checkout PennyLane-Lightning @@ -59,9 +61,6 @@ jobs: - name: Configure pyproject.toml file run: PL_BACKEND="${{ matrix.pl_backend }}" python scripts/configure_pyproject_toml.py - - uses: docker/setup-qemu-action@v3 - name: Set up QEMU - - name: Build wheels env: CIBW_ARCHS_LINUX: ${{matrix.arch}} @@ -85,6 +84,15 @@ jobs: 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 \ CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release" + + CIBW_BEFORE_TEST: | + python -m pip install -r requirements-tests.txt + PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py + SKIP_COMPILATION=True python -m pip install . -vv + + CIBW_TEST_COMMAND: | + DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` + PL_DEVICE=${DEVICENAME} python -m pytest tests CIBW_REPAIR_WHEEL_COMMAND_LINUX: "./bin/auditwheel repair -w {dest_dir} {wheel}" From e276801572a9764d68ad8caf36406e209da54acc Mon Sep 17 00:00:00 2001 From: ringo-but-quantum Date: Mon, 6 Jan 2025 20:55:40 +0000 Subject: [PATCH 02/37] Auto update version from '0.40.0-dev43' to '0.40.0-dev44' --- pennylane_lightning/core/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index df42670b02..d2126533b6 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.40.0-dev43" +__version__ = "0.40.0-dev44" From 617d074dc08c06125188cdac13a831fdb15fddd6 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Mon, 6 Jan 2025 20:59:19 +0000 Subject: [PATCH 03/37] Trigger CIs From 31f086066d2b6ff1d5687dadc59c0bae17a0e1ce Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Mon, 6 Jan 2025 20:59:38 +0000 Subject: [PATCH 04/37] Trigger CIs From f6e5fb24ccf745526a9a5353946029a6e0d08f74 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Mon, 6 Jan 2025 21:34:42 +0000 Subject: [PATCH 05/37] lgpu tests --- .github/workflows/wheel_linux_aarch64_cuda.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 9d6b8cb809..acf153c8b3 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -92,7 +92,10 @@ jobs: CIBW_TEST_COMMAND: | DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` - PL_DEVICE=${DEVICENAME} python -m pytest tests + if ${{ matrix.pl_backend == 'lightning_gpu'}} + then + pl-device-test --device=${DEVICENAME} --skip-ops -x --tb=short --no-flaky-report + fi CIBW_REPAIR_WHEEL_COMMAND_LINUX: "./bin/auditwheel repair -w {dest_dir} {wheel}" From 926cd36491f379472849b7929c8812991c156389 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Mon, 6 Jan 2025 22:46:02 +0000 Subject: [PATCH 06/37] update --- .github/workflows/wheel_linux_aarch64_cuda.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index acf153c8b3..e56736839d 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -89,6 +89,7 @@ jobs: python -m pip install -r requirements-tests.txt PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py SKIP_COMPILATION=True python -m pip install . -vv + python -m pip install ./wheelhouse/*.whl CIBW_TEST_COMMAND: | DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` From 0884cce65a8309e9f3c2baea76037b8dd286599f Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 13:19:39 +0000 Subject: [PATCH 07/37] add cuda to path --- .github/workflows/wheel_linux_aarch64_cuda.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index e56736839d..bb8e4b5417 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -47,6 +47,19 @@ jobs: - ${{ matrix.os }} steps: + - run: | + cat /proc/cpuinfo + lscpu + + - run: | + source /etc/profile.d/modules.sh + module use /opt/modules + module load cuda/12.4 + echo "${PATH}" >> $GITHUB_PATH + echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV + nvcc --version + nvidia-smi + - name: Checkout PennyLane-Lightning uses: actions/checkout@v4 From 178f3f79e0686a5393ce160502178045517fc093 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 14:39:00 +0000 Subject: [PATCH 08/37] test --- .github/workflows/wheel_linux_aarch64_cuda.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index bb8e4b5417..ab43e0c181 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -88,8 +88,6 @@ jobs: 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/sbsa/cuda-rhel8.repo -y - dnf -y install cuda-toolkit-${{ matrix.cuda_version }}-0 git # ensure nvcc is available CIBW_ENVIRONMENT: | @@ -102,7 +100,6 @@ jobs: python -m pip install -r requirements-tests.txt PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py SKIP_COMPILATION=True python -m pip install . -vv - python -m pip install ./wheelhouse/*.whl CIBW_TEST_COMMAND: | DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` From 8fbe8850b94adefc1d6665641eeac38547662c78 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 14:52:41 +0000 Subject: [PATCH 09/37] install cuda --- .github/workflows/wheel_linux_aarch64_cuda.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index ab43e0c181..7ba1174ffe 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -88,6 +88,8 @@ jobs: 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/sbsa/cuda-rhel8.repo -y + dnf -y install cuda-toolkit-${{ matrix.cuda_version }}-0 git # ensure nvcc is available CIBW_ENVIRONMENT: | @@ -103,6 +105,7 @@ jobs: CIBW_TEST_COMMAND: | DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` + ls if ${{ matrix.pl_backend == 'lightning_gpu'}} then pl-device-test --device=${DEVICENAME} --skip-ops -x --tb=short --no-flaky-report @@ -110,7 +113,7 @@ jobs: CIBW_REPAIR_WHEEL_COMMAND_LINUX: "./bin/auditwheel repair -w {dest_dir} {wheel}" - CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28 + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28_aarch64 CIBW_BUILD_VERBOSITY: 3 From a3450d0e12adf30bd613ccd84689d25f82a998d8 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 15:10:20 +0000 Subject: [PATCH 10/37] fix failure --- .github/workflows/wheel_linux_aarch64_cuda.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 7ba1174ffe..003bbd2327 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -45,6 +45,9 @@ jobs: runs-on: - self-hosted - ${{ matrix.os }} + container: + image: ${{ matrix.container_img }} + options: --privileged steps: - run: | @@ -113,9 +116,9 @@ jobs: CIBW_REPAIR_WHEEL_COMMAND_LINUX: "./bin/auditwheel repair -w {dest_dir} {wheel}" - CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28_aarch64 + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28 - CIBW_BUILD_VERBOSITY: 3 + CIBW_BUILD_VERBOSITY: 1 run: python3 -m cibuildwheel --output-dir wheelhouse From 179d2c9a5bd252c7a786748dec8f5269589b9067 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 15:14:46 +0000 Subject: [PATCH 11/37] test --- .github/workflows/wheel_linux_aarch64_cuda.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 003bbd2327..e58bf5f6db 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -50,18 +50,6 @@ jobs: options: --privileged steps: - - run: | - cat /proc/cpuinfo - lscpu - - - run: | - source /etc/profile.d/modules.sh - module use /opt/modules - module load cuda/12.4 - echo "${PATH}" >> $GITHUB_PATH - echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV - nvcc --version - nvidia-smi - name: Checkout PennyLane-Lightning uses: actions/checkout@v4 From 34657dbf7441df592391b368f16033b64a9a9aba Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 15:31:31 +0000 Subject: [PATCH 12/37] GCC12-gcc13 --- .github/workflows/wheel_linux_aarch64_cuda.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index e58bf5f6db..955093463a 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -45,9 +45,6 @@ jobs: runs-on: - self-hosted - ${{ matrix.os }} - container: - image: ${{ matrix.container_img }} - options: --privileged steps: @@ -77,16 +74,16 @@ jobs: CIBW_BEFORE_BUILD: | python -m pip install ninja cmake~=3.27.0 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 + dnf install gcc-toolset-13 dnf-utils -y + source /opt/rh/gcc-toolset-13/enable -y yum-config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel8/sbsa/cuda-rhel8.repo -y 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 \ + PATH=/opt/rh/gcc-toolset-13/root/usr/bin:$PATH:/usr/local/cuda-${{ matrix.cuda_version }}/bin \ + LD_LIBRARY_PATH=/opt/rh/gcc-toolset-13/root/usr/lib64:/opt/rh/gcc-toolset-13/root/usr/lib:/opt/rh/gcc-toolset-13/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-13/root/usr/lib/dyninst:$LD_LIBRARY_PATH:/usr/local/cuda-${{ matrix.cuda_version }}/lib64 \ + PKG_CONFIG_PATH=/opt/rh/gcc-toolset-13/root/usr/lib64/pkgconfig:$PKG_CONFIG_PATH \ CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release" CIBW_BEFORE_TEST: | From f3d41670d9246f1999df624936b6ce78532441df Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 17:43:11 +0000 Subject: [PATCH 13/37] test --- .../workflows/wheel_linux_aarch64_cuda.yml | 45 +++++++++++-------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 955093463a..789124a704 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -74,30 +74,17 @@ jobs: CIBW_BEFORE_BUILD: | python -m pip install ninja cmake~=3.27.0 auditwheel~=5.0 custatevec-cu${{ matrix.cuda_version }} cutensornet-cu${{ matrix.cuda_version }} dnf clean all -y - dnf install gcc-toolset-13 dnf-utils -y - source /opt/rh/gcc-toolset-13/enable -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/sbsa/cuda-rhel8.repo -y dnf -y install cuda-toolkit-${{ matrix.cuda_version }}-0 git # ensure nvcc is available CIBW_ENVIRONMENT: | - PATH=/opt/rh/gcc-toolset-13/root/usr/bin:$PATH:/usr/local/cuda-${{ matrix.cuda_version }}/bin \ - LD_LIBRARY_PATH=/opt/rh/gcc-toolset-13/root/usr/lib64:/opt/rh/gcc-toolset-13/root/usr/lib:/opt/rh/gcc-toolset-13/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-13/root/usr/lib/dyninst:$LD_LIBRARY_PATH:/usr/local/cuda-${{ matrix.cuda_version }}/lib64 \ - PKG_CONFIG_PATH=/opt/rh/gcc-toolset-13/root/usr/lib64/pkgconfig:$PKG_CONFIG_PATH \ + 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 \ CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release" - - CIBW_BEFORE_TEST: | - python -m pip install -r requirements-tests.txt - PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py - SKIP_COMPILATION=True python -m pip install . -vv - - CIBW_TEST_COMMAND: | - DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` - ls - if ${{ matrix.pl_backend == 'lightning_gpu'}} - then - pl-device-test --device=${DEVICENAME} --skip-ops -x --tb=short --no-flaky-report - fi CIBW_REPAIR_WHEEL_COMMAND_LINUX: "./bin/auditwheel repair -w {dest_dir} {wheel}" @@ -107,6 +94,28 @@ jobs: run: python3 -m cibuildwheel --output-dir wheelhouse + - name: Test wheels + run: | + python -m ensurepip --upgrade + python -m pip install setuptools + python -m pip install -r requirements-tests.txt + PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py + SKIP_COMPILATION=True python -m pip install . -vv + + cd wheelhouse + for wheel in *.whl;do + echo "Installing $wheel" + python -m pip install $wheel + done + cd .. + DEVICENAME=(echo ${{ matrix.pl_backend }} | %{$_ -replace "_","."}) + if ${{ matrix.pl_backend == 'lightning_gpu'}} + then + pl-device-test --device=$DEVICENAME --skip-ops -x --tb=short --no-flaky-report + fi + PL_DEVICE=${DEVICENAME} python -m pytest tests/ -k "not test_native_mcm" + + - name: Validate wheels run: | python3 -m pip install twine From e7b77aa7a2f31e184dc5489d7134690a149279cb Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 18:08:12 +0000 Subject: [PATCH 14/37] update --- .../workflows/wheel_linux_aarch64_cuda.yml | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 789124a704..612c03e180 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -47,17 +47,11 @@ jobs: - ${{ matrix.os }} steps: - - name: Checkout PennyLane-Lightning uses: actions/checkout@v4 - - name: Install Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Install cibuildwheel - run: python3.10 -m pip install cibuildwheel~=2.20.0 tomlkit + run: python -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 @@ -92,7 +86,18 @@ jobs: CIBW_BUILD_VERBOSITY: 1 - run: python3 -m cibuildwheel --output-dir wheelhouse + run: python -m cibuildwheel --output-dir wheelhouse + + - name: Determine Python version + id: pyvs + shell: bash + run: | + echo "version=$(echo ${{ matrix.cibw_build }} | tr -cd '[:digit:].' | sed 's/./&./1')" >> $GITHUB_OUTPUT + + - uses: actions/setup-python@v5 + name: Install Python + with: + python-version: ${{ steps.pyvs.outputs.version }} - name: Test wheels run: | @@ -108,6 +113,7 @@ jobs: python -m pip install $wheel done cd .. + DEVICENAME=(echo ${{ matrix.pl_backend }} | %{$_ -replace "_","."}) if ${{ matrix.pl_backend == 'lightning_gpu'}} then @@ -115,11 +121,10 @@ jobs: fi PL_DEVICE=${DEVICENAME} python -m pytest tests/ -k "not test_native_mcm" - - name: Validate wheels run: | - python3 -m pip install twine - python3 -m twine check ./wheelhouse/*.whl + python -m pip install twine + python -m twine check ./wheelhouse/*.whl - uses: actions-ecosystem/action-regex-match@main id: rc_build From a44722bba36b3e9296fcd5378fe7cda2fb4af67f Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 18:27:50 +0000 Subject: [PATCH 15/37] fix typo --- .github/workflows/wheel_linux_aarch64_cuda.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 612c03e180..41a156d0d9 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -114,10 +114,10 @@ jobs: done cd .. - DEVICENAME=(echo ${{ matrix.pl_backend }} | %{$_ -replace "_","."}) + DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` if ${{ matrix.pl_backend == 'lightning_gpu'}} then - pl-device-test --device=$DEVICENAME --skip-ops -x --tb=short --no-flaky-report + pl-device-test --device=${DEVICENAME} --skip-ops -x --tb=short --no-flaky-report fi PL_DEVICE=${DEVICENAME} python -m pytest tests/ -k "not test_native_mcm" From 1e545c4e7d683900cdcdfa396c7deb9b87af47c6 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 18:40:01 +0000 Subject: [PATCH 16/37] force reinstall --- .github/workflows/wheel_linux_aarch64_cuda.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 41a156d0d9..cd65d9e0f1 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -110,15 +110,11 @@ jobs: cd wheelhouse for wheel in *.whl;do echo "Installing $wheel" - python -m pip install $wheel + python -m pip install $wheel --force-reinstall --no-deps done cd .. DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` - if ${{ matrix.pl_backend == 'lightning_gpu'}} - then - pl-device-test --device=${DEVICENAME} --skip-ops -x --tb=short --no-flaky-report - fi PL_DEVICE=${DEVICENAME} python -m pytest tests/ -k "not test_native_mcm" - name: Validate wheels From 851ce6d7324e5d0ff6fdbd8e917ac5ee9b854584 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 18:48:01 +0000 Subject: [PATCH 17/37] ensure cuquantum is installed before tests --- .github/workflows/wheel_linux_aarch64_cuda.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index cd65d9e0f1..be680beeba 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -103,6 +103,7 @@ jobs: run: | python -m ensurepip --upgrade python -m pip install setuptools + python -m pip install -r requirements-dev.txt python -m pip install -r requirements-tests.txt PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py SKIP_COMPILATION=True python -m pip install . -vv From bb0fb1040fb97a8dd239c16c3c059f29465da9f9 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 19:05:05 +0000 Subject: [PATCH 18/37] update --- .github/workflows/wheel_linux_aarch64_cuda.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index be680beeba..e27245c375 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -103,11 +103,7 @@ jobs: run: | python -m ensurepip --upgrade python -m pip install setuptools - python -m pip install -r requirements-dev.txt python -m pip install -r requirements-tests.txt - PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py - SKIP_COMPILATION=True python -m pip install . -vv - cd wheelhouse for wheel in *.whl;do echo "Installing $wheel" From fd773f225e993470d6b941d8486bc53ff5400801 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 19:14:48 +0000 Subject: [PATCH 19/37] install cuquantum libs --- .github/workflows/wheel_linux_aarch64_cuda.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index e27245c375..c844416a99 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -104,6 +104,9 @@ jobs: python -m ensurepip --upgrade python -m pip install setuptools python -m pip install -r requirements-tests.txt + PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py + SKIP_COMPILATION=True python -m pip install . -vv + python -m pip install custatevec-cu${{ matrix.cuda_version }} cutensornet-cu${{ matrix.cuda_version }} cd wheelhouse for wheel in *.whl;do echo "Installing $wheel" From 1214b1e03a24796b4d8ddfebf7d4d0de8d577968 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 19:22:13 +0000 Subject: [PATCH 20/37] install lightning.qubit for wheels testing --- .github/workflows/wheel_linux_aarch64_cuda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index c844416a99..040b3f2b39 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -105,7 +105,7 @@ jobs: python -m pip install setuptools python -m pip install -r requirements-tests.txt PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py - SKIP_COMPILATION=True python -m pip install . -vv + python -m pip install . -vv python -m pip install custatevec-cu${{ matrix.cuda_version }} cutensornet-cu${{ matrix.cuda_version }} cd wheelhouse for wheel in *.whl;do From 163af189eb6997cec894bb191dcb294eae85a92c Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 19:48:20 +0000 Subject: [PATCH 21/37] add nvjitlink to rpath --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 030de959a8..cb6ea5c93a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,7 +153,7 @@ if(ENABLE_PYTHON) if("${PL_BACKEND}" STREQUAL "lightning_gpu" OR "${PL_BACKEND}" STREQUAL "lightning_tensor") # Allow pip installation of cuQuantum & CUDA 12 libs to be accessible without setting LD_LIBRARY_PATH for lightning_gpu # BUILD_RPATH only works for the last call - set_target_properties("${PL_BACKEND}_ops" PROPERTIES BUILD_RPATH "$ORIGIN/../cuquantum/lib:$ORIGIN/../nvidia/cuda_runtime/lib:$ORIGIN/../nvidia/cublas/lib:$ORIGIN/../nvidia/cusparse/lib:${SCIPY_OPENBLAS32_RUNTIME_LIB_PATH}:$ORIGIN") + set_target_properties("${PL_BACKEND}_ops" PROPERTIES BUILD_RPATH "$ORIGIN/../cuquantum/lib:$ORIGIN/../nvidia/cuda_runtime/lib:$ORIGIN/../nvidia/nvjitlink/lib:$ORIGIN/../nvidia/cublas/lib:$ORIGIN/../nvidia/cusparse/lib:${SCIPY_OPENBLAS32_RUNTIME_LIB_PATH}:$ORIGIN") else() set_target_properties("${PL_BACKEND}_ops" PROPERTIES BUILD_RPATH "${SCIPY_OPENBLAS32_RUNTIME_LIB_PATH}") endif() From 5bb700183aa5fcf4d58e70a0e9f7c070a1f38d73 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 20:09:02 +0000 Subject: [PATCH 22/37] upload artifacts --- .github/workflows/wheel_linux_aarch64_cuda.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 040b3f2b39..0065b3dc65 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -105,8 +105,7 @@ jobs: python -m pip install setuptools python -m pip install -r requirements-tests.txt PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py - python -m pip install . -vv - python -m pip install custatevec-cu${{ matrix.cuda_version }} cutensornet-cu${{ matrix.cuda_version }} + SKIP_COMPILATION=True python -m pip install . -vv cd wheelhouse for wheel in *.whl;do echo "Installing $wheel" @@ -129,10 +128,10 @@ jobs: regex: '.*[0-9]+.[0-9]+.[0-9]+[-_]?rc[0-9]+' - uses: actions/upload-artifact@v4 - if: | - github.event_name == 'release' || - github.event_name == 'workflow_dispatch' || - github.ref == 'refs/heads/master' + #if: | + # github.event_name == 'release' || + # github.event_name == 'workflow_dispatch' || + # github.ref == 'refs/heads/master' with: name: ${{ runner.os }}-wheels-${{ matrix.pl_backend }}-${{ fromJson('{ "cp310-*":"py310","cp311-*":"py311","cp312-*":"py312" }')[matrix.cibw_build] }}-${{ matrix.arch }}-cu${{ matrix.cuda_version }}.zip path: ./wheelhouse/*.whl From b7fed03ea7c78da525862a024a7335f9002bc3bf Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 20:21:30 +0000 Subject: [PATCH 23/37] install LQ --- .github/workflows/wheel_linux_aarch64_cuda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 0065b3dc65..2221fe4928 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -105,7 +105,7 @@ jobs: python -m pip install setuptools python -m pip install -r requirements-tests.txt PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py - SKIP_COMPILATION=True python -m pip install . -vv + python -m pip install . -vv cd wheelhouse for wheel in *.whl;do echo "Installing $wheel" From 03fe4488a99d817e9804b38c9f45208a6e37c541 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 20:32:32 +0000 Subject: [PATCH 24/37] install cuquantum sdk before wheels test --- .github/workflows/wheel_linux_aarch64_cuda.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 2221fe4928..d0bdb644b2 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -104,6 +104,7 @@ jobs: python -m ensurepip --upgrade python -m pip install setuptools python -m pip install -r requirements-tests.txt + python -m pip install cutensornet-cu${{ matrix.cuda_version }} custatevec-cu${{ matrix.cuda_version }} PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py python -m pip install . -vv cd wheelhouse From e3dae4bd585ad2d6da5d6fac53f444c6e01994e0 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 20:36:43 +0000 Subject: [PATCH 25/37] fix cuquantum sdk dependencies conflicts --- .github/workflows/wheel_linux_aarch64_cuda.yml | 1 - scripts/configure_pyproject_toml.py | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index d0bdb644b2..2221fe4928 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -104,7 +104,6 @@ jobs: python -m ensurepip --upgrade python -m pip install setuptools python -m pip install -r requirements-tests.txt - python -m pip install cutensornet-cu${{ matrix.cuda_version }} custatevec-cu${{ matrix.cuda_version }} PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py python -m pip install . -vv cd wheelhouse diff --git a/scripts/configure_pyproject_toml.py b/scripts/configure_pyproject_toml.py index bad11976d1..db4831390a 100755 --- a/scripts/configure_pyproject_toml.py +++ b/scripts/configure_pyproject_toml.py @@ -94,10 +94,10 @@ def parse_args(): "setuptools>=42", "tomli", ] - if backend == "lightning_gpu": - requires.append("custatevec-cu12") - if backend == "lightning_tensor": - requires.append("cutensornet-cu12") +# if backend == "lightning_gpu": +# requires.append("custatevec-cu12") +# if backend == "lightning_tensor": +# requires.append("cutensornet-cu12") pyproject["build-system"]["requires"] = requires From 63078d7a0c12eb91626af642fbff7259e4ec614b Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 20:47:41 +0000 Subject: [PATCH 26/37] install dependencies --- .github/workflows/wheel_linux_aarch64_cuda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 2221fe4928..dbf9e624a6 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -109,7 +109,7 @@ jobs: cd wheelhouse for wheel in *.whl;do echo "Installing $wheel" - python -m pip install $wheel --force-reinstall --no-deps + python -m pip install $wheel --force-reinstall done cd .. From d82ff6c73e4884f91beadc123c12901230300cb2 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 20:58:39 +0000 Subject: [PATCH 27/37] fix --- .github/workflows/wheel_linux_aarch64_cuda.yml | 2 -- scripts/configure_pyproject_toml.py | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index dbf9e624a6..c1b7717ad4 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -104,8 +104,6 @@ jobs: python -m ensurepip --upgrade python -m pip install setuptools python -m pip install -r requirements-tests.txt - PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py - python -m pip install . -vv cd wheelhouse for wheel in *.whl;do echo "Installing $wheel" diff --git a/scripts/configure_pyproject_toml.py b/scripts/configure_pyproject_toml.py index db4831390a..bad11976d1 100755 --- a/scripts/configure_pyproject_toml.py +++ b/scripts/configure_pyproject_toml.py @@ -94,10 +94,10 @@ def parse_args(): "setuptools>=42", "tomli", ] -# if backend == "lightning_gpu": -# requires.append("custatevec-cu12") -# if backend == "lightning_tensor": -# requires.append("cutensornet-cu12") + if backend == "lightning_gpu": + requires.append("custatevec-cu12") + if backend == "lightning_tensor": + requires.append("cutensornet-cu12") pyproject["build-system"]["requires"] = requires From 9d06a42b712eeb35e878040ba98f1fcacdcc7265 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 21:05:13 +0000 Subject: [PATCH 28/37] skip lq compilations --- .github/workflows/wheel_linux_aarch64_cuda.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index c1b7717ad4..8cb5c8f63d 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -104,6 +104,8 @@ jobs: python -m ensurepip --upgrade python -m pip install setuptools python -m pip install -r requirements-tests.txt + PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py + SKIP_COMPILATION=True python -m pip install . -vv cd wheelhouse for wheel in *.whl;do echo "Installing $wheel" From 0aa04b6b5fa50fa0e1035a0ddc578c80fda121a1 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 21:08:59 +0000 Subject: [PATCH 29/37] tidy up --- .github/workflows/wheel_linux_aarch64_cuda.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 8cb5c8f63d..96c5aef2b4 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -106,12 +106,7 @@ jobs: python -m pip install -r requirements-tests.txt PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py SKIP_COMPILATION=True python -m pip install . -vv - cd wheelhouse - for wheel in *.whl;do - echo "Installing $wheel" - python -m pip install $wheel --force-reinstall - done - cd .. + python -m pip install ./wheelhouse/*.whl DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` PL_DEVICE=${DEVICENAME} python -m pytest tests/ -k "not test_native_mcm" From 2f22630a914fbecc040d108370a2401152dc2a55 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 21:52:46 +0000 Subject: [PATCH 30/37] install LQ --- .github/workflows/wheel_linux_aarch64_cuda.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 96c5aef2b4..ce4f9400d5 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -105,9 +105,8 @@ jobs: python -m pip install setuptools python -m pip install -r requirements-tests.txt PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py - SKIP_COMPILATION=True python -m pip install . -vv + python -m pip install . -vv python -m pip install ./wheelhouse/*.whl - DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` PL_DEVICE=${DEVICENAME} python -m pytest tests/ -k "not test_native_mcm" From eee60ca3b1f8d1d0364316f959eafcb6a9b6cf1d Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 21:57:58 +0000 Subject: [PATCH 31/37] revert verbo to 3 --- .github/workflows/wheel_linux_aarch64_cuda.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index ce4f9400d5..2143e5f1a5 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -84,7 +84,7 @@ jobs: CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28 - CIBW_BUILD_VERBOSITY: 1 + CIBW_BUILD_VERBOSITY: 3 run: python -m cibuildwheel --output-dir wheelhouse @@ -105,7 +105,7 @@ jobs: python -m pip install setuptools python -m pip install -r requirements-tests.txt PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py - python -m pip install . -vv + SKIP_COMPILATION=True python -m pip install . -vv python -m pip install ./wheelhouse/*.whl DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` PL_DEVICE=${DEVICENAME} python -m pytest tests/ -k "not test_native_mcm" From e883fe8882dcdcf6915fef1d9d9e0d07cf216e40 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 21:58:12 +0000 Subject: [PATCH 32/37] drop LQ for LT unit tests --- tests/lightning_tensor/test_measurements_class.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/lightning_tensor/test_measurements_class.py b/tests/lightning_tensor/test_measurements_class.py index 8cd48f23b3..d3c9c96648 100644 --- a/tests/lightning_tensor/test_measurements_class.py +++ b/tests/lightning_tensor/test_measurements_class.py @@ -140,7 +140,7 @@ def test_probs_many_wires(self, method, n_qubits, n_targets, tol): pytest.skip("Number of targets cannot exceed the number of wires.") dev = qml.device(device_name, wires=n_qubits, **method) - dq = qml.device("lightning.qubit", wires=n_qubits) + dq = qml.device("default.qubit", wires=n_qubits) init_state = np.random.rand(2**n_qubits) + 1.0j * np.random.rand(2**n_qubits) init_state /= np.linalg.norm(init_state) @@ -168,7 +168,7 @@ def test_state_many_wires(self, method, n_qubits, n_targets, tol): pytest.skip("Number of targets cannot exceed the number of wires.") dev = qml.device(device_name, wires=n_qubits, **method) - dq = qml.device("lightning.qubit", wires=n_qubits) + dq = qml.device("default.qubit", wires=n_qubits) init_state = np.random.rand(2**n_qubits) + 1.0j * np.random.rand(2**n_qubits) init_state /= np.linalg.norm(init_state) From f7191c79b1619b287721d58c17509d6ffb772462 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 22:58:56 +0000 Subject: [PATCH 33/37] update test cases --- .github/workflows/wheel_linux_aarch64_cuda.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 2143e5f1a5..878b0121e7 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -108,7 +108,12 @@ jobs: SKIP_COMPILATION=True python -m pip install . -vv python -m pip install ./wheelhouse/*.whl DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` - PL_DEVICE=${DEVICENAME} python -m pytest tests/ -k "not test_native_mcm" + if (${{ matrix.pl_backend == 'lightning_tensor' }}) then + PL_DEVICE=${DEVICENAME} python -m pytest tests/ + else + pl-device-test --device=${DEVICENAME} --skip-ops -x --tb=short --no-flaky-report + fi + - name: Validate wheels run: | From 6c561c957449ee6040db6017354dc3506135d34b Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Tue, 7 Jan 2025 23:33:07 +0000 Subject: [PATCH 34/37] skip get_c_interface test --- .github/workflows/wheel_linux_aarch64_cuda.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 878b0121e7..3bdd7f58d5 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -112,6 +112,8 @@ jobs: PL_DEVICE=${DEVICENAME} python -m pytest tests/ else pl-device-test --device=${DEVICENAME} --skip-ops -x --tb=short --no-flaky-report + # MCM tests are slow and skipped. get_c_interface() API is not supported with current test setup and skipped. + PL_DEVICE=${DEVICENAME} python -m pytest tests/ -k "not test_supported_linux_platform_gpu and not test_native_mcm" fi From 2f551a18277bec34db1c079aacab501e91c08c51 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Wed, 8 Jan 2025 14:34:48 +0000 Subject: [PATCH 35/37] revert some changes --- .github/workflows/wheel_linux_aarch64_cuda.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 3bdd7f58d5..10aeaf080c 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -50,8 +50,13 @@ jobs: - name: Checkout PennyLane-Lightning uses: actions/checkout@v4 + - name: Install Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Install cibuildwheel - run: python -m pip install cibuildwheel~=2.20.0 tomlkit + 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 @@ -86,7 +91,7 @@ jobs: CIBW_BUILD_VERBOSITY: 3 - run: python -m cibuildwheel --output-dir wheelhouse + run: python3 -m cibuildwheel --output-dir wheelhouse - name: Determine Python version id: pyvs @@ -119,8 +124,8 @@ jobs: - name: Validate wheels run: | - python -m pip install twine - python -m twine check ./wheelhouse/*.whl + python3 -m pip install twine + python3 -m twine check ./wheelhouse/*.whl - uses: actions-ecosystem/action-regex-match@main id: rc_build From 7406a7b4c547c95484fa6343c626abd3107795d3 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Wed, 8 Jan 2025 16:48:36 +0000 Subject: [PATCH 36/37] add changelog --- .github/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index bfb8d3bdbc..438b13c8b3 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -29,6 +29,9 @@ ### Improvements +* Add CI wheels checks for `aarch64` wheels of Lightning-GPU and Lightning-Tensor. + [(#1031)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1031/) + * Replace the `dummy_tensor_update` method with the `cutensornetStateCaptureMPS`API to ensure that further gates apply is allowed after the `cutensornetStateCompute` call. [(#1028)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1028/) From 107d16e9672cf4a72bfc6e840fbfd7f08041b0c1 Mon Sep 17 00:00:00 2001 From: Shuli Shu <08cnbj@gmail.com> Date: Wed, 8 Jan 2025 18:35:40 +0000 Subject: [PATCH 37/37] apply Ali's suggestions --- .github/CHANGELOG.md | 13 ++++++++----- .github/workflows/wheel_linux_aarch64_cuda.yml | 1 - 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 438b13c8b3..18325cc4fc 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -30,19 +30,19 @@ ### Improvements * Add CI wheels checks for `aarch64` wheels of Lightning-GPU and Lightning-Tensor. - [(#1031)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1031/) + [(#1031)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1031) * Replace the `dummy_tensor_update` method with the `cutensornetStateCaptureMPS`API to ensure that further gates apply is allowed after the `cutensornetStateCompute` call. - [(#1028)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1028/) + [(#1028)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1028) * Add unit test for measurement with shots for Lightning Tensor with `tn` method. [(#1027)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1027) * Add CUDA dependencies to Lightning GPU and Lightning Tensor Python wheels. - [(#1025)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1025/) + [(#1025)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1025) * Update the python layer UI of Lightning Tensor. - [(#1022)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1022/) + [(#1022)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1022) * Catalyst device interfaces support dynamic shots, and no longer parses the device init op's attribute dictionary for a static shots literal. [(#1017)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1017) @@ -54,7 +54,7 @@ [(#1015)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1015) * Add Exact Tensor Network cpp binding. - [(#1014)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1014/) + [(#1014)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1014) * Reverse Lightning Qubit generators vector insertion order. [(#1009)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1009) @@ -107,6 +107,9 @@ ### Bug fixes +* Fix Python CUDA dependencies by adding path to `nvidia/nvjitlink/lib` to RPATH. + [(#1031)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1031) + * Add `RTLD_NODELETE` flag to `dlopen` in order to mitigate the segfault issues for arm64-macos Catalyst support. [(#1030)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1030) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index 10aeaf080c..4839dd426f 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -107,7 +107,6 @@ jobs: - name: Test wheels run: | python -m ensurepip --upgrade - python -m pip install setuptools python -m pip install -r requirements-tests.txt PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py SKIP_COMPILATION=True python -m pip install . -vv