hongzimao/decima-sim

About aggregation issues in the messaging passing

karlhjm opened this issue · 2 comments

def get_bottom_up_paths(job_dag):

The “msg_mats, msg_masks” generated in this function will repeatedly aggregate its child_node original feature and embedded feature in some cases.

for instance, a dag_job as below

20191025212734
and its msg_mats is as below,
mat

According to the msg_masks and msg_mats generated above,

In the first step of message passing, node e passes the original feature to node d, so that d aggregates the original feature of e, and node f passes its original feature to generate the embedded feature of e.

In the second step of the message passing, node e will pass its embedded feature to node d, so that node d will aggregate the embedded features of e.

So the last node d not only aggregates the embedded features of e, but also aggregates the original features of e.

But according to my understanding, in the paper, node d should only aggregate the embedded feature of its child e.

Did I get it wrong? I really hope to get your reply, thank you!

Thanks for your effort of understanding the details of our implementation. Just want to make sure, did you get these msg_mats and msg_masks from our code (by passing your example DAG)? They are calculated in:

sp_mat.add(row=n.idx, col=child.idx, data=1)
msg_masks[depth, n.idx] = 1
msg_mats.append(sp_mat)
So msg_mats puts the node being aggregated at each step (as row index) and its child nodes (as column index). msg_masks ensures only these nodes are being updated at this step. Therefore, at each step, the input to the aggregation will be the original features of the current node and the aggregated features from its children. Hope this helps?

I'm very excited to see your reply. I'm so sorry to bother you, but I'm sure I didn't make any mistakes in the calculation steps. I've calculated it three times based on your source code...
When the maximum depth is 2, The message delivery path of the above DAG should be as follows,
e -> c -> a
e -> c -> b
f -> e -> d
So in the first step, the corresponding message passing matrix should't have this term(msg_mats[0][d][e] = 1), otherwise it will cause node E to pass original feature to node D.

First, I get frontier as [e, f] from the code.

frontier = get_init_frontier(job_dag, args.max_depth)

Then calculate the first iteration when depth is 0.
if children_all_in_frontier:
if parent not in msg_level or \
curr_level + 1 > msg_level[parent]:
# parent node has deeper message passed
new_frontier.add(parent)

However, D will be added to new_frontier when the depth is 0, which will result in msg_mats[0][d][e] = 1 and msg_masks[0][d] = 1.
for n in new_frontier:
for child in n.child_nodes:
sp_mat.add(row=n.idx, col=child.idx, data=1)
msg_masks[depth, n.idx] = 1