-
Notifications
You must be signed in to change notification settings - Fork 36
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 CUDA-12 capability #477
Conversation
…ata` to work with devices. M pennylane_lightning/core/src/simulators/lightning_kokkos/StateVectorKokkos.hpp; `applyMatrix` bugfix: use intermediate hostview to copy matrix data; same bugfix for `getDataVector`. M pennylane_lightning/core/src/simulators/lightning_kokkos/algorithms/AdjointJacobianKokkos.hpp; use copy constructor. M pennylane_lightning/core/src/simulators/lightning_kokkos/measurements/MeasurementsKokkos.hpp; use copy constructor. M pennylane_lightning/core/src/simulators/lightning_kokkos/observables/ObservablesKokkos.hpp; use copy constructor. M requirements-dev.txt; add clang-format-14.
Hello. You may have forgotten to update the changelog!
|
Codecov Report
@@ Coverage Diff @@
## master #477 +/- ##
==========================================
- Coverage 97.22% 96.84% -0.39%
==========================================
Files 142 142
Lines 16420 16275 -145
==========================================
- Hits 15964 15761 -203
- Misses 456 514 +58
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to see this GPU fix go in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for that!
Hey @vincentmr, you may need to re-trigger CIs here. |
* Introduce std::unordered_map<std::string, ExpValFunc> expval_funcs_. * Introduce applyExpectationValueFunctor. * Add binding to LKokkos expval(matrix, wires). Combine expval functor calls into two templated methods. Call specialized expval methods when possible. Remove obsolete 'Apply directly' tests. * Update changelog. * Add test for arbitrary expval(Hermitian). * Add getExpectationValueMultiQubitOpFunctor. * Add typename hint for macos. * Add typename macos. * Use Kokkos::ThreadVectorRange policy for innerloop in getExpectationValueMultiQubitOpFunctor. * Couple fix for HIP. * Use inner product scheme instead of getExpectationValueMultiQubitOpFunctor to compute multi-qubit expval.
Add CUDA-12 capability
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 thechange, 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:
The Kokkos backend could not be built or executed on devices. A few minors fixes are necessary. Notably,
JacobianData
works with a data pointer which is not accessible if the data lives on a device.Description of the Change:
Fix few bugs, and get the state vector data from the device to the host, into
JacobianData
.Benefits:
This code builds with CUDA-12 and executes on capable NVidia devices.
Possible Drawbacks:
This is a quick fix, but we should think about a more perennial solution. For example, we could store the state vector in
JacobianData
or pass the state vector toadjointJacobian
as followsadjointJacobian(std::span{jac}, jd, sv)
.sv
could be[[maybe_unused]]
in LQubit and used in device-executing backends.Related GitHub Issues: