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

Remove provider-specific fake backends,FakeProvider class and related tools in 1.0 #11376

Merged
merged 15 commits into from
Feb 2, 2024

Conversation

ElePT
Copy link
Contributor

@ElePT ElePT commented Dec 6, 2023

Summary

(2/2) --> This is the last PR of the second step of the FakeBackends refactoring epic, it removes the snapshot-dependent fake backends as well as the fake provider. The corresponding deprecation PR will follow on the 0.46 branch -> #11381.

Details and comments

On hold until:

are merged.

@ElePT ElePT added the on hold Can not fix yet label Dec 6, 2023
@ElePT ElePT added this to the 1.0.0 milestone Dec 7, 2023
@ElePT ElePT added the Changelog: Removal Include in the Removed section of the changelog label Dec 7, 2023
@ElePT ElePT changed the title Remove provider-specific fake backends, fake provider and related tools in 1.0 Remove provider-specific fake backends,FakeProvider class and related tools in 1.0 Dec 7, 2023
@ElePT ElePT marked this pull request as ready for review January 16, 2024 09:24
@ElePT ElePT requested review from jyu00 and a team as code owners January 16, 2024 09:24
@qiskit-bot
Copy link
Collaborator

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

  • @Qiskit/terra-core

wshanks added a commit to wshanks/qiskit-experiments that referenced this pull request Jan 23, 2024
The IBM-specific fake backends in Qiskit are being removed in Qiskit 1.0
in Qiskit/qiskit#11376. The same fake backends
have been moved to qiskit-ibm-runtime in
Qiskit/qiskit-ibm-runtime#1140 and follow up
PRs.

Here the `qiskit` imports are replaced with `qiskit-ibm-runtime` imports
in order to provide a smooth transition between Qiskit 0.45 and Qiskit
1.0. In the future, it may be preferable to use generic fake backends
maintained in the repo and not depend on `qiskit-ibm-runtime` for them.
wshanks added a commit to wshanks/qiskit-experiments that referenced this pull request Jan 23, 2024
The IBM-specific fake backends in Qiskit are being removed in Qiskit 1.0
in Qiskit/qiskit#11376. The same fake backends
have been moved to qiskit-ibm-runtime in
Qiskit/qiskit-ibm-runtime#1140 and follow up
PRs.

Here the `qiskit` imports are replaced with `qiskit-ibm-runtime` imports
in order to provide a smooth transition between Qiskit 0.45 and Qiskit
1.0. In the future, it may be preferable to use generic fake backends
maintained in the repo and not depend on `qiskit-ibm-runtime` for them.

Additionally, this commit reorders the requirements-dev.txt file so it
is easier to read and adds qiskit-ibm-runtime as a development
dependency.
wshanks added a commit to wshanks/qiskit-experiments that referenced this pull request Jan 25, 2024
The IBM-specific fake backends in Qiskit are being removed in Qiskit 1.0
in Qiskit/qiskit#11376. The same fake backends
have been moved to qiskit-ibm-runtime in
Qiskit/qiskit-ibm-runtime#1140 and follow up
PRs.

Here the `qiskit` imports are replaced with `qiskit-ibm-runtime` imports
in order to provide a smooth transition between Qiskit 0.45 and Qiskit
1.0. In the future, it may be preferable to use generic fake backends
maintained in the repo and not depend on `qiskit-ibm-runtime` for them.

Additionally, this commit reorders the requirements-dev.txt file so it
is easier to read and adds qiskit-ibm-runtime as a development
dependency.
wshanks added a commit to wshanks/qiskit-experiments that referenced this pull request Jan 25, 2024
The IBM-specific fake backends in Qiskit are being removed in Qiskit 1.0
in Qiskit/qiskit#11376. The same fake backends
have been moved to qiskit-ibm-runtime in
Qiskit/qiskit-ibm-runtime#1140 and follow up
PRs.

Here the `qiskit` imports are replaced with `qiskit-ibm-runtime` imports
in order to provide a smooth transition between Qiskit 0.45 and Qiskit
1.0. In the future, it may be preferable to use generic fake backends
maintained in the repo and not depend on `qiskit-ibm-runtime` for them.

Additionally, this commit reorders the requirements-dev.txt file so it
is easier to read and adds qiskit-ibm-runtime as a development
dependency.
wshanks added a commit to wshanks/qiskit-experiments that referenced this pull request Jan 25, 2024
The IBM-specific fake backends in Qiskit are being removed in Qiskit 1.0
in Qiskit/qiskit#11376. The same fake backends
have been moved to qiskit-ibm-runtime in
Qiskit/qiskit-ibm-runtime#1140 and follow up
PRs.

