aksnzhy commented on a change in pull request #13588: Accelerate DGL csr neighbor sampling URL: https://github.com/apache/incubator-mxnet/pull/13588#discussion_r241979369
########## File path: src/operator/contrib/dgl_graph.cc ########## @@ -586,123 +563,119 @@ static void SampleSubgraph(const NDArray &csr, dgl_id_t* out_layer = sub_layer.data().dptr<dgl_id_t>(); // BFS traverse the graph and sample vertices - dgl_id_t sub_vertices_count = 0; // <vertex_id, layer_id> - std::unordered_map<dgl_id_t, int> sub_ver_mp; - std::queue<ver_node> node_queue; + std::unordered_set<dgl_id_t> sub_ver_mp; + std::vector<std::pair<dgl_id_t, dgl_id_t> > sub_vers; + sub_vers.reserve(num_seeds * 10); Review comment: Is 10 a general good constant for sampling? ---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
