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

Pass manager refactoring: cleanup internals #10127

Merged

Commits on Jun 24, 2023

  1. Refactor internals of pass manager and flow controllers.

    This PR introduces two changes for
    * remove tight coupling of flow controller to pass runner instance,
    * remove pass normalization.
    
    PropertySet becomes context var so that flow controllers can be instantiated
    without coupling to a pass runner instance. BasePass becomes an iterable
    of length 1 to skip normalization. The decoupling of property set from
    pass runner allows pass manager to directly broadcast pass runner
    in the multithread, rather than distributing self and craete
    multiple pass runner in each thread.
    nkanazawa1989 committed Jun 24, 2023
    Configuration menu
    Copy the full SHA
    6505e20 View commit details
    Browse the repository at this point in the history
  2. Replace class attribute PASS_RUNNER with property method.

    This allows subclass to dispatch different pass runner type depending on the target code.
    nkanazawa1989 committed Jun 24, 2023
    Configuration menu
    Copy the full SHA
    3fb2464 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2023

  1. Configuration menu
    Copy the full SHA
    830c279 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2023

  1. Configuration menu
    Copy the full SHA
    07fec44 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2023

  1. Refactor passmanager module

    - Add OptimizerTask as a protocol for the pass and flow controller. These are in principle the same object that inputs and outputs IR with optimization.
    - A task gains execute method that takes IR and property set. This makes property set local to iteration of the passes.
    - Drop dependency on pass runner. Now pass manager has a single linear flow controller.
    - Pass manager gain responsibility of compiler frontend and backend as pass runner dependency is removed. This allows flow controllers to be still type agnostic.
    - Drop future property set, as this is no longer necessary because optimization task has the execute method explicitly taking the property set.
    nkanazawa1989 committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    f0c96a1 View commit details
    Browse the repository at this point in the history
  2. Refactor transpiler passmanager

    - Remove pass runner baseclass and replace RunningPassmanager baseclass with FlowControllerLiner
    - Implemented frontoend and backend functionality in transpiler Pass manager
    nkanazawa1989 committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    fdc1f53 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5a03304 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2023

  1. Backward compatibility fix

    - Move handling of required passes to generic pass itself. This makes optimizer tasks the composite pattern-like for more readability.
    - Readd MetaPass to transpiler BasePass as a metaclass which implements predefined equivalence check for all passes. This is necessary to take care of duplicated pass run, which is prohibited in circuit pass manager.
    - Add FlowControllerMeta that allows users to subclass FlowController, while delegating the pass control to BaseFlowController.
    - Readd count to pass manager callback
    - Add PassState that manages the state of execution including PropertySet. This is a portable namespace that can be shared across passes.
    nkanazawa1989 committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    f77cf03 View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2023

  1. Configuration menu
    Copy the full SHA
    8a46f2b View commit details
    Browse the repository at this point in the history
  2. Update release note

    nkanazawa1989 committed Aug 5, 2023
    Configuration menu
    Copy the full SHA
    ac12c6d View commit details
    Browse the repository at this point in the history
  3. Merge branch 'feature/passmanager-refactoring-pr2' of github.com:nkan…

    …azawa1989/qiskit-terra into feature/passmanager-refactoring-pr2
    nkanazawa1989 committed Aug 5, 2023
    Configuration menu
    Copy the full SHA
    19987f0 View commit details
    Browse the repository at this point in the history
  4. lint fix

    nkanazawa1989 committed Aug 5, 2023
    Configuration menu
    Copy the full SHA
    687590e View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2023

  1. OptimizationTask -> Task

    In multi-IR realm task can be something other than optimization. For example IR conversion. Name should not limit operation on subclass.
    nkanazawa1989 committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    a5c8417 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    65fc13d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5034cc4 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2023

  1. Separate property set from pass state. Now Task.execute method has tw…

    …o arguments for property set and pass state. Lifetime of property set data is entire execution of the pass manager, while that of pass state is execution of a single pass.
    nkanazawa1989 committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    305fa58 View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2023

  1. Configuration menu
    Copy the full SHA
    e526bff View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2051412 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6211a5d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a18dd91 View commit details
    Browse the repository at this point in the history
  5. Change the policy for the use of multiple IRs. Just updated module do…

    …cumentation, no actual code change. Future developer must not introduce strict type check on IR (at least in base classes in the module).
    nkanazawa1989 committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    e20949a View commit details
    Browse the repository at this point in the history
  6. Updated interface of base controller. Namely .append() and .passes ar…

    …e moved to particular subclass and the baseclass is now agnostic to construction of task pipeline. This adds more flexibility to design of conditioned pipelines.
    
    Note that PassState is also renamed to WorkflowStatus because this is sort of global mutable variable, rather than local status information of a particular pass.
    nkanazawa1989 committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    5701447 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    59837b3 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ca7dba6 View commit details
    Browse the repository at this point in the history
  9. Update release note

    nkanazawa1989 committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    2c11019 View commit details
    Browse the repository at this point in the history
  10. Merge branch 'main' of github.com:Qiskit/qiskit-terra into feature/pa…

    …ssmanager-refactoring-pr2
    nkanazawa1989 committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    f3912e8 View commit details
    Browse the repository at this point in the history
  11. Readd code change in Qiskit#10835

    Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
    nkanazawa1989 and mtreinish committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    ae14aa7 View commit details
    Browse the repository at this point in the history
  12. typehint fix

    nkanazawa1989 committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    388d1dd View commit details
    Browse the repository at this point in the history
  13. doc fix

    nkanazawa1989 committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    5958f79 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    dd666e9 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2023

  1. Configuration menu
    Copy the full SHA
    f28cad9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9346ce5 View commit details
    Browse the repository at this point in the history
  3. Tweaks to documentation

    jakelishman committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    c56bf7c View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2023

  1. Merge pull request #51 from jakelishman/pr-refactor-docs

    Tweaks to documentation
    nkanazawa1989 authored Oct 17, 2023
    Configuration menu
    Copy the full SHA
    e211d66 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ed9a8d7 View commit details
    Browse the repository at this point in the history
  3. Update interface of execute and use generator feature.

    - Add new container class PassmanagerMetadata
    - Rename propertyset with compilation_status
    - Provide metadata with the iter_tasks instead of property_set
    - Send metadata through generator
    - Turn metadata required, and let pass manager create metadata
    - Return metadata from execute along with the IR
    nkanazawa1989 committed Oct 17, 2023
    Configuration menu
    Copy the full SHA
    d889ac0 View commit details
    Browse the repository at this point in the history
  4. Update deprecations

    nkanazawa1989 committed Oct 17, 2023
    Configuration menu
    Copy the full SHA
    7fba347 View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2023

  1. Configuration menu
    Copy the full SHA
    b9348ae View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    da6c810 View commit details
    Browse the repository at this point in the history
  3. Remove flow_controller_conditions from base controller append and add…

    … stacklevel to deprecation warning
    nkanazawa1989 committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    31fcf67 View commit details
    Browse the repository at this point in the history
  4. Misc updates

    nkanazawa1989 committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    f0a547a View commit details
    Browse the repository at this point in the history
  5. disable cyclic-import

    nkanazawa1989 committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    5d9f16e View commit details
    Browse the repository at this point in the history
  6. Remove typecheck

    nkanazawa1989 committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    df0ee05 View commit details
    Browse the repository at this point in the history
  7. Rename PassmanagerMetadata to PassManagerState

    This is primarily to avoid a potential conflict with the terminology
    `metadata` that's associated with the `input_program`, and because the
    object is the state object for a pass-manager execution.  There is still
    a risk of confusion with `RunState`, but since that's a subcomponent of
    `PassManagerState`, it feels fair enough.
    jakelishman committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    d7cdf8f View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2023

  1. Configuration menu
    Copy the full SHA
    f140148 View commit details
    Browse the repository at this point in the history