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

Expose Sabre heuristic configuration to Python #12171

Merged
merged 5 commits into from
Jul 30, 2024

Commits on Apr 11, 2024

  1. Expose Sabre heuristic configuration to Python

    This exposes the entirety of the configuration of the Sabre heuristic to
    Python space, making it modifiable without recompilation.  This includes
    some additional configuration options that were not previously easily
    modifiable, even with recompilation:
    
    - the base weight of the "basic" component can be adjusted
    - the weight of the "basic" and "lookahead" components can be adjusted
      to _either_ use a constant weight (previously not a thing) or use a
      weight that scales with the size of the set (previously the only
      option).
    - the "decay" component is now entirely separated from the "lookahead"
      component, so in theory you can now have a decay without a lookahead.
    
    This introduces a tracking `Vec` that stores the scores of _all_ the
    swaps encountered, rather than just dynamically keeping hold of the best
    swaps.  This has a couple of benefits:
    
    - with the new dynamic structure for heuristics, this is rather more
      efficient because each heuristic component can be calculated in
      separate loops over the swaps, and we don't have to branch within the
      innermost loop.
    - it makes it possible in the future to try things like assigning
      probabilities to each swap and randomly choosing from _all_ of them,
      not just the best swaps.  This is something I've actively wanted to
      try for quite some time.
    
    The default heuristics in the transpiler-pass creators for the `basic`,
    `lookahead` and `decay` strings are set to represent the same heuristics
    as before, and this commit is entirely RNG compatible with its
    predecessor (_technically_ for huge problems there's a possiblity that
    pulling out some divisions into multiplications by reciprocals will
    affect the floating-point maths enough to modify the swap selection).
    jakelishman committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    a2695af View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2024

  1. Update for PyO3 0.21

    jakelishman committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    8d231b9 View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2024

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

Commits on Jul 30, 2024

  1. Configuration menu
    Copy the full SHA
    8947b88 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d0429b1 View commit details
    Browse the repository at this point in the history