Here the `qiskit` imports are replaced with `qiskit-ibm-runtime` imports
in order to provide a smooth transition between Qiskit 0.45 and Qiskit
1.0. In the future, it may be preferable to use generic fake backends
maintained in the repo and not depend on `qiskit-ibm-runtime` for them.

Additionally, this commit reorders the requirements-dev.txt file so it
is easier to read and adds qiskit-ibm-runtime as a development
dependency.
wshanks added a commit to wshanks/qiskit-experiments that referenced this pull request Jan 26, 2024
The IBM-specific fake backends in Qiskit are being removed in Qiskit 1.0
in Qiskit/qiskit#11376. The same fake backends
have been moved to qiskit-ibm-runtime in
Qiskit/qiskit-ibm-runtime#1140 and follow up
PRs.

Here the `qiskit` imports are replaced with `qiskit-ibm-runtime` imports
in order to provide a smooth transition between Qiskit 0.45 and Qiskit
1.0. In the future, it may be preferable to use generic fake backends
maintained in the repo and not depend on `qiskit-ibm-runtime` for them.

Additionally, this commit reorders the requirements-dev.txt file so it
is easier to read and adds qiskit-ibm-runtime as a development
dependency.
wshanks added a commit to wshanks/qiskit-experiments that referenced this pull request Jan 26, 2024
The IBM-specific fake backends in Qiskit are being removed in Qiskit 1.0
in Qiskit/qiskit#11376. The same fake backends
have been moved to qiskit-ibm-runtime in
Qiskit/qiskit-ibm-runtime#1140 and follow up
PRs.

Here the `qiskit` imports are replaced with `qiskit-ibm-runtime` imports
in order to provide a smooth transition between Qiskit 0.45 and Qiskit
1.0. In the future, it may be preferable to use generic fake backends
maintained in the repo and not depend on `qiskit-ibm-runtime` for them.

Additionally, this commit reorders the requirements-dev.txt file so it
is easier to read and adds qiskit-ibm-runtime as a development
dependency.
@ElePT ElePT force-pushed the remove-fake-backends branch from 78cb3f3 to b6d5aa6 Compare February 1, 2024 10:46
@ElePT ElePT requested a review from nonhermitian as a code owner February 1, 2024 10:46
@ElePT ElePT removed the on hold Can not fix yet label Feb 1, 2024
@ElePT
Copy link
Contributor Author

ElePT commented Feb 1, 2024

All the blocking PRs have been merged 🎉 . And the conflicts have been fixed, so removing the on hold label.

@ElePT ElePT force-pushed the remove-fake-backends branch from b6d5aa6 to 511e90c Compare February 1, 2024 10:51
@coveralls
Copy link

coveralls commented Feb 1, 2024

Pull Request Test Coverage Report for Build 7749096260

  • 0 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 138 unchanged lines in 6 files lost coverage.
  • Overall coverage decreased (-0.2%) to 89.164%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 93.81%
qiskit/providers/models/backendproperties.py 1 94.82%
qiskit/providers/models/pulsedefaults.py 4 96.46%
crates/qasm2/src/lex.rs 7 90.93%
crates/qasm2/src/parse.rs 18 96.23%
qiskit/providers/fake_provider/fake_backend.py 107 39.13%
Totals Coverage Status
Change from base Build 7749016482: -0.2%
Covered Lines: 58792
Relevant Lines: 65937

💛 - Coveralls

@ElePT ElePT requested review from eggerdj and wshanks as code owners February 1, 2024 18:52
kevinhartman
kevinhartman previously approved these changes Feb 1, 2024
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! 😁

mtreinish
mtreinish previously approved these changes Feb 1, 2024
mtreinish
mtreinish previously approved these changes Feb 1, 2024
@jakelishman jakelishman disabled auto-merge February 1, 2024 23:21
The underlying cause of the windows failures were actually much larger
performance issues in aer's `NoiseModel.from_backend()` constructor
method when run with a BackendV2 instance. This is causing the
`NoiseModel` construction for `GenericBackendV2` to take a great deal of
time and use up all the memory we have available in the windows VMs in
CI. To avoid this issue in the short term until a fix can be added to
aer this commit just limits the size of the backend v2 examples we run
to prevent resources problems in CI.
mtreinish
mtreinish previously approved these changes Feb 1, 2024
The aer noise model construction was an artifact of using all to all
connectivity in the test. Using a more sparse connectivity alleviates
the performance issues. This commit switches to use a ring graph and
restores the larger qubit count backends.
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Ok, this is the one.

@jakelishman
Copy link
Member

jakelishman commented Feb 1, 2024

For posterity: we saw Azure went out of memory twice on Windows with Python 3.8 during attempts to merge this, which made us suspicious, but we thought it might just be Windows nonsense, so were going to skip it on Windows and sort it out later. The we found the test.python.providers.test_fake_backends file was taking nearly 10 minutes on my (not especially powerful) Windows machine, ~6 minutes on my Mac, and Matt's Linux box was taking a lot longer than normal too, so it was more than that.

We found that it was spending all the time in Aer building the noise model, which at first we thought was just inefficiencies in Aer (we used to build the noise model in house in the old fake backends) and were going to limit the tests to only 5q and 7q devices to sort it out on Aer.

Then we realised that it's spending all the time in the noise model because the GenericBackendV2(num_qubits=...) instances we were constructing to parametrise the tests over default to all-to-all coupling maps, which means that the noise-model construction is quadratic in the number of qubits (as well as Aer's calcs of it being not very efficient). The proper fix for us is to limit the connectivity of the devices under test (and probably in the future to improve Aer's handling of noise models).

The test in question was test.python.providers.test_fake_backends.TestFakeBackends.test_circuit_on_fake_backend_v2, though the problems really arose from the parametrisation of that test.

@mtreinish mtreinish merged commit 84f0d9b into Qiskit:main Feb 2, 2024
12 checks passed
github-merge-queue bot pushed a commit to qiskit-community/qiskit-experiments that referenced this pull request Feb 2, 2024
#1369)

The IBM-specific fake backends in Qiskit are being removed in Qiskit 1.0
in Qiskit/qiskit#11376. The same fake backends
have been moved to qiskit-ibm-runtime in
Qiskit/qiskit-ibm-runtime#1140 and follow up
PRs.

Here the `qiskit` imports are replaced with `qiskit-ibm-runtime` imports
in order to provide a smooth transition between Qiskit 0.45 and Qiskit
1.0. In the future, it may be preferable to use generic fake backends
maintained in the repo and not depend on `qiskit-ibm-runtime` for them.

Additionally, this commit reorders the requirements-dev.txt file so it
is easier to read and adds qiskit-ibm-runtime as a development
dependency. It also temporarily pins qiskit to 0.45 while other
deprecations are addressed.
github-merge-queue bot pushed a commit to qiskit-community/qiskit-experiments that referenced this pull request Feb 2, 2024
#1369)

The IBM-specific fake backends in Qiskit are being removed in Qiskit 1.0
in Qiskit/qiskit#11376. The same fake backends
have been moved to qiskit-ibm-runtime in
Qiskit/qiskit-ibm-runtime#1140 and follow up
PRs.

Here the `qiskit` imports are replaced with `qiskit-ibm-runtime` imports
in order to provide a smooth transition between Qiskit 0.45 and Qiskit
1.0. In the future, it may be preferable to use generic fake backends
maintained in the repo and not depend on `qiskit-ibm-runtime` for them.

Additionally, this commit reorders the requirements-dev.txt file so it
is easier to read and adds qiskit-ibm-runtime as a development
dependency. It also temporarily pins qiskit to 0.45 while other
deprecations are addressed.
github-merge-queue bot pushed a commit to qiskit-community/qiskit-experiments that referenced this pull request Feb 3, 2024
This change adjusts for several remaining changes in Qiskit 1.0:

* qiskit.providers.basicaer was removed in Qiskit 1.0 (see
Qiskit/qiskit#11422). Here its use is replaced
with qiskit-aer.

* `qiskit.providers.fake_provider.FakeJob` was removed in Qiskit 1.0
(see Qiskit/qiskit#11376). Here the `FakeJob`
already in `qiskit_experiments.test` is used instead. This update was
missed in f22bb7b which switched the
other `fake_provider` usage.

* Replace `qiskit.provider.FakeProvider` with a custom subclass of
`ProviderV1`. `FakeProvider` was moved out of Qiskit 1.0 to
qiskit-ibm-runtime.

* `calibration/test_rabi.py` was modified to make the data for a test of
bad data worse as the test started fitting the data as good with the
original parameters and qiskit-aer in place of basicaer.

* In the readout mitigation manual, a use of `plot_histogram` was
exchanged for one of `plot_distribution`.

* Guard `FakeBackendV2` import that was removed in Qiskit 1.0. Try to
import `FakeBackendV2` from qiskit-ibm-runtime as well.

Also, this change unpins qiskit which had to be pinned in
f22bb7b until these fixes could be
merged since 0.46.0 was released with deprecation warnings for some of
the usage changed here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Removal Include in the Removed section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants