-
Notifications
You must be signed in to change notification settings - Fork 42
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
Prevent reallocation of aligned memory #572
Conversation
Hello. You may have forgotten to update the changelog!
|
…lightning into improve_lq_memory
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #572 +/- ##
==========================================
+ Coverage 98.48% 99.06% +0.57%
==========================================
Files 167 201 +34
Lines 24531 29361 +4830
==========================================
+ Hits 24159 29086 +4927
+ Misses 372 275 -97 ☔ View full report in Codecov by Sentry. |
…lightning into improve_lq_memory
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 @mlxd! Looks good to go 🦖
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.
Looks good to me! Thanks @mlxd !
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: To ensure the memory allocated by Lightning is always aligned, and usable by the dispatcher AVX kernels, we must avoid any potential numpy-layer reallocations. This PR extends the aligned allocator functions bound through Pybind11 to allow data to be initialized and set for use. This avoids us needing to perform potential numpy casts, which could potentially reallocate the data. As a result, this removes overheads observed with lightning.qubit workloads depending on the need to handle multiple resets/allocations.
Description of the Change: As above.
Benefits: Removes unneeded overheads from lightning.qubit, and redundant imports from LG/LK
Possible Drawbacks:
Related GitHub Issues: