Skip to content

Commit

Permalink
add remove graph node; add set_feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Yelrose committed Aug 6, 2021
1 parent 46cdd0b commit 30b0226
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions paddle/fluid/distributed/service/graph_brpc_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
namespace paddle {
namespace distributed {


void GraphPsService_Stub::service(
::google::protobuf::RpcController *controller,
const ::paddle::distributed::PsRequestMessage *request,
Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/distributed/service/graph_brpc_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class GraphBrpcClient : public BrpcPsClient {
const std::vector<std::string>& feature_names,
const std::vector<std::vector<std::string>>& features);


virtual std::future<int32_t> clear_nodes(uint32_t table_id);
virtual std::future<int32_t> add_graph_node(
uint32_t table_id, std::vector<uint64_t>& node_id_list,
Expand Down
2 changes: 2 additions & 0 deletions paddle/fluid/distributed/service/graph_brpc_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,8 @@ int32_t GraphBrpcService::graph_set_node_feat(Table *table,
buffer += feat_len;
}
}


((GraphTable *)table)->set_node_feat(node_ids, feature_names, features);

return 0;
Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/distributed/service/graph_brpc_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class GraphBrpcService : public PsBaseService {
const PsRequestMessage &request,
PsResponseMessage &response,
brpc::Controller *cntl);

int32_t graph_get_node_feat(Table *table, const PsRequestMessage &request,
PsResponseMessage &response,
brpc::Controller *cntl);
Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/distributed/service/graph_py_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ ::paddle::distributed::PSParameter GraphPyClient::GetWorkerProto() {
::paddle::distributed::DownpourWorkerParameter* downpour_worker_proto =
worker_proto->mutable_downpour_worker_param();


for (auto& tuple : this->table_id_map) {
VLOG(0) << " make a new table " << tuple.second;
::paddle::distributed::TableParameter* worker_sparse_table_proto =
Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/distributed/service/graph_py_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ class GraphPyClient : public GraphPyService {
int start, int size, int step = 1);
::paddle::distributed::PSParameter GetWorkerProto();


protected:
mutable std::mutex mutex_;
int client_id;
Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/distributed/table/common_graph_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ int32_t GraphTable::initialize() {
// shards.resize(shard_num_per_table);
shards = std::vector<GraphShard>(shard_num_per_table, GraphShard(shard_num));
return 0;

}
}
};
1 change: 1 addition & 0 deletions paddle/fluid/distributed/table/common_graph_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class GraphShard {
}
return res;
}

GraphNode *add_graph_node(uint64_t id);
FeatureNode *add_feature_node(uint64_t id);
Node *find_node(uint64_t id);
Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/distributed/test/graph_node_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ void RunBrpcPushSparse() {
ASSERT_TRUE(node_feat[1][0] == "helloworld");



// Test string
node_ids.clear();
node_ids.push_back(37);
Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/pybind/fleet_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ void BindGraphPyClient(py::module* m) {
.def("bind_local_server", &GraphPyClient::bind_local_server);
}


using paddle::distributed::TreeIndex;
using paddle::distributed::IndexWrapper;
using paddle::distributed::IndexNode;
Expand Down

0 comments on commit 30b0226

Please sign in to comment.