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 nb-tester patch to only select open plan backends #2455

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

frankharkins
Copy link
Member

This PR adds a new patch that picks the least busy backend that's also available on the open plan, regardless of which instance you're using.

We need this because we've added the test_eagle_us-east device to the instance we use for testing. The problem is that this device is always the least busy, so it'll be selected when we're doing our hardware runs. We can't just switch to the open instance for this test because I'm regularly out of credits and the priority is too low to run all the jobs in our time window.

Copy link
Collaborator

@arnaucasau arnaucasau left a comment

Choose a reason for hiding this comment

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

Nice! It's so cool how easy it is to add a new patch with the new interface!

Copy link
Collaborator

@emilkovacev emilkovacev 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 to me! I added a small optional comment.

QiskitRuntimeService._original_least_busy = QiskitRuntimeService.least_busy

def patched_least_busy(self, *args, **kwargs):
open_backends = [b.name for b in self.backends(instance="ibm-q/open/main")]
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could parametrize the "instance" variable to make this patch more reusable

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! I did consider that, but I couldn't think of a scenario where we'd want to select from a different instance. I'm gonna leave it as-is for now, but happy to add that feature whenever the need arises.

@frankharkins frankharkins added this pull request to the merge queue Dec 10, 2024
Merged via the queue into main with commit bc5f48c Dec 10, 2024
3 checks passed
@frankharkins frankharkins deleted the FH/new-patch branch December 10, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants