-
Notifications
You must be signed in to change notification settings - Fork 39
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
Optimize LQ::probs for large number of targets #807
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #807 +/- ##
==========================================
- Coverage 94.25% 92.32% -1.93%
==========================================
Files 131 73 -58
Lines 19792 11172 -8620
==========================================
- Hits 18655 10315 -8340
+ Misses 1137 857 -280 ☔ 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.
Thanks @vincentmr!
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/MeasurementsLQubit.hpp
Outdated
Show resolved
Hide resolved
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/MeasurementsLQubit.hpp
Outdated
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.
Good improvement with OPENMP
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 parallel performance of
probs
is terrible when the input has many targets. For instance with 16 OpenMP threads:Description of the Change:
Parallelize the double loop over the loop on
probs
only.Benefits:
Faster execution for any number of targets on "normal" processor (< 129 cores). I won't show a proper sweep over the number of targets because the current version is too slow to do so.
Possible Drawbacks:
"Abnormal" processors (i.e. 1024 cores) could benefit from a different parallelization strategy in certain edge cases.
Related GitHub Issues:
[sc-69165]