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

Remove allocations for better performance from Python, cleanup #48

Merged
merged 13 commits into from
Aug 27, 2024

Conversation

kshyatt-aws
Copy link
Member

Issue #, if available: N/A

Description of changes: Makes writing to JSON substantially faster for big statevectors/density matrices. Cleaned up a lot of internal allocations in the gate kernels. Benchmarked from Python and seeing speedups now comparable to what we see from Julia.

Testing done: Unit tests passed locally.

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@kshyatt-aws kshyatt-aws requested a review from a team as a code owner August 26, 2024 19:42
Copy link

codecov bot commented Aug 26, 2024

Codecov Report

Attention: Patch coverage is 99.53052% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.03%. Comparing base (598c8b6) to head (6ac6f08).
Report is 1 commits behind head on main.

Files Patch % Lines
...aketSimulatorPythonExt/BraketSimulatorPythonExt.jl 96.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #48      +/-   ##
==========================================
+ Coverage   98.88%   99.03%   +0.15%     
==========================================
  Files          23       23              
  Lines        3216     3304      +88     
==========================================
+ Hits         3180     3272      +92     
+ Misses         36       32       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

rmshaffer
rmshaffer previously approved these changes Aug 27, 2024
src/gate_kernels.jl Outdated Show resolved Hide resolved
Co-authored-by: Ryan Shaffer <[email protected]>
@kshyatt-aws kshyatt-aws merged commit 579a0b9 into main Aug 27, 2024
14 checks passed
@kshyatt-aws kshyatt-aws deleted the ksh/python branch August 27, 2024 19:37
contra-bit pushed a commit to contra-bit/BraketSimulator.jl that referenced this pull request Sep 1, 2024
…n-braket#48)

* change: Make things more inferrable

* change: Use JSON3 for writing/reading to Python

* fix: Make matrix generation less allocating

* fix: Make matrix generation less allocating for custom gates too

* fix: Handle empty/nothing targets properly

* fix: Remove timing statements

* fix: Allow subtypes of abstract result supertypes

* fix: Remove timings and add inputs to precompile

* fix: More validation tests

* change: Bump version

* fix: Semgrep

* change: More tests and a fix for DoubleExcitation

* Update src/gate_kernels.jl

Co-authored-by: Ryan Shaffer <[email protected]>

---------

Co-authored-by: Ryan Shaffer <[email protected]>
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.

2 participants