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

Add MCMC sampling to Lightning-Kokkos #1011

Open
tomlqc opened this issue Nov 27, 2024 · 8 comments
Open

Add MCMC sampling to Lightning-Kokkos #1011

tomlqc opened this issue Nov 27, 2024 · 8 comments

Comments

@tomlqc
Copy link
Contributor

tomlqc commented Nov 27, 2024

Important Note

⚠️ This issue is part of an internal assignment and not meant for external contributors

Context

Markov Chain Monte Carlo (MCMC) sampling has been added to lightning.qubit (LQ) in PR#384. The goal of this issue is to implement MCMC sampling in lightning.kokkos (LK) by making best use of the Kokkos libraries.

Requirements

A PR must satisfy the following:

  • Create a draft pull-request in PennyLane Lightning that you can use for questions and further communication.
  • Implement MCMC in LK in analogy to PR#384.
  • Validate your implementation with C++ and Python tests.
  • Benchmark the LK implementation (depending on number of qubits and number of threads) vs LQ and upload a summary and plots to the pull-request for further discussions. Please use gist.github in case you intend to share larger files e.g. additional scripts.
  • Ensure to complete all the steps outlined in the PR template and mark the PR ready for review.

Don't hesitate to ask for clarification or raise any concerns regarding the issue. We'll be happy to discuss with you!

@niesohrima
Copy link

thanks. what's your preference for the base branch for this PR?

@tomlqc
Copy link
Contributor Author

tomlqc commented Dec 2, 2024

what's your preference for the base branch for this PR?

@niesohrima The master branch is fine

@niesohrima
Copy link

thanks.
build and install is successful:

Successfully installed PennyLane_Lightning-0.40.0.dev24
Remote version of pip: 24.3.1
Local version of pip: 24.3.1
Was pip installed by pip? True
Removed build tracker: '/tmp/pip-build-tracker-_gn_u021'

but cannot run the tests.

make test-python fails with this:

PL_DEVICE=lightning.qubit python3 -I -m pytest tests --tb=short
ImportError while loading conftest.
tests/conftest.py:124: in

import pennylane_lightning.lightning_qubit as lightning_ops  # Any definition of lightning_ops will do

pennylane_lightning/lightning_qubit/init.py:18: in
from .lightning_qubit import LightningQubit
pennylane_lightning/lightning_qubit/lightning_qubit.py:29: in
from pennylane.devices.capabilities import OperatorProperties
E ModuleNotFoundError: No module named 'pennylane.devices.capabilities'
make: *** [Makefile:107: test-builtin] Error 4

and make test-cpp fails with this:

[50/88] Building CXX object pennylane_lightning/core/src/utils/tests/CMakeFiles/utils_test_runner.dir/Test_Util.cpp.o
FAILED: pennylane_lightning/core/src/utils/tests/CMakeFiles/utils_test_runner.dir/Test_Util.cpp.o

error: unknown option after ‘#pragma GCC diagnostic’ kind [-Werror=pragmas]

93 | #pragma GCC diagnostic ignored "-Wmismatched-new-delete"
| ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
[55/88] Building CXX object pennylane_lightning/core/src/simulators/lightning_qubit/gates/CMakeFiles/lq_gates_register_kernels_x64.dir/RegisterKernels_x64.cpp.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:116: test-cpp] Error 1

tried cmake with DENABLE-WARNINGS=OFF but still the same errors.

if necessary:

gcc (Ubuntu 10.5.0-1ubuntu120.04) 10.5.0
g++ (Ubuntu 10.5.0-1ubuntu1
20.04) 10.5.0
cmake version 3.30.2

do you have any tips?

@tomlqc
Copy link
Contributor Author

tomlqc commented Dec 3, 2024

Hi @niesohrima, this may just be a gcc version issue. Could you rerun with gcc 13?

@niesohrima
Copy link

thanks. bumping up gcc version fixed the cpp tests, but the python pytests are still failing right at the pennylane import with:

ImportError while loading conftest '/pennylane-lightning/tests/conftest.py'.
tests/conftest.py:124: in
import pennylane_lightning.lightning_qubit as lightning_ops # Any definition of lightning_ops will do
pennylane_lightning/lightning_qubit/init.py:18: in
from .lightning_qubit import LightningQubit
pennylane_lightning/lightning_qubit/lightning_qubit.py:29: in
from pennylane.devices.capabilities import OperatorProperties
E ModuleNotFoundError: No module named 'pennylane.devices.capabilities'

@tomlqc
Copy link
Contributor Author

tomlqc commented Dec 4, 2024

Please make sure that both pennylane/pennylane-lightning are installed with the same version i.e. master/master or v39/v39 etc

@tomlqc
Copy link
Contributor Author

tomlqc commented Dec 9, 2024

@niesohrima Let us know if you have any further questions, and feel free to open a draft PR to share your WIP.

@niesohrima
Copy link

@tomlqc I truly appreciate the opportunity and the time you’ve invested in the process. Unfortunately, due to recent time constraints, I was unable to complete the assigned task. After reflecting on my current priorities and commitments, I have decided to withdraw my application. I sincerely apologize for any inconvenience this may cause and hope we may cross paths again in the future. Wishing you and the team all the best moving forward and filling in the position. Thanks again for your time and consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants