Register CP-SAT decision strategy to stabilize solve times; Switch to ortools 9.15#452
Merged
Conversation
OR-Tools >= 9.8 randomized the tie-breaking of CP-SAT's internal
scheduling search heuristic, which the "fixed" subsolver falls back to
when a model has no decision strategy. SLOTHY's models relied on that
heuristic being deterministic: since the change, solve times of large
examples (e.g. ntt_dilithium_123_45678_a55) vary by more than an order
of magnitude between runs, frequently exceeding timeouts and aborting
the external binary search with "No solution found."
Register an explicit decision strategy instead: branch on the
instruction that can be scheduled earliest, trying the earliest
position first, mimicking a greedy scheduling pass. This makes solver
behavior deterministic and fast independently of the OR-Tools version;
the previously failing benchmark solves in flat ~5-7s per attempt on
OR-Tools 9.7, 9.8 and 9.15 alike. The strategy is configurable via
config.solver_search_strategy ("lowest_min" (default),
"program_order", or "auto" for the previous behavior).
Also fix config.solver_random_seed never taking effect: it was
assigned to a non-existent CpSolver attribute instead of the solver
parameter.
Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.