reminisce opened a new pull request #12157: Subgraph API for integrating accelerators with MXNet URL: https://github.com/apache/incubator-mxnet/pull/12157 ## Description ## This is a joint work of @reminisce and @zheng-da on implementing subgraph API for integrating backend accelerators (TVM, MKLDNN, TensorRT, nGraph, etc.) with MXNet. See [design proposal](https://cwiki.apache.org/confluence/display/MXNET/Unified+integration+with+external+backend+libraries). ## Highlighted deliverables - A graph partitioning algorithm accepting custom partitioning rules (through subclassing `SubgraphProperty`). - A naive graph partitioning rule called `DefaultSubgraphProperty` partitioning graphs based upon provided operator names. For example, in the left graph, operators B and C are designated to be grouped into a subgraph operator node. After applying the partitioning algorithm, nodes B and C are replaced by a subgraph operator node in the graph on the right-hand-side. ![image](https://user-images.githubusercontent.com/4978794/44073224-a7ef9318-9f47-11e8-8325-b03af5157e7a.png) - `DefaultSubgraphOperator`. A stateful operator storing a subgraph for execution by `CachedOp`. - `NDArray` version number for tracking mutations of `NDArray`s. This is useful, for example, in a stateful MKLDNN subgraph operator for checking whether input data has changed since the last forward call to decide if to trigger data format conversion. - Graph partitioning enabled in `GraphExecutor` for the forward pass. Triggered by an environment variable `MXNET_SUBGRAPH_BACKEND`. For example, `MXNET_SUBGRAPH_BACKEND=default`, see `example/subgraph_op` for more information. ## Coming soon after this PR - Backward pass support in `DefaultSubgraphOperator`. - Support graph partitioning for Gluon/CacheOp. - Tutorial for developers on integrating backend accelerators using the Subgraph API. - Real backend accelerator integration with MXNet. ## Checklist ## ### Essentials ### Please feel free to remove inapplicable items for your PR. - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) created (except PRs with tiny changes) - [x] Changes are complete (i.e. I finished coding on this PR) - [x] All changes have test coverage: - Unit tests are added for small changes to verify correctness (e.g. adding a new operator) - Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore) - Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL) - [x] Code is well-documented: - For user-facing API changes, API doc string has been updated. - For new C++ functions in header files, their functionalities and arguments are documented. - For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable - Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html - [x] To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services