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

Stages that control activity, elimination, reduction, restart, trail-saving and vivification #163

Merged
merged 32 commits into from
Mar 12, 2022

Conversation

shnarazk
Copy link
Owner

@shnarazk shnarazk commented Mar 1, 2022

Forked from #161 and spawned and merged #164.

  • splr-luby crate
  • remove GeometricStabilizer
  • remove invocation counters because the stage manager now controls them.
  • re-evaluate the effect of dynamic_restart_threshold more refactoring #164
  • Since lbd_of_dp holds too small values, revise the definitions of parameters used in trail saver and clause eliminator.
  • move EMA of LBD to cdb from rst. more refactoring #164
  • move EMA of assign rate to 'asg' from 'rst'. more refactoring #164

Design Decisions to be noted

  • The stage manager compresses var activity after the end of each 2nd-level Luby cycle in order to diversify the direction of search.
  • Drop refinement on trail_saving; restarts reset dependency. It's enough.
  • Change the definition of ProgressASG. It counts the number of literals after restarts.
  • Rename lbd_of_dp to literal block entanglement. skipping inner-block glue clauses.

@shnarazk shnarazk self-assigned this Mar 1, 2022
@shnarazk shnarazk changed the title (reduce) implement dynamic reduction rate (clause reduction) drastic reduction scheme Mar 2, 2022
@shnarazk
Copy link
Owner Author

shnarazk commented Mar 3, 2022

0746903

$ sat-bench -3 -U 250 -m -s splr
# 0.12.0, timeout:2000 on demorgan @ 2022-03-03T14:41:44
# ~/.cargo/bin/splr (0.15.0-alpha1) @ 2022-03-03T14:41:42
solver,       num,                       target,     time
"splr",         1,                 "UF250(100)",   74.668
"splr",         2,                "UUF250(100)",  205.142
"splr",         3,   "3SAT/360  S144043535-002",   73.183
"splr",         4,   "3SAT/360  S722433227-030",   89.517
"splr",         5,   "3SAT/360 S1459690542-033",   32.424
"splr",         6,   "3SAT/360 S2032263657-035",   26.305
"splr",         7,   "3SAT/360 S1293537826-039", 1015.433
"splr",         8,   "3SAT/360  S368632549-051",  104.450
"splr",         9,   "3SAT/360 S1448866403-060",   42.742
"splr",        10,   "3SAT/360 S1684547485-073",    7.337
"splr",        11,   "3SAT/360 S1826927554-087",    9.619
"splr",        12,   "3SAT/360 S1711406314-093",   11.211
"splr",        13,   "3UNS/360  S404185236-001",  420.143
"splr",        14,   "3UNS/360 S1369720750-015",  284.171
"splr",        15,   "3UNS/360   S23373420-028",  289.453
"splr",        16,   "3UNS/360  S367138237-029",  989.079
"splr",        17,   "3UNS/360  S305156909-031",  453.574
"splr",        18,   "3UNS/360  S680239195-053",  481.176
"splr",        19,   "3UNS/360 S2025517367-061",  975.814
"splr",        20,   "3UNS/360  S253750560-086",  181.093
"splr",        21,   "3UNS/360 S1906521511-089",  416.176
"splr",        22,   "3UNS/360 S1028159446-096",  262.608
"splr",        23,                "SR2015/itox",    6.215
"splr",        24,                "SR2015/m283",   39.251
"splr",        25,                 "SR2015/38b",   31.474
"splr",        26,                 "SR2015/44b",   91.401
median,    97.925,                        total, 6613.659

@shnarazk shnarazk changed the title (clause reduction) drastic reduction scheme (clause reduction) Luby-based drastic reduction scheme Mar 4, 2022
@shnarazk
Copy link
Owner Author

shnarazk commented Mar 4, 2022

