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

Refactor cuda_utils : move custatevec to lightning_gpu_utils #681

Merged
merged 27 commits into from
Apr 19, 2024

Conversation

multiphaseCFD
Copy link
Member

@multiphaseCFD multiphaseCFD commented Apr 12, 2024

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:

Remove cuda_utils's dependency on custatevec.h.

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

@multiphaseCFD multiphaseCFD added the ci:use-multi-gpu-runner Enable usage of Multi-GPU runner for this Pull Request label Apr 12, 2024
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.

github-actions bot and others added 5 commits April 12, 2024 20:39
* collapse() and normalized() with Kokkos

* Auto update version

* CodeFactor

* normalize() abort if norm is zero

* unittest for normalize()

* Auto update version

* unittest for normalize() in LighningQubit

* Auto update version

* Add MCM bindings and tests for L-Kokkos. (#672)

* Add MCM bindings and tests for L-Kokkos.

* Auto update version

* Refactor collapse.

* Try parallelizing tests.

* Only run test_native_mcm once amongst all workflows since it takes quite a bit of time.

* trigger ci

---------

Co-authored-by: Dev version update bot <github-actions[bot]@users.noreply.github.com>

* Do not run test_native_mcm with LK-GPU.

* Auto update version

* trigger ci

* Update pennylane_lightning/core/src/simulators/lightning_kokkos/bindings/LKokkosBindings.hpp

Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>

* Auto update version

* Update pennylane_lightning/core/src/simulators/lightning_kokkos/StateVectorKokkos.hpp

Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>

* Update pennylane_lightning/core/src/simulators/lightning_kokkos/StateVectorKokkos.hpp

Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>

* Update pennylane_lightning/core/src/simulators/lightning_kokkos/StateVectorKokkos.hpp

Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>

* Update pennylane_lightning/core/src/simulators/lightning_kokkos/StateVectorKokkos.hpp

Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>

* Increase shotsfor flaky test_composite_mcm_single_measure_obs

* Create separate device_allowed_operations list for ops supported by the device but not Catalyst.

* Use isinstance instead of name comparison.

* Check projector.

* Update operations at device init.

* Modify stopping condition in LK.

* Cannot use instance with Hamiltonian check.

* Update pennylane_lightning/core/src/simulators/lightning_kokkos/tests/Test_StateVectorLKokkos.cpp

Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com>

* Update pennylane_lightning/core/src/simulators/lightning_kokkos/StateVectorKokkos.hpp

Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com>

* Remove obsolete comment.

* Auto update version

* trigger ci

---------

Co-authored-by: Dev version update bot <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vincent Michaud-Rioux <vincent.michaud-rioux@xanadu.ai>
Co-authored-by: Vincent Michaud-Rioux <vincentm@nanoacademic.com>
Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com>
@multiphaseCFD multiphaseCFD added the ci:build_wheels Activate wheel building. label Apr 12, 2024
@multiphaseCFD multiphaseCFD marked this pull request as ready for review April 12, 2024 21:39
Copy link

codecov bot commented Apr 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.12%. Comparing base (72e4baa) to head (4fdd50e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #681      +/-   ##
==========================================
+ Coverage   98.68%   99.12%   +0.43%     
==========================================
  Files         172      208      +36     
  Lines       22544    27607    +5063     
==========================================
+ Hits        22248    27365    +5117     
+ Misses        296      242      -54     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@multiphaseCFD multiphaseCFD removed the ci:use-multi-gpu-runner Enable usage of Multi-GPU runner for this Pull Request label Apr 17, 2024
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.

Looks good so far, I left some suggestions.

@multiphaseCFD multiphaseCFD added the ci:use-multi-gpu-runner Enable usage of Multi-GPU runner for this Pull Request label Apr 18, 2024
Copy link
Contributor

@vincentmr vincentmr left a comment

Choose a reason for hiding this comment

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

Not blocking, but a few performance considerations/suggestions. Happy to approve otherwise.

I would not be worried about things happening on device initialization, but things getting called in a loop over operations could pile up for smallish circuits.

Copy link
Member

@maliasadi maliasadi left a comment

Choose a reason for hiding this comment

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

🙌

multiphaseCFD and others added 2 commits April 18, 2024 18:11
…StateVecError.hpp

Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
…StateVecError.hpp

Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
multiphaseCFD and others added 10 commits April 18, 2024 18:11
…StateVec_helpers.hpp

Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
…StateVecError.hpp

Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
…StateVec_helpers.hpp

Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
…StateVec_helpers.hpp

Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
…StateVecError.hpp

Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
@multiphaseCFD multiphaseCFD requested a review from maliasadi April 19, 2024 12:16
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.

Nice job! Thank you for that!

@multiphaseCFD multiphaseCFD merged commit f4acabd into master Apr 19, 2024
85 checks passed
@multiphaseCFD multiphaseCFD deleted the tidyup_cuda_utils branch April 19, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:build_wheels Activate wheel building. ci:use-multi-gpu-runner Enable usage of Multi-GPU runner for this Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants