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

Support backprop in default.mixed device for PyTorch #2680

Merged
merged 53 commits into from
Jun 10, 2022

Conversation

eddddddy
Copy link
Contributor

@eddddddy eddddddy commented Jun 9, 2022

Context:
The third PR in a series to support backpropagation in the default.mixed device.

Description of the Change:
Now backpropagation is supported in the default.mixed device for the PyTorch interface.

Benefits:
Better integration with auto-differentiation frameworks.

Possible Drawbacks:

Related GitHub Issues:
#1528

@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2022

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.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 Jun 9, 2022

Codecov Report

Merging #2680 (2b3a574) into master (553e049) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #2680   +/-   ##
=======================================
  Coverage   99.61%   99.61%           
=======================================
  Files         251      251           
  Lines       20647    20667   +20     
=======================================
+ Hits        20567    20587   +20     
  Misses         80       80           
Impacted Files Coverage Δ
pennylane/devices/default_mixed.py 100.00% <100.00%> (ø)
pennylane/math/single_dispatch.py 99.04% <100.00%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 553e049...2b3a574. Read the comment docs.

@eddddddy eddddddy requested a review from antalszava June 9, 2022 15:37
Base automatically changed from mixed_backprop_tf to master June 10, 2022 02:02
Copy link
Contributor

@antalszava antalszava left a comment

Choose a reason for hiding this comment

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

Looks good @eddddddy! 🎉 🥳

One main feedback is the fact that users might not able to specify Torch devices in a versatile manner, as they would with default.qubit.torch. Having said that, it may be worth merging this as is because it should work for CPU and then another PR could address adding GPU support. This should just be documented and explained well (changelog and/or device docs).

pennylane/math/single_dispatch.py Show resolved Hide resolved
pennylane/math/single_dispatch.py Outdated Show resolved Hide resolved
pennylane/math/single_dispatch.py Outdated Show resolved Hide resolved
tests/devices/test_default_mixed_torch.py Outdated Show resolved Hide resolved
tests/devices/test_default_mixed_torch.py Show resolved Hide resolved
tests/devices/test_default_mixed_torch.py Outdated Show resolved Hide resolved
tests/devices/test_default_mixed_torch.py Show resolved Hide resolved
tests/devices/test_default_mixed_torch.py Outdated Show resolved Hide resolved
doc/releases/changelog-dev.md Outdated Show resolved Hide resolved
pennylane/math/single_dispatch.py Outdated Show resolved Hide resolved
@antalszava antalszava merged commit 6f8db28 into master Jun 10, 2022
@antalszava antalszava deleted the mixed_backprop_torch branch June 10, 2022 21:12
@antalszava
Copy link
Contributor

[sc-21103]

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.

None yet

2 participants