-
Notifications
You must be signed in to change notification settings - Fork 634
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
Wrapping of legacy device automatically in various device creation/qnode/execute functions #6046
Conversation
Co-authored-by: Mudit Pandey <[email protected]>
…LaneAI/pennylane into legacy-device-facade-class
Co-authored-by: Mudit Pandey <[email protected]>
Co-authored-by: Mudit Pandey <[email protected]>
…a device, addressed more codecov issues
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.
LGTM! Impressive work! 🚀
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.
Finally getting this across the finish line! Thanks for the changes and for the dev comments.
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.
Fantastic job on a rather difficult piece of work. I am excited to have finally reached this threshold in a very, very long process. This is going to make development of the workflow much easier going forward, and unlock a lot of technical improvements and code quality possibilities.
…ots (#839) **Context:** PR PennyLaneAI/pennylane#6046 wraps the legacy device API automatically in various device creation, qnode, and execute functions. As LK and LGPU plugins still rely on the legacy device API, the shots tests and the `generate_samples` logic in `lightning_kokkos.py` and `lightning_gpu.py` should be updated to adhere the new convention. **Related Shortcut Stories:** [sc-65998] --------- Co-authored-by: ringo-but-quantum <[email protected]> Co-authored-by: Shiro-Raven <[email protected]> Co-authored-by: albi3ro <[email protected]>
…ots (#839) **Context:** PR PennyLaneAI/pennylane#6046 wraps the legacy device API automatically in various device creation, qnode, and execute functions. As LK and LGPU plugins still rely on the legacy device API, the shots tests and the `generate_samples` logic in `lightning_kokkos.py` and `lightning_gpu.py` should be updated to adhere the new convention. **Related Shortcut Stories:** [sc-65998] --------- Co-authored-by: ringo-but-quantum <[email protected]> Co-authored-by: Shiro-Raven <[email protected]> Co-authored-by: albi3ro <[email protected]>
…legacy device for MPI LGPU (#864) ### Before submitting Please complete the following checklist when submitting a PR: - [x] 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! - [x] 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`. - [x] 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:** - PR PennyLaneAI/pennylane#6021 removed code duplication for `BasisEmbedding` and `BasisState`. As the result `BasisState` no longer decomposes to `BasisStatePreparation`. This PR updates Python unit tests to support this generalization of basis state preparation. - PR PennyLaneAI/pennylane#6046 added a facade wrapper class for "legacy" devices. This PR is a follow up to PR #839 updating Multi-GPU LGPU device and tests. **Description of the Change:** **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** --------- Co-authored-by: ringo-but-quantum <[email protected]>
…acade (#1035) **Context:** This PR is to fix an issue that will be caused after merging the following PR: PennyLaneAI/pennylane#6046 The problem is that LegacyDeviceFacade will cause the Legacy Devices to use the Shots class instead of an integer which causes a crash in runtime. **Description of the Change:** This PR ensures that the any device that is an instance of the new device API uses the shots class to extract the total number of shots. **Related GitHub Issues:** [sc-70792] --------- Co-authored-by: Ahmed Darwish <[email protected]>
…ots (#839) **Context:** PR PennyLaneAI/pennylane#6046 wraps the legacy device API automatically in various device creation, qnode, and execute functions. As LK and LGPU plugins still rely on the legacy device API, the shots tests and the `generate_samples` logic in `lightning_kokkos.py` and `lightning_gpu.py` should be updated to adhere the new convention. **Related Shortcut Stories:** [sc-65998] --------- Co-authored-by: ringo-but-quantum <[email protected]> Co-authored-by: Shiro-Raven <[email protected]> Co-authored-by: albi3ro <[email protected]>
…legacy device for MPI LGPU (#864) ### Before submitting Please complete the following checklist when submitting a PR: - [x] 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! - [x] 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`. - [x] 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:** - PR PennyLaneAI/pennylane#6021 removed code duplication for `BasisEmbedding` and `BasisState`. As the result `BasisState` no longer decomposes to `BasisStatePreparation`. This PR updates Python unit tests to support this generalization of basis state preparation. - PR PennyLaneAI/pennylane#6046 added a facade wrapper class for "legacy" devices. This PR is a follow up to PR #839 updating Multi-GPU LGPU device and tests. **Description of the Change:** **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** --------- Co-authored-by: ringo-but-quantum <[email protected]>
…ode/execute functions (#6046) **Context:** With the `LegacyDeviceFacade` now in place, we can add automatic wrapping of legacy devices. **Description of the Change:** Add automatic wrapping to `qml.device`, `qml.execute`, `QNode` constructor, and the `get_best_method` and `best_method_str` functions of the QNode class. The tests are also updated accordingly. **Benefits:** Users no longer need to worry about upgrading their devices to the new Device API and can use the facade to access the basic functions of the new API. **Possible Drawbacks:** The facade doesn't yet provide all potential advantages of fully upgrading to the new API [[sc-65998](https://app.shortcut.com/xanaduai/story/65998)] --------- Co-authored-by: albi3ro <[email protected]> Co-authored-by: Christina Lee <[email protected]> Co-authored-by: Mudit Pandey <[email protected]> Co-authored-by: ringo-but-quantum <[email protected]> Co-authored-by: David Wierichs <[email protected]> Co-authored-by: Thomas R. Bromley <[email protected]> Co-authored-by: Korbinian Kottmann <[email protected]>
Context:
With the
LegacyDeviceFacade
now in place, we can add automatic wrapping of legacy devices.Description of the Change:
Add automatic wrapping to
qml.device
,qml.execute
,QNode
constructor, and theget_best_method
andbest_method_str
functions of the QNode class. The tests are also updated accordingly.Benefits:
Users no longer need to worry about upgrading their devices to the new Device API and can use the facade to access the basic functions of the new API.
Possible Drawbacks:
The facade doesn't yet provide all potential advantages of fully upgrading to the new API
[sc-65998]