Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#7 from huwei02/gpugraph
Browse files Browse the repository at this point in the history
fix compile error
  • Loading branch information
huwei02 committed May 26, 2022
2 parents 47b82ac + ee7f0e8 commit 319a201
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions paddle/fluid/framework/fleet/heter_ps/gpu_graph_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ struct GpuPsCommGraph {
void display_on_cpu() {
VLOG(0) << "neighbor_size = " << neighbor_size;
VLOG(0) << "node_size = " << node_size;
for (size_t i = 0; i < neighbor_size; i++) {
for (int64_t i = 0; i < neighbor_size; i++) {
VLOG(0) << "neighbor " << i << " " << neighbor_list[i];
}
for (size_t i = 0; i < node_size; i++) {
for (int64_t i = 0; i < node_size; i++) {
VLOG(0) << "node i " << node_list[i].node_id
<< " neighbor_size = " << node_list[i].neighbor_size;
std::string str;
int offset = node_list[i].neighbor_offset;
for (size_t j = 0; j < node_list[i].neighbor_size; j++) {
for (int64_t j = 0; j < node_list[i].neighbor_size; j++) {
if (j > 0) str += ",";
str += std::to_string(neighbor_list[j + offset]);
}
Expand Down
2 changes: 2 additions & 0 deletions paddle/fluid/framework/fleet/heter_ps/graph_gpu_ps_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ class GpuPsGraphTable : public HeterComm<uint64_t, int64_t, int> {
NodeQueryResult graph_node_sample(int gpu_id, int sample_size);
NeighborSampleResult graph_neighbor_sample_v3(NeighborSampleQuery q,
bool cpu_switch);
NeighborSampleResult graph_neighbor_sample(int gpu_id, int64_t *key,
int sample_size, int len);
NeighborSampleResult graph_neighbor_sample(int gpu_id, int idx, int64_t *key,
int sample_size, int len);
NeighborSampleResult graph_neighbor_sample_v2(int gpu_id, int idx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,14 @@ NeighborSampleResult GpuPsGraphTable::graph_neighbor_sample_v3(
q.src_nodes, q.sample_size, q.len,
cpu_switch);
}

NeighborSampleResult GpuPsGraphTable::graph_neighbor_sample(int gpu_id,
int64_t* key,
int sample_size,
int len) {
return graph_neighbor_sample(gpu_id, 0, key, sample_size, len);
}

NeighborSampleResult GpuPsGraphTable::graph_neighbor_sample(int gpu_id, int idx,
int64_t* key,
int sample_size,
Expand Down
9 changes: 0 additions & 9 deletions paddle/fluid/framework/fleet/heter_ps/graph_gpu_wrapper.cu
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,6 @@ void GraphGpuWrapper::export_partition_files(int idx, std::string file_path) {
return ((GpuPsGraphTable *)graph_table)
->cpu_graph_table_->export_partition_files(idx, file_path);
}
void GraphGpuWrapper::load_node_weight(int type_id, int idx, std::string path) {
return ((GpuPsGraphTable *)graph_table)
->cpu_graph_table->load_node_weight(type_id, idx, path);
}

void GraphGpuWrapper::export_partition_files(int idx, std::string file_path) {
return ((GpuPsGraphTable *)graph_table)
->cpu_graph_table->export_partition_files(idx, file_path);
}
#endif
}
};
2 changes: 1 addition & 1 deletion paddle/fluid/pybind/fleet_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ void BindGraphGpuWrapper(py::module* m) {
.def(py::init([]() { return GraphGpuWrapper::GetInstance(); }))
.def("neighbor_sample", &GraphGpuWrapper::graph_neighbor_sample_v3)
.def("graph_neighbor_sample", py::overload_cast<int, int64_t*, int, int>(&GraphGpuWrapper::graph_neighbor_sample))
.def("graph_neighbor_sample", py::overload_cast<int, std::vector<int64_t>&, int>(&GraphGpuWrapper::graph_neighbor_sample))
.def("graph_neighbor_sample", py::overload_cast<int, int, std::vector<int64_t>&, int>(&GraphGpuWrapper::graph_neighbor_sample))
.def("set_device", &GraphGpuWrapper::set_device)
.def("init_service", &GraphGpuWrapper::init_service)
.def("set_up_types", &GraphGpuWrapper::set_up_types)
Expand Down

0 comments on commit 319a201

Please sign in to comment.