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 SPVM routine for when kokkos not available. #465

Merged
merged 16 commits into from
Jul 6, 2023
Merged

Conversation

vincentmr
Copy link
Contributor

@vincentmr vincentmr commented Jun 21, 2023

Before submitting

Please complete the following checklist when submitting a PR:

  • All new features must include a unit test.
    If you've fixed a bug or added code that should be tested, add a test to the
    tests directory!

  • All new functions and code must be clearly commented and documented.
    If you do make documentation changes, make sure that the docs build and
    render correctly by running make docs.

  • Ensure that the test suite passes, by running make test.

  • Add a new entry to the .github/CHANGELOG.md file, summarizing the
    change, and including a link back to the PR.

  • Ensure that code is properly formatted by running make format.

When all the above are checked, delete everything above the dashed
line and fill in the pull request template.


Context:
Kokkos & Kokkos-kernels (serial backends) are used only for a single sparse matrix/dense vector operation. This is a

Description of the Change:
Add simple spvm implementation when ENABLE_KOKKOS=OFF.

Benefits:
No need to pull large dependencies Kokkos & Kokkos-kernels. SparseHamiltonian always supported.

Possible Drawbacks:
It could be slower, although the (serial) code is so simple that there is little room for optimization and that is unlikely.

Related GitHub Issues:

@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit .github/CHANGELOG.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Merging #465 (cd34892) into master (d702423) will increase coverage by 0.08%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #465      +/-   ##
==========================================
+ Coverage   99.82%   99.91%   +0.08%     
==========================================
  Files          50       50              
  Lines        4667     4671       +4     
==========================================
+ Hits         4659     4667       +8     
+ Misses          8        4       -4     
Impacted Files Coverage Δ
pennylane_lightning/src/simulator/Measures.hpp 99.52% <ø> (ø)
pennylane_lightning/src/util/LinearAlgebra.hpp 100.00% <ø> (ø)
pennylane_lightning/_version.py 100.00% <100.00%> (ø)
pennylane_lightning/lightning_qubit.py 100.00% <100.00%> (+0.85%) ⬆️
pennylane_lightning/src/util/SparseLinAlg.hpp 100.00% <100.00%> (ø)

@vincentmr vincentmr marked this pull request as ready for review June 22, 2023 21:17
@vincentmr vincentmr changed the title Add homemade sparse product for when kokkos not available. Add SPVM routine for when kokkos not available. Jun 22, 2023
Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some quick comments for the next week.

Copy link
Contributor

@AmintorDusko AmintorDusko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far looks good to me. I will check in more depth later.

@AmintorDusko
Copy link
Contributor

Hi, @vincentmr. It appears that the CI may have become stuck, so you may want to try re-triggering it.

vincentmr and others added 2 commits June 28, 2023 08:22
Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Vincent --- no more thoughts from me. Happy to approve.

@vincentmr vincentmr requested a review from multiphaseCFD July 4, 2023 20:43
Copy link
Member

@multiphaseCFD multiphaseCFD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job @vincentmr !

@vincentmr
Copy link
Contributor Author

Gist

Screenshot from 2023-07-06 10-02-50

@vincentmr vincentmr merged commit 8608a6e into master Jul 6, 2023
@vincentmr vincentmr deleted the feature/spmv branch July 6, 2023 14:12
@vincentmr vincentmr mentioned this pull request Jul 6, 2023
5 tasks
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

Successfully merging this pull request may close these issues.

4 participants