# 0.12.0, timeout:2000 on demorgan @ 2022-03-04T22:17:24
# ~/.cargo/bin/splr (0.15.0-alpha1) @ 2022-03-04T21:42:24
solver,       num,                       target,     time
"splr",         1,                 "UF250(100)",   53.891
"splr",         2,                "UUF250(100)",  172.623
"splr",         3,   "3SAT/360  S144043535-002",  108.994
"splr",         4,   "3SAT/360  S722433227-030",  893.308
"splr",         5,   "3SAT/360 S1459690542-033",   20.220
"splr",         6,   "3SAT/360 S2032263657-035",    4.838
"splr",         7,   "3SAT/360 S1293537826-039",    3.787
"splr",         8,   "3SAT/360  S368632549-051",  214.160
"splr",         9,   "3SAT/360 S1448866403-060",   42.132
"splr",        10,   "3SAT/360 S1684547485-073",   68.929
"splr",        11,   "3SAT/360 S1826927554-087",   49.114
"splr",        12,   "3SAT/360 S1711406314-093",   86.319
"splr",        13,   "3UNS/360  S404185236-001",  368.503
"splr",        14,   "3UNS/360 S1369720750-015",  197.067
"splr",        15,   "3UNS/360   S23373420-028",  349.022
"splr",        16,   "3UNS/360  S367138237-029", 1045.414
"splr",        17,   "3UNS/360  S305156909-031",  336.734
"splr",        18,   "3UNS/360  S680239195-053",  257.762
"splr",        19,   "3UNS/360 S2025517367-061",  550.712
"splr",        20,   "3UNS/360  S253750560-086",  192.537
"splr",        21,   "3UNS/360 S1906521511-089",  417.281
"splr",        22,   "3UNS/360 S1028159446-096",  323.436
"splr",        23,                "SR2015/itox",    4.935
"splr",        24,                "SR2015/m283",   45.555
"splr",        25,                 "SR2015/38b",   38.990
"splr",        26,                 "SR2015/44b",   92.819
median,   140.808,                        total, 5939.082

src/lib.rs Outdated Show resolved Hide resolved
src/solver/search.rs Outdated Show resolved Hide resolved
src/solver/search.rs Outdated Show resolved Hide resolved
src/solver/search.rs Outdated Show resolved Hide resolved
src/solver/search.rs Outdated Show resolved Hide resolved
@shnarazk shnarazk changed the title (clause reduction) Luby-based drastic reduction scheme (clause reduction) Luby-based stage manager replacing the restart stabiilzer Mar 5, 2022
@shnarazk shnarazk changed the title (clause reduction) Luby-based stage manager replacing the restart stabiilzer Luby-based stage manager to control restart and clause-elimination/reduction/vivification Mar 5, 2022
@shnarazk shnarazk changed the title Luby-based stage manager to control restart and clause-elimination/reduction/vivification Stage manager to control restart and clause-elimination/reduction/vivification Mar 5, 2022
@shnarazk shnarazk linked an issue Mar 6, 2022 that may be closed by this pull request
@shnarazk
Copy link
Owner Author

shnarazk commented Mar 6, 2022

  • without refinement by trail_saving
# ~/.cargo/bin/splr (0.15.0-alpha1) @ 2022-03-06T21:00:14
solver,       num,                       target,     time
"splr",         1,                 "UF250(100)",   92.498
"splr",         2,                "UUF250(100)",  263.665
"splr",         3,   "3SAT/360  S144043535-002",  124.030
"splr",         4,   "3SAT/360  S722433227-030",    5.532
"splr",         5,   "3SAT/360 S1459690542-033",    8.456
"splr",         6,   "3SAT/360 S2032263657-035",   10.737
"splr",         7,   "3SAT/360 S1293537826-039",  738.115
"splr",         8,   "3SAT/360  S368632549-051",  677.723
"splr",         9,   "3SAT/360 S1448866403-060",  330.797
"splr",        10,   "3SAT/360 S1684547485-073",    0.433
"splr",        11,   "3SAT/360 S1826927554-087",    6.663
"splr",        12,   "3SAT/360 S1711406314-093",   23.286
"splr",        13,   "3UNS/360  S404185236-001",  396.715
"splr",        14,   "3UNS/360 S1369720750-015",  173.317
"splr",        15,   "3UNS/360   S23373420-028",  266.683
"splr",        16,   "3UNS/360  S367138237-029",  863.028
"splr",        17,   "3UNS/360  S305156909-031",  598.279
"splr",        18,   "3UNS/360  S680239195-053",  344.446
"splr",        19,   "3UNS/360 S2025517367-061",  540.635
"splr",        20,   "3UNS/360  S253750560-086",  222.020
"splr",        21,   "3UNS/360 S1906521511-089",  278.614
"splr",        22,   "3UNS/360 S1028159446-096",  196.464
"splr",        23,                "SR2015/itox",    4.890
"splr",        24,                "SR2015/m283",   33.856
"splr",        25,                 "SR2015/38b",   26.434
"splr",        26,                 "SR2015/44b",  253.360
median,   209.242,                        total, 6480.676

@shnarazk
Copy link
Owner Author

shnarazk commented Mar 6, 2022

after changing trail_saving, lbd_of_dq

  • part 1
