ngraph-tf
ngraph-tf copied to clipboard
Shrestha/add control dependencies in ngraph cluster
Add control dependency to the translated nGraph nodes. first_ng_op_map stores the entry point nGraph nodes and ng_op_map stores the exit point nGraph nodes for each Tf translated op. After the TF graph has been translated to nGraph, we add the control dependencies to the nGraph nodes using the stored entry and exit points.
In our discussion @shresthamalik pointed out this graph:
W
|
v
X-->Y-->*I--->Z
| ^
|________|
Data edges: X->Y
, I->Z
, X->I
, W->Y
. Control edges (starred): Y->*I
. I
is identity node
If we attach the control edge Y->I
to Y->X
(parent of I
), then we introduce a cycle in nodes X,Y
In such cases we cannot attach control edges to parents, and . we cannot honor the Y->*I
control edge (unless we attach the control edge to children Z
)