-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
FakeBackends are inefficient because noise model is repeatedly built #7911
Labels
mod: fake_provider
Related to the fake_provider module and fake backends
type: enhancement
It's working, but needs polishing
Comments
mtreinish
added a commit
to mtreinish/qiskit-core
that referenced
this issue
Apr 8, 2022
This commit updates the FakeBackend and FakeBackendV2 classes (FakeLegacyBackend is being removed in Qiskit#7886) to only build a noise model from the stored properties one. This is done by initializing the internal simulator object only once at storing it as an instance attribute. The noise model is then constructed once at object initialization and used to update the backend at the same time. Fixes Qiskit#7500 Fixes Qiskit#7911
This should be fixed by: #7912 I've tagged it for backport to 0.20.1 (which will hopefully go out next week). |
mergify bot
added a commit
that referenced
this issue
Apr 19, 2022
* Initialize simulator at FakeBackend inititialization This commit updates the FakeBackend and FakeBackendV2 classes (FakeLegacyBackend is being removed in #7886) to only build a noise model from the stored properties one. This is done by initializing the internal simulator object only once at storing it as an instance attribute. The noise model is then constructed once at object initialization and used to update the backend at the same time. Fixes #7500 Fixes #7911 * Lazy load simulator backend objects and properties This commit fixes another regression introduced in the previous commit around the import and __init__ performance of fake backends. By parsing the properties payload and creating a noise model we significantly slowed down the initialization of fake backend objects. This commit fixes this by ensuring we are lazy loading the noise model and simulator object creation as well as not parsing the properties (or defaults) payloads until we actually need them. * Use qubit properties in target for backendv2 * Filter all noise model warnings Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
mergify bot
pushed a commit
that referenced
this issue
Apr 19, 2022
* Initialize simulator at FakeBackend inititialization This commit updates the FakeBackend and FakeBackendV2 classes (FakeLegacyBackend is being removed in #7886) to only build a noise model from the stored properties one. This is done by initializing the internal simulator object only once at storing it as an instance attribute. The noise model is then constructed once at object initialization and used to update the backend at the same time. Fixes #7500 Fixes #7911 * Lazy load simulator backend objects and properties This commit fixes another regression introduced in the previous commit around the import and __init__ performance of fake backends. By parsing the properties payload and creating a noise model we significantly slowed down the initialization of fake backend objects. This commit fixes this by ensuring we are lazy loading the noise model and simulator object creation as well as not parsing the properties (or defaults) payloads until we actually need them. * Use qubit properties in target for backendv2 * Filter all noise model warnings Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 57f16ab)
mergify bot
added a commit
that referenced
this issue
Apr 19, 2022
* Initialize simulator at FakeBackend inititialization This commit updates the FakeBackend and FakeBackendV2 classes (FakeLegacyBackend is being removed in #7886) to only build a noise model from the stored properties one. This is done by initializing the internal simulator object only once at storing it as an instance attribute. The noise model is then constructed once at object initialization and used to update the backend at the same time. Fixes #7500 Fixes #7911 * Lazy load simulator backend objects and properties This commit fixes another regression introduced in the previous commit around the import and __init__ performance of fake backends. By parsing the properties payload and creating a noise model we significantly slowed down the initialization of fake backend objects. This commit fixes this by ensuring we are lazy loading the noise model and simulator object creation as well as not parsing the properties (or defaults) payloads until we actually need them. * Use qubit properties in target for backendv2 * Filter all noise model warnings Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 57f16ab) Co-authored-by: Matthew Treinish <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
mod: fake_provider
Related to the fake_provider module and fake backends
type: enhancement
It's working, but needs polishing
What is the expected enhancement?
When using FakeBackends there are multiple calls to
noise_model.from_backend
that lead to hug performance hits. E.g from profiling one VQE run, 40 out of 58 seconds is just building noise models repeatedly:However, doing the building direct in Aer removes all of this overhead. Namely:
is dramatically faster.
I am guessing this is because
FakeBackend
was created before Aer had this capability.The text was updated successfully, but these errors were encountered: