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

Merge v0.39.0_rc to master #981

Merged
merged 29 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3a8385e
Create v0.39.0 RC branch.
multiphaseCFD Oct 28, 2024
a38b036
Fix LK build path for catalyst shared library (#968)
josephleekl Oct 30, 2024
0fc077e
Integrate LGPU to Catalyst (#928)
multiphaseCFD Oct 30, 2024
a3564a1
update version numbers
multiphaseCFD Nov 1, 2024
3577243
update PR orders in the changelog
multiphaseCFD Nov 1, 2024
22664aa
upload wheels
multiphaseCFD Nov 1, 2024
976baf6
Trigger CIs
multiphaseCFD Nov 1, 2024
449579b
Fix qml.state() support for LT (#971)
multiphaseCFD Nov 4, 2024
ab41159
Update changelog (#973)
maliasadi Nov 4, 2024
035b63d
Update rc version
maliasadi Nov 4, 2024
b830cee
update docs
multiphaseCFD Nov 4, 2024
181a246
Update Lightning-Tensor install docs (#972)
DSGuala Nov 4, 2024
3bb6d5f
update rc version
multiphaseCFD Nov 4, 2024
d5e064d
macos target from 12.0 to 13.0
multiphaseCFD Nov 4, 2024
956b2bd
update to rc3
multiphaseCFD Nov 4, 2024
c6d5a28
test macos14.0
multiphaseCFD Nov 4, 2024
84dd86a
update macos-12 wheel labels
multiphaseCFD Nov 4, 2024
06043d8
add changelog entry for the macos-12 deprecation
multiphaseCFD Nov 4, 2024
cf828ac
Lightning Kokkos arg test fix for MacOS (#974)
josephleekl Nov 4, 2024
dcea959
Forked as v0.39.0_release to be released with tag v0.39.0.
multiphaseCFD Nov 4, 2024
43b9ae2
update changelog and version
multiphaseCFD Nov 5, 2024
5103e41
Merge branch 'master' into merge_v0.39.0_rc_into_master
multiphaseCFD Nov 5, 2024
d0318ae
Add changelog entry
multiphaseCFD Nov 5, 2024
74c29f2
Trigger CIs
multiphaseCFD Nov 5, 2024
3488f39
trigger ci
maliasadi Nov 5, 2024
6e72b77
Trigger CIs
multiphaseCFD Nov 6, 2024
a29597c
Apply suggestions from code review
maliasadi Nov 6, 2024
b6a8864
Update changelog
maliasadi Nov 6, 2024
69c5670
trigger ci
maliasadi Nov 6, 2024
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
166 changes: 102 additions & 64 deletions .github/CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/workflows/compat-docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Docker release - Linux::x86_64
uses: ./.github/workflows/docker_linux_x86_64.yml
with:
lightning-version: v0.38.0_rc
pennylane-version: v0.38.0-rc0
lightning-version: v0.39.0_rc
pennylane-version: v0.39.0-rc0
push-to-dockerhub: false
secrets: inherit # pass all secrets
13 changes: 13 additions & 0 deletions .github/workflows/tests_gpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,19 @@ jobs:
run: |
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS

- name: Test wheels for Lightning-GPU
if : matrix.pl_backend == 'lightning_gpu'
run: |
python -m pip install -r requirements-dev.txt
PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py
SKIP_COMPILATION=True python -m pip install . -vv

DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
PL_BACKEND=${DEVICENAME} python scripts/configure_pyproject_toml.py
python -m build
python -m pip install dist/*.whl --force-reinstall --no-deps
PL_DEVICE=${DEVICENAME} python -m pytest tests/test_device.py $COVERAGE_FLAGS

- name: Move coverage file
run: |
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/tests_lkcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,17 @@ jobs:
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
mv .coverage ${{ github.workspace }}/.coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.group }}

- name: Test editable install
run: |
rm -r build
pip uninstall pennylane-lightning pennylane-lightning-kokkos -y
python scripts/configure_pyproject_toml.py
SKIP_COMPILATION=True python -m pip install -e . --config-settings editable_mode=compat
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
PL_BACKEND=${DEVICENAME} python scripts/configure_pyproject_toml.py
python -m pip install -e . --config-settings editable_mode=compat -vv
PL_DEVICE=${DEVICENAME} python -m pytest tests/test_device.py $COVERAGE_FLAGS

- name: Upload test durations
uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wheel_macos_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:
ARCHS: 'arm64'
PYTHON3_MIN_VERSION: "10"
PYTHON3_MAX_VERSION: "12"
MACOSX_DEPLOYMENT_TARGET: 12.0
MACOSX_DEPLOYMENT_TARGET: 13.0

concurrency:
group: wheel_macos_arm64-${{ github.ref }}
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-12]
os: [macos-13]
arch: [arm64]
pl_backend: ["lightning_kokkos", "lightning_qubit"]
cibw_build: ${{fromJson(needs.mac-set-matrix-arm.outputs.python_version)}}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/wheel_macos_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
workflow_dispatch:

env:
MACOSX_DEPLOYMENT_TARGET: 12.0
MACOSX_DEPLOYMENT_TARGET: 13.0

concurrency:
group: wheel_macos_x86_64-${{ github.ref }}
Expand All @@ -40,7 +40,7 @@ jobs:
needs: [set_wheel_build_matrix]
strategy:
matrix:
os: [macos-12]
os: [macos-13]
arch: [x86_64]
exec_model: ${{ fromJson(needs.set_wheel_build_matrix.outputs.exec_model) }}
kokkos_version: ${{ fromJson(needs.set_wheel_build_matrix.outputs.kokkos_version) }}
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-12]
os: [macos-13]
arch: [x86_64]
pl_backend: ["lightning_kokkos", "lightning_qubit"]
cibw_build: ${{fromJson(needs.set_wheel_build_matrix.outputs.python_version)}}
Expand Down
12 changes: 12 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,20 @@ Lightning-Tensor requires CUDA 12 and the `cuQuantum SDK <https://developer.nvid
The SDK may be installed within the Python environment ``site-packages`` directory using ``pip`` or ``conda`` or the SDK library path appended to the ``LD_LIBRARY_PATH`` environment variable.
Please see the `cuQuantum SDK <https://developer.nvidia.com/cuquantum-sdk>`_ install guide for more information.

Lightning-Tensor and ``cutensornet-cu12`` can be installed via:

.. code-block:: bash

pip install cutensornet-cu12
pip install pennylane-lightning-tensor

Install Lightning-Tensor from source
====================================

.. note::

The below contains instructions for installing Lightning-Tensor ***from source***. For most cases, *this is not required* and one can simply use the installation instructions at `pennylane.ai/install <https://pennylane.ai/install/#high-performance-computing-and-gpus>`__. If those instructions do not work for you, or you have a more complex build environment that requires building from source, then consider reading on.

Lightning-Qubit should be installed before Lightning-Tensor (compilation is not necessary):

.. code-block:: bash
Expand Down
74 changes: 74 additions & 0 deletions cmake/support_catalyst.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
###############################################################################################
# This file provides macros to process Catalyst.
###############################################################################################

# Include this only once
include_guard()

macro(FindCatalyst target_name)
if(LIGHTNING_CATALYST_SRC_PATH)
if(NOT IS_ABSOLUTE ${LIGHTNING_CATALYST_SRC_PATH})
message(FATAL_ERROR " LIGHTNING_CATALYST_SRC_PATH=${LIGHTNING_CATALYST_SRC_PATH} must be set to an absolute path")
endif()
if(CATALYST_GIT_TAG)
message(WARN " Setting `LIGHTNING_CATALYST_SRC_PATH=${LIGHTNING_CATALYST_SRC_PATH}` overrides `CATALYST_GIT_TAG=${CATALYST_GIT_TAG}`")
endif()

# Acquire local git hash and use for CATALYST_GIT_TAG
execute_process(COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${LIGHTNING_CATALYST_SRC_PATH}
OUTPUT_VARIABLE CATALYST_GIT_TAG
)
message(INFO " Building against local Catalyst - path: ${LIGHTNING_CATALYST_SRC_PATH} - GIT TAG: ${CATALYST_GIT_TAG}")

target_include_directories(${target_name} PUBLIC ${LIGHTNING_CATALYST_SRC_PATH}/runtime/lib/backend/common)
target_include_directories(${target_name} PUBLIC ${LIGHTNING_CATALYST_SRC_PATH}/runtime/include)

else()
if(NOT CATALYST_GIT_TAG)
set(CATALYST_GIT_TAG "main" CACHE STRING "GIT_TAG value to build Catalyst")
endif()
message(INFO " Building against Catalyst GIT TAG ${CATALYST_GIT_TAG}")

# Fetching /lib/backend/common hpp headers
set(LIB_BACKEND_COMMON_HEADERS CacheManager.hpp
QubitManager.hpp
Utils.hpp
)

foreach(HEADER ${LIB_BACKEND_COMMON_HEADERS})
string(REGEX REPLACE "\\.[^.]*$" "" HEADER_NAME ${HEADER})
FetchContent_Declare(
${HEADER_NAME}
URL https://raw.githubusercontent.com/PennyLaneAI/catalyst/${CATALYST_GIT_TAG}/runtime/lib/backend/common/${HEADER}
DOWNLOAD_NO_EXTRACT True
SOURCE_DIR include
)

FetchContent_MakeAvailable(${HEADER_NAME})
endforeach()

# Fetching include hpp headers
set(INCLUDE_HEADERS DataView.hpp
Exception.hpp
QuantumDevice.hpp
RuntimeCAPI.h
Types.h
)

foreach(HEADER ${INCLUDE_HEADERS})
string(REGEX REPLACE "\\.[^.]*$" "" HEADER_NAME ${HEADER})
FetchContent_Declare(
${HEADER_NAME}
URL https://raw.githubusercontent.com/PennyLaneAI/catalyst/${CATALYST_GIT_TAG}/runtime/include/${HEADER}
DOWNLOAD_NO_EXTRACT True
SOURCE_DIR include
)

FetchContent_MakeAvailable(${HEADER_NAME})
endforeach()

target_include_directories(${target_name} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/include)

endif()
endmacro()
3 changes: 3 additions & 0 deletions doc/lightning_tensor/device.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ Check out the :doc:`/lightning_tensor/installation` guide for more information.

.. seealso:: `DefaultTensor <https://docs.pennylane.ai/en/latest/code/api/pennylane.devices.default_tensor.DefaultTensor.html>`__ for a CPU only tensor network simulator device.

Note that as ``lightning.tensor`` cannot be cleaned up like other state-vector devices because the data is attached to the graph. It is recommended to create a new ``lightning.tensor`` device per circuit to ensure resources are correctly handled.


Operations and observables support
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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-dev52"
__version__ = "0.40.0-dev0"
2 changes: 1 addition & 1 deletion pennylane_lightning/core/lightning_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
OpenMP.
"""

pennylane_requires = ">=0.37"
pennylane_requires = ">=0.38"

Check warning on line 53 in pennylane_lightning/core/lightning_base.py

View check run for this annotation

Codecov / codecov/patch

pennylane_lightning/core/lightning_base.py#L53

Added line #L53 was not covered by tests
version = __version__
author = "Xanadu Inc."
short_name = "lightning.base"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ endif()
###############################################################################
set(COMPONENT_SUBDIRS algorithms
bindings
catalyst
measurements
gates
observables
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.20)

project(lightning_gpu_catalyst LANGUAGES CXX)

set(LGPU_CATALYST_FILES LightningGPUSimulator.cpp CACHE INTERNAL "")
add_library(lightning_gpu_catalyst SHARED ${LGPU_CATALYST_FILES})

include(FetchContent)

include("${pennylane_lightning_SOURCE_DIR}/cmake/support_catalyst.cmake")
FindCatalyst(lightning_gpu_catalyst)

target_include_directories(lightning_gpu_catalyst INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(lightning_gpu_catalyst PUBLIC lightning_compile_options
lightning_gpu_algorithms
lightning_gpu_measurements
)

if (BUILD_TESTS)
enable_testing()
add_subdirectory("tests")
endif()
Loading
Loading