8000 Deprecate use of `BackendProperties` (BackendV1) in transpilation pipeline by ElePT · Pull Request #13719 · Qiskit/qiskit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Deprecate use of BackendProperties (BackendV1) in transpilation pipeline #13719

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

Merged
merged 6 commits into from
Feb 19, 2025

Conversation

ElePT
Copy link
Contributor
@ElePT ElePT commented Jan 22, 2025

Summary

This PR deprecates the following uses of BackendProperties to be removed in 2.0:

  • backend_prop input argument in DenseLayout
  • properties input argument in VF2Layout
  • properties input argument in VF2PostLayout
  • backend_props input argument in UnitarySynthesis
  • backend_properties in PassManagerConfig
  • backend_properties in generate_routing_passmanager
  • backend_properties in generate_translation_passmanager
  • backend_properties in Target.from_configuration

Details and comments

This PR unblocks #13706 and further 2.0 removals.

@ElePT ElePT requested review from alexanderivrii, ShellyGarion and a team as code owners January 22, 2025 13:30
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@ElePT ElePT requested a review from jakelishman February 14, 2025 14:47
jakelishman
jakelishman previously approved these changes Feb 17, 2025
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.

Overall, this looks about as clean as we'll manage, thanks Elena. I think none of my comments are actionable for this PR.

I wish that we'd handled this move a little cleaner overall - if the Target was supposed to supersede BackendProperties, I wish we'd had generate_preset_pass_manager and transpile set that option to None the second a Target was passed (or at least overwrite them with the data re-derived from the Target so we knew it was identical), which we could have introduced at any point, especially once all the transpiler passes were migrated, but oh well, too late for that now.

As it stands, we're relying on each individual pass to make sure it prioritises the Target, and of the ones touched by this PR, either there's (minor) bugs in their implementations of that, or we're interpreting "priority" different in some places.

Copy link
Member

Choose a reason for hiding this comment

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

In DenseLayout, there's a path where a disagreement between the Target and BackendProperties can cause the backend_props argument to be used in place of the Target (if Target.qargs is None). That might be a bug - perhaps in _build_error_matrix we should have

if target is not None:
    if target.qargs is None:
        return zeros
    # ... build errors
elif backend_prop and coupling_map:
    # ... build errors
return errors

instead of what we have right now, which is the target.qargs is not None being in the top-line if.

If a bug, it can be a follow-up.

Copy link
Contributor Author
@ElePT ElePT Feb 17, 2025

Choose a reason for hiding this comment

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

Hmmm this does look like a bug, but the bug would only affect 1.4 because the elif backend_props branch is anyways going away in 2.0. Given that 1.4 is supposed to not include fixes, and we are probably too late for 1.3.3, should we just... let the "legacy" behavior be even if it's inconsistent with the prioritization of the target?

Copy link
Member

Choose a reason for hiding this comment

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

We have the same if target.is not None and target.qargs is not None maybe-problem in vf2_utils.build_average_error_map. Also affects VF2PostLayout.

Copy link
Member

Choose a reason for hiding this comment

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

In _build_gate_errors in this file, we use both Target and BackendProperties if they're both given. The other similar _build_* functions use only Target if given. Don't know if it's a bug or intentional.

That's probably not a huge deal for the deprecation - the alternate path would just be to update the Target if it was intended behaviour anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is surely a bug, but the rust path currently skips these gate errors so it will not affect the code when the plugin is set to "default" (yes, a cleanup of this python code is pending).

Co-authored-by: Jake Lishman <jake@binhbar.com>
jakelishman
jakelishman previously approved these changes Feb 18, 2025
@jakelishman jakelishman added this pull request to the merge queue Feb 18, 2025
@jakelishman jakelishman removed this pull request from the merge queue due to a manual request Feb 18, 2025
@jakelishman jakelishman added this pull request to the merge queue Feb 19, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 19, 2025
@ElePT ElePT added this pull request to the merge queue Feb 19, 2025
Merged via the queue into Qiskit:stable/1.4 with commit d77f65a Feb 19, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Deprecation Include in "Deprecated" section of changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0