-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 list argument broadcasting and simplify transpile() #10291
Merged
Commits on Jun 15, 2023
-
Remove list argument broadcasting and simplify transpile()
This commit updates the transpile() function to no longer support broadcast of lists of arguments. This functionality was deprecated in the 0.23.0 release. As part of this removal the internals of the transpile() function are simplified so we don't need to handle broadcasting, building preset pass managers, parallel dispatch, etc anymore as this functionality (without broadcasting) already exists through the transpiler API. Besides greatly simplifying the transpile() code and using more aspects of the public APIs that exist in the qiskit.transpiler module, this commit also should fix the overhead we have around parallel execution due to the complexity of supporting broadcasting. This overhead was partially addressed before in Qiskit#7789 which leveraged shared memory to minimize the serialization time necessary for IPC but by using `PassManager.run()` internally now all of that overhead is removed as the initial fork will have all the necessary context in each process from the start. Three seemingly unrelated changes made here were necessary to support our current transpile() API without building custom pass manager construction. The first is the handling of layout from intlist. The current Layout class is dependent on a circuit because it maps Qubit objects to a physical qubit index. Ideally the layout structure would just map virtual indices to physical indices (see Qiskit#8060 for a similar issue, also it's worth noting this is how the internal NLayout and QPY represent layout), but because of the existing API the construction of a Layout is dependent on a circuit. For the initial_layout argument when running with multiple circuits to avoid the need to broadcasting the layout construction for supported input types that need the circuit to lookup the Qubit objects the SetLayout pass now supports taking in an int list and will construct a Layout object at run time. This effectively defers the Layout object creation for initial_layout to run time so it can be built as a function of the circuit as the API demands. The second is the FakeBackend class used in some tests was constructing invalid backends in some cases. This wasn't caught in the previous structure because the backends were not actually being parsed by transpile() previously which masked this issue. This commit fixes that issue because PassManagerConfig.from_backend() was failing because of the invalid backend construction. The third issue is a new _skip_target private argument to generate_preset_pass_manager() and PassManagerConfig. This was necessary to recreate the behavior of transpile() when a user provides a BackendV2 and either `basis_gates` or `coupling_map` arguments. In general the internals of the transpiler treat a target as higher priority because it has more complete and restrictive constraints than the basis_gates/coupling map objects. However, for transpile() if a backendv2 is passed in for backend paired with coupling_map and/or basis_gates the expected workflow is that the basis_gates and coupling_map arguments take priority and override the equivalent attributes from the backend. To facilitate this we need to block pulling the target from the backend This should only be needed for a short period of time as when Qiskit#9256 is implemented we'll just build a single target from the arguments as needed. Fixes Qiskit#7741
Configuration menu - View commit details
-
Copy full SHA for 094fb0f - Browse repository at this point
Copy the full SHA 094fb0fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e416792 - Browse repository at this point
Copy the full SHA e416792View commit details -
Configuration menu - View commit details
-
Copy full SHA for 99ee51a - Browse repository at this point
Copy the full SHA 99ee51aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9becdfb - Browse repository at this point
Copy the full SHA 9becdfbView commit details -
Configuration menu - View commit details
-
Copy full SHA for a8b51a7 - Browse repository at this point
Copy the full SHA a8b51a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 34cb5e3 - Browse repository at this point
Copy the full SHA 34cb5e3View commit details
Commits on Jun 19, 2023
-
Update qiskit/providers/fake_provider/fake_backend.py
Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 2d20bdb - Browse repository at this point
Copy the full SHA 2d20bdbView commit details -
Configuration menu - View commit details
-
Copy full SHA for b5ded69 - Browse repository at this point
Copy the full SHA b5ded69View commit details -
Configuration menu - View commit details
-
Copy full SHA for 88abdb0 - Browse repository at this point
Copy the full SHA 88abdb0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3cfb059 - Browse repository at this point
Copy the full SHA 3cfb059View commit details -
Configuration menu - View commit details
-
Copy full SHA for bb91c43 - Browse repository at this point
Copy the full SHA bb91c43View commit details -
Configuration menu - View commit details
-
Copy full SHA for 966003b - Browse repository at this point
Copy the full SHA 966003bView commit details
Commits on Jul 14, 2023
-
Configuration menu - View commit details
-
Copy full SHA for ad0e404 - Browse repository at this point
Copy the full SHA ad0e404View commit details -
Remove duplicate import in set_layout.py
A duplicate import slipped through in the most recent rebase. This commit fixes that oversight and removes the duplicate.
Configuration menu - View commit details
-
Copy full SHA for 8a04ed3 - Browse repository at this point
Copy the full SHA 8a04ed3View commit details
Commits on Jul 17, 2023
-
Configuration menu - View commit details
-
Copy full SHA for a1f7072 - Browse repository at this point
Copy the full SHA a1f7072View commit details -
Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
Configuration menu - View commit details
-
Copy full SHA for ffd1019 - Browse repository at this point
Copy the full SHA ffd1019View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ea2eda - Browse repository at this point
Copy the full SHA 0ea2edaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 75c918b - Browse repository at this point
Copy the full SHA 75c918bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 87df8cc - Browse repository at this point
Copy the full SHA 87df8ccView commit details
Commits on Jul 18, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 04bcd2c - Browse repository at this point
Copy the full SHA 04bcd2cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a47e108 - Browse repository at this point
Copy the full SHA a47e108View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.