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

Add mutex to KernelMap Cache #382

Merged
merged 13 commits into from
Nov 2, 2022
Merged

Add mutex to KernelMap Cache #382

merged 13 commits into from
Nov 2, 2022

Conversation

chaeyeunpark
Copy link
Contributor

@chaeyeunpark chaeyeunpark commented Nov 1, 2022

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: KernelMap class provides the best kernel to use based on [number of qubits], [threading], and memory alignment. To generate the kernel information quickly, it uses an internal cache mechanism. However, this violated const correctness and raised a multithreading bug. This PR fixes this bug.

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2022

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.

@codecov
Copy link

codecov bot commented Nov 1, 2022

Codecov Report

Merging #382 (59a5089) into master (7242c1b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #382   +/-   ##
=======================================
  Coverage   99.88%   99.88%           
=======================================
  Files          49       49           
  Lines        4458     4471   +13     
=======================================
+ Hits         4453     4466   +13     
  Misses          5        5           
Impacted Files Coverage Δ
pennylane_lightning/_version.py 100.00% <100.00%> (ø)
pennylane_lightning/src/simulator/KernelMap.hpp 99.14% <100.00%> (+0.10%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@chaeyeunpark chaeyeunpark marked this pull request as ready for review November 1, 2022 21:11
@chaeyeunpark chaeyeunpark requested review from mlxd, maliasadi and AmintorDusko and removed request for maliasadi November 1, 2022 21:13
Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Thanks @chaeyeunpark
Looks good, but just a few queries before approving.

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.

Thank you, @chaeyeunpark.

Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Nice work @chaeyeunpark

@AmintorDusko
Copy link
Contributor

Please wait for PR #383 to be merged before merging this PR.

@chaeyeunpark chaeyeunpark merged commit 101eb24 into master Nov 2, 2022
@chaeyeunpark chaeyeunpark deleted the add_mutex_getkernelmap branch November 2, 2022 20:03
@chaeyeunpark
Copy link
Contributor Author

Thanks all for cool reviews!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants