-
Notifications
You must be signed in to change notification settings - Fork 40
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
Update kokkos files from catalyst repo to support MCM seeding #819
Conversation
… We make a small update to track these changes. The Catalyst PR adds seeding to qjit: PennyLaneAI/catalyst#936
Hello. You may have forgotten to update the changelog!
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #819 +/- ##
===========================================
- Coverage 98.58% 87.57% -11.01%
===========================================
Files 114 73 -41
Lines 18064 11368 -6696
===========================================
- Hits 17808 9956 -7852
- Misses 256 1412 +1156 ☔ View full report in Codecov by Sentry. |
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.
So this seed is only used for the measure
RNG. Is that intended? Otherwise looks good to me, but please update the change log.
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.
Hmm... SetDevicePRNG
is a virtual function with default impl. The first method of this kind in the QuantumDevice
API.
/home/runner/work/pennylane-lightning/pennylane-lightning/Build/pennylane_lightning/core/src/simulators/lightning_kokkos/catalyst/include/QuantumDevice.hpp:125:46: error: unused parameter ‘gen’ [-Werror=unused-parameter]
125 | virtual void SetDevicePRNG(std::mt19937 *gen){};
You need to use [[maybe_unused]]
for gen
to get all actions PASS.
pennylane_lightning/core/src/simulators/lightning_kokkos/catalyst/LightningKokkosSimulator.hpp
Outdated
Show resolved
Hide resolved
pennylane_lightning/core/src/simulators/lightning_kokkos/catalyst/LightningKokkosSimulator.cpp
Show resolved
Hide resolved
This is intended (sampling could not be seeded from the catalyst repo as it is done through |
This should be updated in the catalyst repo I assume? Not that familiar with how the two repos see each other but seems like |
… to uniform C-style initialization
…pennylane-lightning into update_catalyst_kokkos_seed
This is because not all devices can be seeded, so in the device base class we need to supply a default implementation of doing nothing, and let the seedable devices override them. |
…evice.hpp/SetDevicePRNG(std::mt19937 *gen)` as `[[maybe_unused]]`, as some devices (e.g. openqasm and oqc) do not support seeding has this argument has no effect in the default implementation of this setter. At a more superficial level, this is to make the tests in PennyLaneAI/pennylane-lightning#819 pass.
…antumDevice.hpp/SetDevicePRNG()` (#963) **Context:** Marking the `std::mt19937 *gen` argument in `runtime/include/QuantumDevice.hpp/SetDevicePRNG(std::mt19937 *gen)` as `[[maybe_unused]]`, as some devices (e.g. openqasm and oqc) do not support seeding and this argument has no effect in the default implementation of this setter. At a more superficial level, this is to make the tests in PennyLaneAI/pennylane-lightning#819 pass.
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.
Thanks @paul0403 ! LGTM.
pennylane_lightning/core/src/simulators/lightning_kokkos/catalyst/LightningKokkosSimulator.hpp
Show resolved
Hide resolved
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.
LGTM, thanks @paul0403 .
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.
🙌
Context:
The lightning kokkos files in the Catalyst repo has changed since #770. We make a small update to track these changes.
The Catalyst PR that made the changes added seeding to qjit: PennyLaneAI/catalyst#936
Description of the Change:
Benefits: unblocks kokkos with catalyst
Possible Drawbacks:
Related GitHub Issues: