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/10/30 23:43:18 UTC

[GitHub] [incubator-mxnet] ptrendx commented on a change in pull request #15167: Pointwise fusion for GPU

ptrendx commented on a change in pull request #15167: Pointwise fusion for GPU
URL: https://github.com/apache/incubator-mxnet/pull/15167#discussion_r340907707
 
 

 ##########
 File path: src/executor/simple_partition_pass.h
 ##########
 @@ -0,0 +1,392 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*!
+ * Copyright (c) 2019 by Contributors
+ * \file simple_partition_pass.h
+ * \brief Simple pass for partitioning a graph.
+ * \author Clement Fuji Tsang
+ */
+#ifndef MXNET_EXECUTOR_SIMPLE_PARTITION_PASS_H_
+#define MXNET_EXECUTOR_SIMPLE_PARTITION_PASS_H_
+
+#include <mxnet/base.h>
+#include <mxnet/op_attr_types.h>
+#include <mxnet/operator.h>
+#include <nnvm/graph_attr_types.h>
+#include <utility>
+#include <deque>
+#include <algorithm>
+#include <vector>
+
+#include "exec_pass.h"
+
+namespace mxnet {
+namespace exec {
+
+
+/*!
+ * \brief Custom graph class, which will contain bi-directional nodes
+ * we need to compute DFS and reverse DFS for graph partitioning.
+ */
+class BidirectionalGraph {
+ public:
+  struct Node {
+    nnvm::Node* nnvmptr;
+    std::vector<Node*> inputs;
+    std::vector<Node*> outputs;
+  };
+
+  explicit BidirectionalGraph(const Graph &g) {
 
 Review comment:
   Sure, will do.

----------------------------------------------------------------
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