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

Added pickle support for lightning.gpu device's DevPool attribute #772

Merged
merged 18 commits into from
Jun 26, 2024

Conversation

Jaybsoni
Copy link
Contributor

Context:
Allowing the qml.device("lightning.gpu", wires=...)._dp argument, which is a python DevPools() object to be pickle-able through the C++ layer.

Description of the Change:

  • Updated Devpools object to have a refresh() method
  • Updated TSQueue to have a clear method
  • Add bindings for pickle to DevPool

@Jaybsoni Jaybsoni added the WIP Work-in-progress issue. Not for general fixing. label Jun 20, 2024
@Jaybsoni Jaybsoni requested review from mlxd and soranjh June 20, 2024 19:40
@Jaybsoni
Copy link
Contributor Author

[sc-66035]

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.

Copy link

codecov bot commented Jun 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.48%. Comparing base (042fa7c) to head (1a9baee).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #772      +/-   ##
==========================================
+ Coverage   90.30%   98.48%   +8.17%     
==========================================
  Files          81      109      +28     
  Lines       11360    15801    +4441     
==========================================
+ Hits        10259    15562    +5303     
+ Misses       1101      239     -862     

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

@Jaybsoni Jaybsoni removed the WIP Work-in-progress issue. Not for general fixing. label Jun 20, 2024
@Jaybsoni Jaybsoni changed the title [WIP] Added pickle support for lightning.gpu device's DevPool attribute Added pickle support for lightning.gpu device's DevPool attribute Jun 20, 2024
tests/test_device.py Outdated Show resolved Hide resolved
@Jaybsoni Jaybsoni requested a review from mlxd June 21, 2024 20:02
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.

No blockers from me --- thanks @Jaybsoni

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.

Thanks @Jaybsoni! I have a few suggestions and a question. I will approve when you address them and update the changelog.

tests/test_device.py Outdated Show resolved Hide resolved
tests/test_device.py Show resolved Hide resolved
@maliasadi maliasadi added the ci:build_wheels Activate wheel building. label Jun 21, 2024
Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
@Jaybsoni Jaybsoni requested a review from maliasadi June 21, 2024 21:08
@maliasadi
Copy link
Member

@Jaybsoni Could you update the changelog by adding an entry for this PR and your name to the list of contributors?

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.

One more suggestion with the latest changes. Looks good to me otherwise 🎉

.github/CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
@Jaybsoni Jaybsoni merged commit 84b5da5 into master Jun 26, 2024
107 of 111 checks passed
@Jaybsoni Jaybsoni deleted the pickle_devpools branch June 26, 2024 16:27
vincentmr pushed a commit that referenced this pull request Jun 27, 2024
…772)

**Context:**
Allowing the `qml.device("lightning.gpu", wires=...)._dp` argument,
which is a python `DevPools()` object to be pickle-able through the C++
layer.

**Description of the Change:**
- Updated Devpools object to have a `refresh()` method
- Updated TSQueue to have a clear method
- Add bindings for pickle to DevPool

---------

Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai>
Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:build_wheels Activate wheel building.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants