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

Add support for Braket Devices enums and S3 buckets #278

Merged
merged 4 commits into from Sep 19, 2023

Conversation

maliasadi
Copy link
Member

@maliasadi maliasadi commented Sep 11, 2023

Context:
This PR fixes #206 by adding support for

[sc-45094]

@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (7f019cd) 99.31% compared to head (ef4c583) 99.31%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #278   +/-   ##
=======================================
  Coverage   99.31%   99.31%           
=======================================
  Files          41       41           
  Lines        7141     7157   +16     
  Branches      377      377           
=======================================
+ Hits         7092     7108   +16     
  Misses         27       27           
  Partials       22       22           
Files Changed Coverage Δ
frontend/catalyst/pennylane_extensions.py 99.14% <100.00%> (+<0.01%) ⬆️
runtime/lib/backend/common/Utils.hpp 100.00% <100.00%> (ø)
runtime/tests/Test_LightningDriver.cpp 100.00% <100.00%> (ø)

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

Copy link
Collaborator

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

Thanks @maliasadi 🎉

Copy link
Member

@josh146 josh146 left a comment

Choose a reason for hiding this comment

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

Nice, thanks @maliasadi!

I have a separate question: your ADR on allowing devices to specifying compilation options. Would it be sufficient in allowing this logic here to not be hardcoded into the Catalyst functions?

@maliasadi
Copy link
Member Author

maliasadi commented Sep 18, 2023

I have a separate question: your ADR on allowing devices to specifying compilation options. Would it be sufficient in allowing this logic here to not be hardcoded into the Catalyst functions?

@josh146 the qml.device method can take any arbitrary keyword arguments and, we may need to embed these kwargs to the generated LLVM IR which will be parsed and used at run time by the runtime. We don't really need to hardcode these kwargs in the frontend if we can capture these kwargs or the device itself communicates these arguments. However, this issue is unique to the Braket devices at the moment and one possible solution is by simply adding a method that returns a dictionaries of device specifications. For the Braket plugin, this's device_arn and s3_destination_folder.

PS. I've included this to the ADR for re-considering it while refactoring the frontend.

@josh146
Copy link
Member

josh146 commented Sep 19, 2023

Thanks @maliasadi!

However, this issue is unique to the Braket devices at the moment and one possible solution is by simply adding a method that returns a dictionaries of device specifications. For the Braket plugin, this's device_arn and s3_destination_folder.

Over time we will run into this issue with other devices as well. Even lightning has additional options you can pass it -- e.g., for MCMC sampling:

dev = qml.device("lightning.qubit", wires=2, shots=1000, mcmc=True, kernel_name="NonZeroRandom", num_burnin=200)

@maliasadi maliasadi merged commit 2c38488 into main Sep 19, 2023
18 checks passed
@maliasadi maliasadi deleted the runtime/braket-devices-enum branch September 19, 2023 18:07
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.

The braket.qubit.aws device gives an error if you provide an S3 bucket prefix
3 participants