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

Fixed D-wave examples breaking when the Advantage_System4 is in a maintenance window #143

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JuanGiraldo0212
Copy link

Issue #117: D-Wave examples break during scheduled maintenance windows

Description of changes:

Added branching logic to find the first Advantage device available to these files:

  1. Getting_Devices_and_Checking_Device_Properties.ipynb
  2. Dwave_MinimumVertexCoverProblem.ipynb
  3. Dwave_Anatomy.ipynb
  4. Running_large_problems_using_QBSolv.ipynb

Removed the device ARN when instantiating a D-wave sampler to these files:

  1. Dwave_MaximumCut.ipynb
  2. Dwave_GraphPartitioning.ipynb
  3. Dwave_StructuralImbalance/Dwave_StructuralImbalance.ipynb

Removed unnecessary cells.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@JuanGiraldo0212 JuanGiraldo0212 requested a review from a team as a code owner April 29, 2022 22:26
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor

@christianbmadsen christianbmadsen left a comment

Choose a reason for hiding this comment

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

In cell 3 of Dwave_Anatomy.ipynb can you make the behavior of the cell graceful even in cases where no Advantage device is online?
In the same notebook the Cell 27 and onwards is broken, can you fix?

@JuanGiraldo0212
Copy link
Author

JuanGiraldo0212 commented May 10, 2022

Yes @christianbmadsen I'll fix that.

@JuanGiraldo0212 JuanGiraldo0212 force-pushed the D-Wave_examples_break_during_scheduled_maintenance_windows branch 3 times, most recently from 39b4554 to 67a59bf Compare May 10, 2022 03:11
@JuanGiraldo0212 JuanGiraldo0212 force-pushed the D-Wave_examples_break_during_scheduled_maintenance_windows branch from 67a59bf to 50bb8e6 Compare May 10, 2022 03:14
@christianbmadsen
Copy link
Contributor

@JuanGiraldo0212 were you able to take a look at the edge cases for online devices. For instance what do you want the behavior of cell 8 of Getting_Devices_and_Checking_Device_Properties.ipynb to be if no devices are ONLINE? Thanks!

@JuanGiraldo0212
Copy link
Author

Hi @christianbmadsen, yes I used this logic in the case no Advantage devices are ONLINE:

device_arns = [device.arn for device in AwsDevice.get_devices(provider_names=["D-Wave Systems"], statuses=["ONLINE"])]
adv_device_arns = list(filter(lambda arn: "Advantage" in arn, device_arns))
adv_device_arns = []
if adv_device_arns:
device = AwsDevice(adv_device_arns[0])
else:
device = AwsDevice(device_arns[0])

I used it in cell 47 of Dwave_Anatomy, let me know if this is a good fix and I will add it to the rest of the notebooks where an Advantage device is needed.

@christianbmadsen
Copy link
Contributor

@JuanGiraldo0212 I recommend we only try the intended advatage device and then handle the exception and avoid executing the remainder of the example if no advantage device is available.

@christianbmadsen
Copy link
Contributor

@JuanGiraldo0212 I recommend we only try the intended advatage device and then handle the exception and avoid executing the remainder of the example if no advantage device is available.

@JuanGiraldo0212 just wanted to checkin and see how you were planning to handle this?

@JuanGiraldo0212
Copy link
Author

Hi @christianbmadsen, sorry I haven't had chance to finish the issue. I was planning on checking if there is an advantage device available and in the case that there aren't any I would display a message asking to wait until the requested device is online to continue the example.

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.

2 participants