# ~/.cargo/bin/splr (0.15.0-alpha1) @ 2022-03-06T22:34:34
solver,       num,                       target,     time
"splr",         1,                 "UF250(100)",   88.801
"splr",         2,                "UUF250(100)",  272.968
"splr",         3,   "3SAT/360  S144043535-002",  145.211
"splr",         4,   "3SAT/360  S722433227-030", 1066.335
"splr",         5,   "3SAT/360 S1459690542-033",    7.316
"splr",         6,   "3SAT/360 S2032263657-035",    3.511
"splr",         7,   "3SAT/360 S1293537826-039",  410.355
"splr",         8,   "3SAT/360  S368632549-051",  299.387
"splr",         9,   "3SAT/360 S1448866403-060",  164.451
"splr",        10,   "3SAT/360 S1684547485-073",   50.490
"splr",        11,   "3SAT/360 S1826927554-087",    4.704
"splr",        12,   "3SAT/360 S1711406314-093",    1.749
"splr",        13,   "3UNS/360  S404185236-001",  348.845
"splr",        14,   "3UNS/360 S1369720750-015",  131.537
"splr",        15,   "3UNS/360   S23373420-028",  194.473
"splr",        16,   "3UNS/360  S367138237-029",  371.804
"splr",        17,   "3UNS/360  S305156909-031",  279.778
"splr",        18,   "3UNS/360  S680239195-053",  224.017
"splr",        19,   "3UNS/360 S2025517367-061",  559.360
"splr",        20,   "3UNS/360  S253750560-086",  157.372
"splr",        21,   "3UNS/360 S1906521511-089",  230.283
"splr",        22,   "3UNS/360 S1028159446-096",  184.734
"splr",        23,                "SR2015/itox",    7.726
"splr",        24,                "SR2015/m283",   24.916
"splr",        25,                 "SR2015/38b",   12.660
"splr",        26,                 "SR2015/44b",  301.119
median,   174.593,                        total, 5543.902

* Cargo.toml: disable "dynamci_restart_threshold" temporally

* All generated clauses are supposed to be killed unless ...

* splr-ema: version 0.1.1; add `EmaIF::set_value` and `Ema::with_value`

* (search) fix type

* (trail_saving.rs) parameter tuning

* a bad direction

* quick fix

* (Eliminator::eliminate_combination_limit) delete and define as a local constant

* renamed:    src/processor/eliminator.rs -> src/processor/simplify.rs

* rename 'lbd of dp' to 'literal block entanglement'

* move Restarter::lbd to ClauseDB

* move Restarter::asg to AssignStack as `assign_rate`

* splr-ema::Ewa2: add a cache field to hold `1.0 - decay`

* restart.rs: reorganize `cfg(feature = "Luby_restart")`

* remove meaningless dereference of `as_view`

* tweak the initial values of `AssignStack::level` to set valid values to given clauses

* increase `ClauseDB:;lbd` when a new assignment is found

* update the initial value of `rst_lbd_thr` based on experimentation

* increase `ClauseDB:;lbd` when a new assignment is found (part 2)

* cargo test
@shnarazk shnarazk mentioned this pull request Mar 8, 2022
@shnarazk
Copy link
Owner Author

shnarazk commented Mar 8, 2022

Experiment on stage reduction rate, based on ec7f4c0

reduction median total note
0 238.254 8706.422 1 timeout
1 * span.sqrt() 170.764 6991.109
2 * span.sqrt() 166.834 5684.388
3 * span.sqrt() 197.865 7309.550 1 timeout
4 * span.sqrt() 187.979 7887.724
self.stage 367.327 13253.069 1 timeout
scaling median total note
(max - sca)/max 185.870 6695.874
ece3061 170.053 6254.454
2range.pow(0.75) 168.447 6186.138
range.pow(0.8) 211.262 7426.000

@shnarazk shnarazk changed the title Stage manager to control restart, elimination, reduction, and vivification Stage manager to control restart, elimination, reduction, trail-saving and vivification Mar 9, 2022
@shnarazk shnarazk changed the title Stage manager to control restart, elimination, reduction, trail-saving and vivification Stages that control restart, elimination, reduction, trail-saving and vivification Mar 9, 2022
@shnarazk
Copy link
Owner Author

shnarazk commented Mar 10, 2022

trail refinement

reduction median total note
no control 168.447 6186.138
2(scale.log2() + 1) 171.848 6281.777
1scale.log2() 191.952 7101.243
2scale.log2() 202.206 7116.128
3scale.log2() 198.841 7290.197
scale 153.784 6351.736
scale.sqrt() 183.485 6572.367
2 + scale.pow(0.4) 175.890 8019.165
2 + scale.log2() 176.046 6130.180
2 + scale.log2() + LBE 170.805 5511.889 1 timeout

@shnarazk shnarazk changed the title Stages that control restart, elimination, reduction, trail-saving and vivification Stages that control reward, restart, elimination, reduction, trail-saving and vivification Mar 11, 2022
@shnarazk
Copy link
Owner Author

shnarazk commented Mar 11, 2022

Survey on stage-based var activity compression

