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

Optimize gate cache recording for lightning.tensor #879

Merged
merged 9 commits into from
Aug 30, 2024

Conversation

multiphaseCFD
Copy link
Member

@multiphaseCFD multiphaseCFD commented Aug 29, 2024

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:

[SC-72517]

Current implementation of applyOperation avoid the overhead of a cutensornetStateUpdateTensorOperator call and the creation of a new DataBuffer object. A new gate_ids_ private data is added for the quick generation of a new key, which does not exist in the gate_cache.

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

Copy link
Contributor

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.

@multiphaseCFD multiphaseCFD changed the title Update lightning.tensor gate cache access mode Optimize lightning.tensor gate cache access mode Aug 29, 2024
@multiphaseCFD multiphaseCFD marked this pull request as ready for review August 29, 2024 20:09
@multiphaseCFD multiphaseCFD changed the title Optimize lightning.tensor gate cache access mode Optimize gate cache recording for lightning.tensor Aug 29, 2024
Copy link

codecov bot commented Aug 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.13%. Comparing base (756eb7b) to head (ba39cb7).
Report is 79 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (756eb7b) and HEAD (ba39cb7). Click for more details.

HEAD has 40 uploads less than BASE
Flag BASE (756eb7b) HEAD (ba39cb7)
48 8
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #879       +/-   ##
===========================================
- Coverage   98.35%   85.13%   -13.22%     
===========================================
  Files         117       59       -58     
  Lines       19405     5154    -14251     
===========================================
- Hits        19086     4388    -14698     
- Misses        319      766      +447     

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

Copy link
Member

@maliasadi maliasadi left a comment

Choose a reason for hiding this comment

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

Nice improvement! 💯

Copy link
Contributor

@LuisAlfredoNu LuisAlfredoNu left a comment

Choose a reason for hiding this comment

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

LGTM Thank you @multiphaseCFD. Just a few comments

…a/TNCudaBase.hpp

Co-authored-by: Luis Alfredo Nuñez Meneses <alfredo.nunez@xanadu.ai>
Copy link
Contributor

@LuisAlfredoNu LuisAlfredoNu left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you @multiphaseCFD just one last comment 😄

…a/TNCudaBase.hpp

Co-authored-by: Luis Alfredo Nuñez Meneses <alfredo.nunez@xanadu.ai>
@multiphaseCFD multiphaseCFD merged commit b9d3334 into master Aug 30, 2024
71 of 72 checks passed
@multiphaseCFD multiphaseCFD deleted the update_gatecache_access_ltensor branch August 30, 2024 18:12
multiphaseCFD added a commit that referenced this pull request Sep 5, 2024
### 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`](../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`.

- [x] Add a new entry to the `.github/CHANGELOG.md` file, summarizing
the
      change, and including a link back to the PR.

- [x] 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:**

[SC-72517]

Current implementation of `applyOperation` avoid the overhead of a
`cutensornetStateUpdateTensorOperator` call and the creation of a new
`DataBuffer` object. A new `gate_ids_` private data is added for the
quick generation of a new key, which does not exist in the `gate_cache`.

**Description of the Change:**

**Benefits:**

**Possible Drawbacks:**

**Related GitHub Issues:**

---------

Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai>
Co-authored-by: Luis Alfredo Nuñez Meneses <alfredo.nunez@xanadu.ai>
multiphaseCFD added a commit that referenced this pull request Sep 8, 2024
### 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`](../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`.

- [x] Add a new entry to the `.github/CHANGELOG.md` file, summarizing
the
      change, and including a link back to the PR.

- [x] 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:**

[SC-72517]

Current implementation of `applyOperation` avoid the overhead of a
`cutensornetStateUpdateTensorOperator` call and the creation of a new
`DataBuffer` object. A new `gate_ids_` private data is added for the
quick generation of a new key, which does not exist in the `gate_cache`.

**Description of the Change:**

**Benefits:**

**Possible Drawbacks:**

**Related GitHub Issues:**

---------

Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai>
Co-authored-by: Luis Alfredo Nuñez Meneses <alfredo.nunez@xanadu.ai>
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.

5 participants