You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/09/06 06:03:37 UTC

[GitHub] [incubator-mxnet] samskalicky opened a new issue #16108: Subgraph API creates duplicate inputs and outputs

samskalicky opened a new issue #16108: Subgraph API creates duplicate inputs and outputs
URL: https://github.com/apache/incubator-mxnet/issues/16108
 
 
   ## Description
   Subgraph API creates duplication inputs for each consumer of an input node to a subgraph, and duplicate outputs for each consumer of a subgraph output. This results in tensor duplication, and causes OOM due to excessive memory usage. 
   
   ## Minimum reproducible example
   Consider the duplicate input problem first. Lets say we have the following graph:
   ```
   A --> B
     \
       --> C
   ```
   In this graph node A has a single output, and nodes B and C consume A's output. If nodes B and C are added to a subgraph, the graph is changed to the following:
   ```
   A --> S
   
   S [ A0 --> B
        A1 --> C]
   ```
   Heres, nodes B and C are moved into the subgraph, and their dependency on node A (which is not in the subgraph) is broken, and an input node is created for each: A0, A1. The subgraph will have 2 inputs (A0, A1) and will both have dependencies to node A. 
   
   Now lets consider the the duplicate output problem. Consider the same graph as above:
   ```
   A --> B
     \
       --> C
   ```
   But this time lets only node A is added to the subgraph, and nodes B and C are left out. Then  the graph is changed to the following:
   ```
   S --> B
     \
       --> C
   
   S [ A]
   ```
   Here, B and C have dependencies on the output from A inside the subgraph. In this case, the subgraph will have 2 outputs, one for each consumer: B and C. But both outputs will be defined as coming from the same output of node A inside the subgraph. 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services