On each 2nd cycle, (k - 1) / k med max total note
k = max_scale 137.353 739.897 5386.177
k = max_scale.log2 164.422 888.459 5314.869 1 timeout
k = max_scale.pow(0.75) 160.642 1096.300 5076.053
k = max_scale.pow(0.8) 114.857 940.231 5489.106
k = max_scale.pow(0.9) 62.471 631.618 4137.915

@shnarazk shnarazk changed the title Stages that control reward, restart, elimination, reduction, trail-saving and vivification Stages that control activity, elimination, reduction, restart, trail-saving and vivification Mar 11, 2022
@shnarazk shnarazk marked this pull request as ready for review March 12, 2022 02:35
@shnarazk shnarazk merged commit 5f3fd2f into ditch-fast-EMA-20220226 Mar 12, 2022
shnarazk added a commit that referenced this pull request Apr 2, 2022
* a new branch ditch-fast-EMA-20220226

* (types.rs) add `EEA`

* silly typo

* rename EWA to Ewa

* (types.rs) add `Ewa2`

* add splr-ema crate

* tiny change; ready to comparison

* tweak history lengths; comment out fast EMA settings

* Stages that control activity, elimination, reduction, restart, trail-saving and vivification (#163)

* (reduce) implement dynamic reduction rate

* tweak processor parameters

* +Luby reduction

* keep very small learnt clauses after clause reduction

* (search) rename local variables

* the best

* probably better setting

* refactored and tweak parameters

* add splr-luby

* use splr_luby

* ditto

* select reduction targets based on Luby stabilization span; very fast against problems with small N

* new file:   src/solver/stage.rs; introduce StageManager

* splr-luby/src/lib.rs: add more methods

* refactor StageManager and State

* (reduce) revert some changes

* (RestartIF) s/set_stabilization/set_sensibility/

* tiny refactor

* (search) tiny changes

* (search) StageManager controls simplify invocation directly

* types.rs export SolverEvent; implement Instantiate for StageManager

* (StageManager) s/threshold/end_of_stage/

* (StageManager) reorganize local names

* more refactoring (#164)

* Cargo.toml: disable "dynamci_restart_threshold" temporally

* All generated clauses are supposed to be killed unless ...

* splr-ema: version 0.1.1; add `EmaIF::set_value` and `Ema::with_value`

* (search) fix type

* (trail_saving.rs) parameter tuning

* a bad direction

* quick fix

* (Eliminator::eliminate_combination_limit) delete and define as a local constant

* renamed:    src/processor/eliminator.rs -> src/processor/simplify.rs

* rename 'lbd of dp' to 'literal block entanglement'

* move Restarter::lbd to ClauseDB

* move Restarter::asg to AssignStack as `assign_rate`

* splr-ema::Ewa2: add a cache field to hold `1.0 - decay`

* restart.rs: reorganize `cfg(feature = "Luby_restart")`

* remove meaningless dereference of `as_view`

* tweak the initial values of `AssignStack::level` to set valid values to given clauses

* increase `ClauseDB:;lbd` when a new assignment is found

* update the initial value of `rst_lbd_thr` based on experimentation

* increase `ClauseDB:;lbd` when a new assignment is found (part 2)

* cargo test

* parameter tuning; use cfg! macro instead of cfg attribute

* rename 'depG' label to 'entg'

* (num_reducible) parameter tuning

* (num_reducible) tiny parameter change

* AssignStack: add stage_scale

* implement stage-controlled trail-saving

* implement stage-controlled var activity rescaling

* renamed:    misc/search.tex -> misc/algorithm.tex

* bump version up to 0.15.0-alpha2
shnarazk added a commit that referenced this pull request Apr 3, 2022
- Add `RestartManager` and Remove `GeometricStabilizer` #161
- Switch from a decision-making model to a simple dynamics model for restart #164 
- `RestartManager` is stored in `State`.
- revise the definition of 'literal block entanglement' to accumulate only inter-block clauses (1 < LBD).
- Move some EMAs in `rst` to `asg' and `cdb`. #164 
- Rescale var activity after the end of the 2nd-level cycle of the Luby series. #163 
- Restart stages change the trail-saving setting. #163 
- The pre/in processor was demoted as an on-the-fly module.
- Add `StageManager`, which compresses var activity after the end of each 2nd-level Luby cycle in order to diversify the direction of search. #161 
- Drop refinement on trail_saving; restarts reset dependency. It's enough. 
- Change the definition of `ProgressASG`. It counts the number of assigned literals after restarts instead of unassigned ones.
shnarazk added a commit that referenced this pull request May 15, 2022
- Define `EMA` and `LubySeries` as sub-modules under /primitive #161, #163
- Replace `GeometricStabilizer` with `StageManager` #161 #165
- Replace `Restarter` with `RestartManager` in `State` #168 #162
- Fix crash #174
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compare average with EMA
1 participant