You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Juice stores a unique counter for each node to mark them as visited during a traversal. As a consequence, traversing the same circuit (for perhaps different queries) in parallel is not allowed.
Could we optionally let the user supply a counter map instead so we can run several threads traversing the same circuit at the same time? If so, what would be the most Juice-idiomatic? Here's an example proposal out of the top of my head, where query is some query function (like log_likelihood_per_instance or isdeterministic).
c =...# some circuit
V =Dict{ProbCircuit, UInt32}()
query(c, args; counter = V)
Thanks
The text was updated successfully, but these errors were encountered:
It makes sense to provide a function that is given the node, an integer k, increments the counter by k, and returns the previous value of the counter. The default implementation can use the counter field in the node struct -- this will always be fastest --, but one can also use a Dict as in your example or a field in the struct pointed at by the node's data field.
Yeah I think this could be very useful. Also, at the same time we can probably provide a more robust reset counter, Tractables/LogicCircuits.jl#64.
Another option might be an option to deep copy the same circuit for each thread, uses more memory but probably better for speed. Then user can decide between the tradeoffs.
I changed the traversal infrastructure in Tractables/LogicCircuits.jl@00177e3 so that it is now safe to traverse the circuit in parallel: each traversal uses its own Dict.
Hi,
Currently Juice stores a unique counter for each node to mark them as visited during a traversal. As a consequence, traversing the same circuit (for perhaps different queries) in parallel is not allowed.
Could we optionally let the user supply a counter map instead so we can run several threads traversing the same circuit at the same time? If so, what would be the most Juice-idiomatic? Here's an example proposal out of the top of my head, where
query
is some query function (likelog_likelihood_per_instance
orisdeterministic
).Thanks
The text was updated successfully, but these errors were encountered: