From f158512f3a396c6265b14412b90847f8530c5d19 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 1 Feb 2024 18:22:17 -0500 Subject: [PATCH] Revert windows skip and limit v2 backend size 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. --- test/python/providers/test_fake_backends.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/python/providers/test_fake_backends.py b/test/python/providers/test_fake_backends.py index 2d822370d71c..ad6dee8b3450 100644 --- a/test/python/providers/test_fake_backends.py +++ b/test/python/providers/test_fake_backends.py @@ -16,7 +16,6 @@ import datetime import itertools import operator -import platform import unittest from test import combine @@ -80,7 +79,8 @@ BACKENDS = [Fake5QV1(), Fake20QV1(), Fake7QPulseV1(), Fake27QPulseV1(), Fake127QPulseV1()] BACKENDS_V2 = [] -for n in [5, 7, 16, 20, 27, 65, 127]: +# NOTE: Do not go any larger to avoid noise model construction performance issues +for n in [5, 7]: BACKENDS_V2.append(GenericBackendV2(num_qubits=n)) @@ -105,11 +105,10 @@ def setUpClass(cls): def test_circuit_on_fake_backend_v2(self, backend, optimization_level): if not optionals.HAS_AER and backend.num_qubits > 20: self.skipTest("Unable to run fake_backend %s without qiskit-aer" % backend.name) - if optionals.HAS_AER and platform.system() == "Windows": - self.skipTest("Skipping this test to workaround issues with aer on Windows.") job = backend.run( - transpile(self.circuit, backend, seed_transpiler=42), - optimization_level=optimization_level, + transpile( + self.circuit, backend, seed_transpiler=42, optimization_level=optimization_level + ), seed_simulator=42, ) result = job.result() @@ -130,8 +129,9 @@ def test_circuit_on_fake_backend(self, backend, optimization_level): % backend.configuration().backend_name ) job = backend.run( - transpile(self.circuit, backend, seed_transpiler=42), - optimization_level=optimization_level, + transpile( + self.circuit, backend, seed_transpiler=42, optimization_level=optimization_level + ), seed_simulator=42, ) result = job.result()