Giter VIP home page Giter VIP logo

pennylane-lightning-kokkos's Introduction

PennyLane-Lightning-Kokkos Plugin

The PennyLane-Lightning-Kokkos plugin extends the Pennylane-Lightning state-vector simulator written in C++, and offloads to the Kokkos library for accelerated circuit simulation.

PennyLane is a cross-platform Python library for quantum machine learning, automatic differentiation, and optimization of hybrid quantum-classical computations.

Installation

cmake -Bbuild -DKokkos_ENABLE_OPENMP=On -DPLKOKKOS_BUILD_TESTS=On -G Ninja
cmake --build ./build

or for the THREADS backend

cmake -Bbuild -DKokkos_ENABLE_THREADS=On -DPLKOKKOS_BUILD_TESTS=On -G Ninja
cmake --build ./build

You can install the python interface with:

python setup.py build_ext --backend="OPENMP"
python setup.py bdist_wheel
pip install ./dist/PennyLane*.whl --force-reinstall

or for an editable pip installation with:

BACKEND="OPENMP" python -m pip install -e .

Supported backend options are "SERIAL", "OPENMP", "THREADS", "HIP" and "CUDA". For "HIP" and "CUDA", the appropriate software stacks are required to enable compilation and subsequent use. For explicit targeting of a given supported architecture, the environment varaible ARCH can also be specified which directly sets the -DKokkos_ARCH_{...}=ON build option.

Testing

To test with the ROCm stack using a manylinux2014 container we must first mount the repository into the container:

docker run -v `pwd`:/io -it quay.io/pypa/manylinux2014_x86_64 bash

Next, within the container, we install the ROCm software stack:

yum install -y https://repo.radeon.com/amdgpu-install/21.40.2/rhel/7.9/amdgpu-install-21.40.2.40502-1.el7.noarch.rpm
amdgpu-install --usecase=hiplibsdk,rocm --no-dkms

We next build the test-suite, with a given AMD GPU target in mind, as listed here.

cd /io
export PATH=$PATH:/opt/rocm/bin/ 
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib
export CXX=/opt/rocm/hip/bin/hipcc 
cmake -Bbuild -DCMAKE_CXX_COMPILER=/opt/rocm/hip/bin/hipcc -DKokkos_ENABLE_HIP=on -DPLKOKKOS_BUILD_TESTS=On -DKokkos_ARCH_VEGA90A=ON
cmake --build ./build --verbose

We may now leave the container, and run the built test-suite on a machine with access to the targetted GPU.

For a system with access to the ROCm stack outside of a manylinux container, an editable pip installation can be built and installed as:

BACKEND="HIP" ARCH="VEGA90A" python -m pip install -e .

Support

If you are having issues, please let us know by posting the issue on our Github issue tracker, or by asking a question in the forum.

License

The PennyLane-Lightning-Kokkos plugin is free and open source, released under the Apache License, Version 2.0. The PennyLane-Lightning-Kokkos plugin makes use of the Kokkos library, which is held to their own respective licenses.

Acknowledgements

The PennyLane Lightning Kokkos plugin makes use of the following libraries and tools, which are under their own respective licenses:

pennylane-lightning-kokkos's People

Contributors

amintordusko avatar josh146 avatar mlxd avatar multiphasecfd avatar trevor-vincent avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.