the_one_ps.proto 9.1 KB
Newer Older
T
tangwei12 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
// Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed 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.

syntax = "proto2";
package paddle.distributed;
option cc_generic_services = true;
option cc_enable_arenas = true;

message FsClientParameter {
  enum FsApiType {
    HDFS = 0;
    AFS = 1;
  }
  optional FsApiType fs_type = 1 [ default = HDFS ];
  optional string uri = 2;        // such as afs://xxx.afs.com:9902
  optional string user = 3;       // user_name to access fs
  optional string passwd = 4;     // password
  optional int32 buffer_size = 5; // buffer for read/write
  optional string hadoop_bin = 51;
  optional string afs_conf = 101;
}

message PSParameter {
  optional string worker_class = 1;
  optional string server_class = 2;
  optional string instance_class = 3;
  optional string init_gflags = 4 [ default = "" ];
  optional WorkerParameter worker_param = 101;
  optional ServerParameter server_param = 102;
  repeated DownpourTrainerParameter trainer_param = 301;
  optional FsClientParameter fs_client_param = 501;
}

message WorkerParameter {
  optional DownpourWorkerParameter downpour_worker_param = 1;
}

message DownpourWorkerParameter {
  repeated TableParameter downpour_table_param = 1;
}

message DownpourServerParameter {
  repeated TableParameter downpour_table_param = 1;
  optional ServerServiceParameter service_param = 2;
}

message ServerParameter {
  optional DownpourServerParameter downpour_server_param = 1;
}

message DownpourTrainerParameter {
  repeated DenseTableParameter dense_table = 1;
  repeated SparseTableParameter sparse_table = 2;
  optional int32 push_sparse_per_batch = 3;
  optional int32 push_dense_per_batch = 4;
  repeated string skip_op = 5;
  repeated ProgramConfig program_config = 6;
}

message DenseTableParameter {
  optional int32 table_id = 1;
  repeated string dense_variable_name = 2;
  repeated string dense_gradient_variable_name = 3;
  optional int32 fea_dim = 4;
}

message SparseTableParameter {
  optional int32 table_id = 1;
  optional int32 feature_dim = 2;
  repeated string slot_key = 3;
  repeated string slot_value = 4;
  repeated string slot_gradient = 5;
}

message ServerServiceParameter {
  optional string server_class = 1 [ default = "BrpcPsServer" ];
  optional string client_class = 2 [ default = "BrpcPsClient" ];
T
tangwei12 已提交
89
  optional string service_class = 3 [ default = "BrpcPsService" ];
T
tangwei12 已提交
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
  optional uint32 start_server_port = 4
      [ default = 0 ]; // will find a avaliable port from it
  optional uint32 server_thread_num = 5 [ default = 12 ];
}

message ProgramConfig {
  required string program_id = 1;
  repeated int32 push_sparse_table_id = 2;
  repeated int32 push_dense_table_id = 3;
  repeated int32 pull_sparse_table_id = 4;
  repeated int32 pull_dense_table_id = 5;
}

enum TableType {
  PS_SPARSE_TABLE = 0;
  PS_DENSE_TABLE = 1;
  PS_OTHER_TABLE = 2;
}

message TableParameter {
  optional uint64 table_id = 1;
  optional string table_class = 2;
  optional uint64 shard_num = 3 [ default = 1000 ];
  optional TableAccessorParameter accessor = 4;
  optional TensorAccessorParameter tensor = 5;
  optional CommonAccessorParameter common = 6;
  optional TableType type = 7;
Z
zhaocaibei123 已提交
117
  optional bool compress_in_save = 8 [ default = true ];
118
  optional GraphParameter graph_parameter = 9;
Z
zhaocaibei123 已提交
119 120 121 122
  // for cache model
  optional bool enable_sparse_table_cache = 10 [ default = true ];
  optional double sparse_table_cache_rate = 11 [ default = 0.00055 ];
  optional uint32 sparse_table_cache_file_num = 12 [ default = 16 ];
123
  optional bool enable_revert = 13 [ default = false ];
Z
zhaocaibei123 已提交
124
  optional float shard_merge_rate = 14 [ default = 1.0 ];
T
tangwei12 已提交
125 126 127 128
}

message TableAccessorParameter {
  optional string accessor_class = 1;
D
danleifeng 已提交
129 130 131 132
  optional uint32 fea_dim = 4 [ default = 11 ];   // field size of one value
  optional uint32 embedx_dim = 5 [ default = 8 ]; // embedx feature size
  optional uint32 embedx_threshold = 6
      [ default = 10 ]; // embedx feature create threshold
Z
zhaocaibei123 已提交
133
  optional CtrAccessorParameter ctr_accessor_param = 7;
T
tangwei12 已提交
134
  repeated TableAccessorSaveParameter table_accessor_save_param = 8;
Z
zhaocaibei123 已提交
135 136
  optional SparseCommonSGDRuleParameter embed_sgd_param = 10;
  optional SparseCommonSGDRuleParameter embedx_sgd_param = 11;
D
danleifeng 已提交
137 138 139 140 141 142
  optional GraphSGDParameter graph_sgd_param = 12;
}

message GraphSGDParameter {
  optional uint32 nodeid_slot = 1 [ default = 9008 ];
  optional float feature_learning_rate = 2 [ default = 0.05 ];
Z
zhaocaibei123 已提交
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
}

