amazon-braket-sdk-python icon indicating copy to clipboard operation
amazon-braket-sdk-python copied to clipboard

Speed up `AwsDevice.get_devices()` call if possible

Open vtomole opened this issue 2 years ago • 1 comments

Describe the feature you'd like This call takes about ~18 seconds on our local machines with our accounts

191565600-ccb2dc87-6f06-4e46-8186-22206460c06d

How would this feature be used? Please describe. Performance improvements are always a win.

Describe alternatives you've considered We implemented a version of get_devices internally that hard-coded the execution windows but this is not too practical because we constantly have to monitor and update the windows when they do change.

vtomole avatar Sep 21 '22 21:09 vtomole

Thanks for raising! It looks like a lot of the latency is coming from the initialization of AwsDevice objects, specifically around the get_device service call for some of the annealing QPUs with large topology graphs. Filtering by status "ONLINE" should help somewhat, but there is still optimization that can be done to speed this up. Thank you for bringing it to our attention

ajberdy avatar Sep 21 '22 21:09 ajberdy

Hi vtomole,

Just FYI, we recently changed the default functionality for this function to no longer return devices that have been marked as "RETIRED". While this is not as good as filtering by "ONLINE" status that ajberdy mentioned, it has improved the performance of the default call by about 50%, where it now runs (on my machine) in about 6s.

We hope you find this change beneficial.

krneta avatar Nov 17 '23 18:11 krneta

Please let us know if you're still facing issues around this @vtomole!

kshitijc avatar Nov 30 '23 20:11 kshitijc

This fixed it for me. Thanks!

vtomole avatar Nov 30 '23 20:11 vtomole