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 hard time limit from vf2 passes in preset passmanagers #8021

Merged
merged 3 commits into from
May 4, 2022

Commits on May 4, 2022

  1. Remove hard time limit from vf2 passes in preset passmanagers

    This commit removes the hard time limit from the preset passmanager. We
    were previously setting two limits on the pass a call_limit parameter,
    which is used to set the limit of internal state visits the vf2
    implementation in retworkx will attempt before giving up, and a time
    limit which sets a hard wall time limit that is checked after each
    mapping to ensure we don't spend more than a specific amount of time on
    trying to find an optimal mapping. As subgraph isomorphism is
    NP-complete we could spend a very large amount of time trying to find
    the next isomorphic mapping and both these limits were set to avoid a
    situation where we spend hours in optimization level 1 trying to find a
    better layout. However, as we've seen in Qiskit#8017 setting a hard time limit
    limits the level of reproducibility on the output of the transpiler. It
    means that setting a fixed seed is no longer sufficient to exactly
    reproduce the output as it's also partially a function of the
    performance of the local system we're running on. If the local
    environment is slower we might get different results because we've hit
    the hard time limit.
    
    To address this, this commit removes the hard time limit so that we only
    rely on the call limit parameter on the preset pass manager. While this
    parameter is a bit more opaque in how it should be used because it
    requires an understanding of how the VF2 algorithm works (and is
    implemented in retworkx) it should be sufficient to avoid the runaway
    execution problem but also means the limits are determinitisically
    applied. This should improve the reproducability of the transpiler because
    the pass will always try exactly up until a given point regardless of
    how fast the local environment is.
    
    For people manually instatiating the pass they can still rely on the
    hard time limit parameter if they want it, but for the preset pass
    managers and the transpile() function we no longer set this.
    
    Fixes Qiskit#8017
    mtreinish committed May 4, 2022
    Configuration menu
    Copy the full SHA
    0230ba5 View commit details
    Browse the repository at this point in the history
  2. Add release note

    mtreinish committed May 4, 2022
    Configuration menu
    Copy the full SHA
    110379b View commit details
    Browse the repository at this point in the history
  3. Fix tense

    jakelishman authored May 4, 2022
    Configuration menu
    Copy the full SHA
    15ed724 View commit details
    Browse the repository at this point in the history