message CtrAccessorParameter {
  optional float nonclk_coeff = 1
      [ default = 0.1 ]; // to calculate show_click_score
  optional float click_coeff = 2
      [ default = 1 ]; // to calculate show_click_score
  optional float base_threshold = 3 [
    default = 1.5
  ]; // show_click_score > base_threshold, this feature can be saved
  optional float delta_threshold = 4
      [ default =
            0.25 ]; // delta_score > delta_threshold, this feature can be saved
  optional float delta_keep_days = 5
      [ default =
            16 ]; // unseen_day < delta_keep_days, this feature can be saved
  optional float show_click_decay_rate = 6 [
    default = 0.98
  ]; // show/click will update to show/click * show_click_decay_rate after a day
  optional float delete_threshold = 7
      [ default = 0.8 ]; // threshold to shrink a feasign
  optional float delete_after_unseen_days = 8
      [ default = 30 ]; // unseen_day > delete_after_unseen_days, this feature
                        // will be delete in shrink_model
  optional int32 ssd_unseenday_threshold = 9
      [ default = 1 ]; // threshold to save ssd
169
  optional bool show_scale = 10 [ default = true ];
T
tangwei12 已提交
170 171 172
}

message TensorAccessorParameter {
173 174 175 176 177
  optional string feed_var_name = 1;
  optional string fetch_var_name = 2;
  optional int64 startup_program_id = 3;
  optional int64 main_program_id = 4;
  optional string tensor_table_class = 6;
T
tangwei12 已提交
178 179 180 181 182 183 184 185 186
}

message CommonAccessorParameter {
  optional string name = 1;
  optional string table_name = 2;
  repeated string attributes = 3;
  repeated string params = 4;
  repeated uint32 dims = 5;
  repeated string initializers = 6;
T
tangwei12 已提交
187 188 189
  optional string entry = 7;
  optional int32 trainer_num = 8;
  optional bool sync = 9;
190 191
  optional uint32 table_num = 10;
  optional uint32 table_dim = 11;
T
tangwei12 已提交
192 193 194 195 196 197 198
}

message TableAccessorSaveParameter {
  optional uint32 param = 1;
  optional string converter = 2;
  optional string deconverter = 3;
}
Z
zhaocaibei123 已提交
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228

message SparseCommonSGDRuleParameter {
  optional string name = 1;
  optional SparseNaiveSGDRuleParameter naive = 2;
  optional SparseAdagradSGDRuleParameter adagrad = 3;
  optional SparseAdamSGDParameter adam = 4;
}

message SparseNaiveSGDRuleParameter { // SparseNaiveSGDRule
  optional double learning_rate = 1 [ default = 0.05 ];
  optional double initial_range = 2 [ default = 0.0001 ];
  repeated float weight_bounds = 3;
}

message
    SparseAdagradSGDRuleParameter { // SparseAdaGradSGDRule|StdAdaGradSGDRule
  optional double learning_rate = 1 [ default = 0.05 ];
  optional double initial_g2sum = 2 [ default = 3.0 ];
  optional double initial_range = 3 [ default = 0.0001 ];
  repeated float weight_bounds = 4;
}

message SparseAdamSGDParameter { // SparseAdamSGDRule
  optional double learning_rate = 1 [ default = 0.001 ];
  optional double initial_range = 2 [ default = 0.0001 ];
  optional double beta1_decay_rate = 3 [ default = 0.9 ];
  optional double beta2_decay_rate = 4 [ default = 0.999 ];
  optional double ada_epsilon = 5 [ default = 1e-08 ];
  repeated float weight_bounds = 6;
}
229 230 231

message GraphParameter {
  optional int32 task_pool_size = 1 [ default = 24 ];
232 233 234 235 236 237 238 239 240 241
  repeated string edge_types = 2;
  repeated string node_types = 3;
  optional bool use_cache = 4 [ default = false ];
  optional int32 cache_size_limit = 5 [ default = 100000 ];
  optional int32 cache_ttl = 6 [ default = 5 ];
  repeated GraphFeature graph_feature = 7;
  optional string table_name = 8 [ default = "" ];
  optional string table_type = 9 [ default = "" ];
  optional int32 shard_num = 10 [ default = 127 ];
  optional int32 search_level = 11 [ default = 1 ];
D
danleifeng 已提交
242
  optional bool build_sampler_on_cpu = 12 [ default = true ];
243 244 245 246 247 248
}

message GraphFeature {
  repeated string name = 1;
  repeated string dtype = 2;
  repeated int32 shape = 3;
W
wangguanqun 已提交
249
}
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275

message FLParameter {
  optional FLStrategy fl_strategy = 1;
  optional FLClientInfo client_info = 2;
}

message FLStrategy {
  optional uint64 iteration_num = 1;
  optional uint64 client_id = 2;
  optional string next_state = 3 [default = "JOIN"];
  optional string init_gflags = 4 [ default = "" ];
}

message FLClientInfo {
  optional uint32 client_id = 1;
  optional string device_type = 2;
  optional int32 compute_capacity = 3;
  optional int32 bandwidth = 4;
  optional LocalTrainingResult local_training_result = 5;
  optional string init_gflags = 6 [ default = "" ];
}

message LocalTrainingResult {
  optional double acc = 1;
  optional double loss = 2;
}