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

Fixing monitor tools #11414

Merged
merged 16 commits into from
Mar 7, 2024

Conversation

1ucian0
Copy link
Member

@1ucian0 1ucian0 commented Dec 14, 2023

The tools in qiskit.tools.monitor are a bit neglected. This PR is trying to bring them up to speed.

qiskit.tools.monitor.job_monitor

Closes #7865

job_monitor now works with RuntimeJob. JobV1 does not provide queue_position so a general job_monitor should not assume it (probably was only a thing with IBMJob. If job_monitor stays in Qiskit, it should be generic.

qiskit.tools.monitor.backend_monitor

It was not working at all, so now it works. In the future, it should work with any BackendV2 or be moved to qiskit-ibm-runtime otherwise.

from qiskit_ibm_provider import IBMProvider
from qiskit.tools.monitor import backend_monitor
provider = IBMProvider()
backend_monitor(provider.get_backend('ibm_sherbrooke'))
ibm_sherbrooke
==============
Configuration
-------------
    n_qubits: 127
    operational: True
    status_msg: active
    pending_jobs: 139
    backend_version: 1.4.28
    basis_gates: ['ecr', 'id', 'rz', 'sx', 'x']
    local: False
    simulator: False
    backend_name: ibm_sherbrooke
    qubit_channel_mapping: [['d0', 'm0'
....

qiskit.tools.monitor.backend_overview

Similarly to qiskit.tools.monitor.backend_monitor, it was not working at all, so now it works. In the future, it should take a BackendV2 or be moved to qiskit-ibm-runtime otherwise.

from qiskit.tools.monitor import backend_overview
backend_overview()

TODO:

@jakelishman
Copy link
Member

Copying in some discussion from offline:

imo these functions aren't suitable for core Qiskit; information about queue positions and reading custom downstream fields from a Job subclass shouldn't be part of the core library, since it's not part of the Job interface. I think we ought to be moving this functionality to the relevant packages, where it can be maintained and update as the custom Job subclasses changes, or as the structure of the custom information about queue position changes.

@ElePT
Copy link
Contributor

ElePT commented Dec 14, 2023

I agree with @jakelishman, moving this functionality out of qiskit would also be coherent with the changes laid out in #10266 (the fake backend epic).

@1ucian0 1ucian0 changed the title Fxing monitor tools Fixing monitor tools Dec 16, 2023
This commit deprecates the qiskit.tools module. Most of the
functionality in this module will be removed in the Qiskit 1.0.0
release. The sole exception is the qiskit.tools.parallel module and it's
associated public function qiskit.tools.parallel_map which has been
moved to qiskit.utils.
@1ucian0 1ucian0 force-pushed the deprecate/backend_overview/1 branch from 9083f29 to 5e16db2 Compare January 10, 2024 11:07
@1ucian0 1ucian0 changed the base branch from main to stable/0.46 January 10, 2024 11:08
@1ucian0
Copy link
Member Author

1ucian0 commented Jan 10, 2024

It makes total sense what you are both saying.

I changed the base to stable/0.46 and I will add the deprecation warnings.

@jakelishman
Copy link
Member

Best check overlap with some of Matt's recent PRs - #11513 and #11514 might cover these deprecations.

@1ucian0 1ucian0 added this to the 0.46.0 milestone Jan 10, 2024
@1ucian0 1ucian0 added the on hold Can not fix yet label Jan 30, 2024
@1ucian0
Copy link
Member Author

1ucian0 commented Jan 30, 2024

I'm merging the mtreinish:deprecate-tools into this one. So blocked by #11514 (tagging on hold).

@1ucian0 1ucian0 marked this pull request as ready for review January 30, 2024 13:35
@1ucian0 1ucian0 requested review from woodsp-ibm and a team as code owners January 30, 2024 13:35
@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@jakelishman
Copy link
Member

#11514 is merged now, removing hold.

@jakelishman jakelishman removed the on hold Can not fix yet label Jan 31, 2024
@mtreinish mtreinish modified the milestones: 0.46.0, 0.46.1 Feb 1, 2024
@mtreinish
Copy link
Member

Given the timeframe for the 0.46.0 release I've deferred this to 0.46.1, it's a valid bugfix for a patch release too.

Copy link
Contributor

@kevinhartman kevinhartman 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. The changes seem low risk given that the module they address does not currently work.

@kevinhartman kevinhartman enabled auto-merge March 7, 2024 19:46
@mtreinish mtreinish added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Mar 7, 2024
@kevinhartman kevinhartman added this pull request to the merge queue Mar 7, 2024
Merged via the queue into Qiskit:stable/0.46 with commit 5a8cdc0 Mar 7, 2024
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

job_monitor fails for qiskit runtime jobs
6 participants