-
Notifications
You must be signed in to change notification settings - Fork 21
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
switch upInitMsg to pull model #761
Merged
Merged
Conversation
This file contains 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
drop MsgUpInit Dict
10 tasks
keep temporary debugging code: using IncrementalInference
## small canonical factor graph, without graphinit
fg = generateCanonicalFG_CaesarRing1D(graphinit=false)
getSolverParams(fg).graphinit = false
getSolverParams(fg).dbg = true
# do all init on tree as part of solve
# getSolverParams(fg).drawtree = true
# tree, smt, hist = solveTree!(fg)
tree = wipeBuildNewTree!(fg)
# getSolverParams(fg).limititers = 50
TS = Vector{Task}(undef,6)
iters = 100*ones(Int, 6)
# good case
# iters = [47;53;25;34;34;34]
# iters = [59;46;26;35;35;35] # adding CSM 8e
# iters = [3;5;14;14;15;18]
# iters = [3;5;14;14;18;18] cannot find key 2
# iters = [10;16;14;18;18;15]
# iters = [6;16;18;18;18;15]
# iters = [10;16;18;18;18;15]
# all issues on attemptCliqInitDown
# iters = [10;16;19;18;18;15] # breaks on 3.19, key 2 not found
# iters = [10;16;18;19;18;15] # breaks on 4.19, key 2 not found
# iters = [10;17;18;18;18;15] # blocks on 2.17 ??
# iters = [10;16;18;18;19;15] # blocks on 5.19 ??
# iters = [10;16;18;18;24;15]
# w len == 1
# iters = [18;54;22;40;50;50]
# iters = [18;44;22;31;34;34]
# iters = [18;39;22;31;34;34]
# csm add 8e
# iters = [18;39;22;32;35;35]
SLEEP = 10
getSolverParams(fg).limititers = iters[3]
TS[3] = solveCliq!(fg, tree, :l1, recordcliq=true, async=true)
sleep(SLEEP)
getSolverParams(fg).limititers = iters[4]
TS[4] = solveCliq!(fg, tree, :x1, recordcliq=true, async=true)
sleep(SLEEP)
getSolverParams(fg).limititers = iters[2]
TS[2] = solveCliq!(fg, tree, :x4, recordcliq=true, async=true)
sleep(SLEEP)
getSolverParams(fg).limititers = iters[5]
TS[5] = solveCliq!(fg, tree, :x5, recordcliq=true, async=true)
sleep(SLEEP)
getSolverParams(fg).limititers = iters[1]
TS[1] = solveCliq!(fg, tree, :x0, recordcliq=true, async=true)
sleep(SLEEP)
getSolverParams(fg).limititers = iters[6]
TS[6] = solveCliq!(fg, tree, :x3, recordcliq=true, async=true)
sleep(SLEEP)
TS
##
hists = fetchCliqHistoryAll!(TS)
printCliqHistorySequential(hists)
printCliqHistorySequential(hists, joinLogPath(fg,"HistoryCSMAll.txt"))
0
##
using Logging
CLIQ = 5
STEP = 29
hist_ = fetch(TS[CLIQ])
fnct__ = deepcopy(hist_[STEP][3])
csmc__ = deepcopy(hist_[STEP][4])
# attachCSM!(csmc__, fg, tree)
csmc__.logger = SimpleLogger(stdout)
# getCliqueData(csmc__.cliq).solveCondition = Condition()
#
# getCliqueData(csmc__.cliq).initUpChannel
# tmpmsg = getCliqueData(csmc__.cliq).initUpChannel |> fetch
# getCliqueData(csmc__.cliq).initUpChannel = Channel{LikelihoodMessage}(1)
# put!(getCliqueData(csmc__.cliq).initUpChannel, tmpmsg)
# Juno.@enter fnct__(csmc__)
fnct__
fnct__ = fnct__(csmc__)
# Juno.@enter fnct__(csmc__)
# t5_19 = @async fnct__(csmc__)
# t4_19 = @async fnct__(csmc__)
# t3_19 = @async fnct__(csmc__)
# t5_25 = @async fnct__(csmc__)
istaskdone(t4_19)
istaskdone(t3_19)
istaskdone(t5_25)
fnct__ = fetch(t5_24)
0
## The error
# cliq 2, 3, or 4
csmc = csmc__
prnt = getParent(csmc.tree, csmc.cliq)[1]
dwinmsgs = prepCliqInitMsgsDown!(csmc.dfg, csmc.tree, prnt, csmc.cliq, logger=SimpleLogger(stdout), dbgnew=true)
0
## Other sequences that induce the same failures in either clique 2, 3, 4
# # makes cliq2 error with key 2 not found
# TS[1] = solveCliq!(fg, tree, :x0, recordcliq=true, async=true)
# sleep(5)
# TS[2] = solveCliq!(fg, tree, :x4, recordcliq=true, async=true)
# sleep(2)
# TS[5] = solveCliq!(fg, tree, :x5, recordcliq=true, async=true)
# sleep(2)
# TS[6] = solveCliq!(fg, tree, :x3, recordcliq=true, async=true)
# sleep(2)
# TS[3] = solveCliq!(fg, tree, :l1, recordcliq=true, async=true)
# sleep(2)
# TS[4] = solveCliq!(fg, tree, :x1, recordcliq=true, async=true)
# usually breaks on 4
# TS[4] = solveCliq!(fg, tree, :x1, recordcliq=true, async=true)
# TS[3] = solveCliq!(fg, tree, :l1, recordcliq=true, async=true)
# TS[1] = solveCliq!(fg, tree, :x0, recordcliq=true, async=true)
# TS[2] = solveCliq!(fg, tree, :x4, recordcliq=true, async=true)
# TS[5] = solveCliq!(fg, tree, :x5, recordcliq=true, async=true)
# TS[6] = solveCliq!(fg, tree, :x3, recordcliq=true, async=true)
# |
Codecov Report
@@ Coverage Diff @@
## master #761 +/- ##
==========================================
- Coverage 62.12% 60.75% -1.38%
==========================================
Files 37 37
Lines 4520 4688 +168
==========================================
+ Hits 2808 2848 +40
- Misses 1712 1840 +128
Continue to review full report at Codecov.
|
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.
Related to #674 decision to use only a message pull model. This PR is part of #459 refactoring. This PR is specifically focused on up-init-msg refactoring steps.