server_configure.proto 3.7 KB
Newer Older
W
wangguibao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// Copyright (c) 2019 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";
W
wangguibao 已提交
16 17 18
package baidu.paddle_serving.configure;

message EngineDesc {
W
wangguibao 已提交
19 20 21 22 23
  required string name = 1;
  required string type = 2;
  required string reloadable_meta = 3;
  required string reloadable_type = 4;
  required string model_data_path = 5;
W
wangguibao 已提交
24 25 26
  required int32 runtime_thread_num = 6;
  required int32 batch_infer_size = 7;
  required int32 enable_batch_align = 8;
W
wangguibao 已提交
27 28
  optional string version_file = 9;
  optional string version_type = 10;
W
wangguibao 已提交
29 30 31 32 33 34 35 36 37 38 39 40 41 42

  /*
   * Sparse Parameter Service type. Valid types are:
   * "None": not use sparse parameter service
   * "Local": Use local kv service (rocksdb library & API)
   * "Remote": Use remote kv service (cube)
   */
  enum SparseParamServiceType {
    NONE = 0;
    LOCAL = 1;
    REMOTE = 2;
  }
  optional SparseParamServiceType sparse_param_service_type = 11;
  optional string sparse_param_service_table_name = 12;
43 44 45
  optional bool enable_memory_optimization = 13;
  optional bool static_optimization = 14;
  optional bool force_update_static_cache = 15;
M
MRXLT 已提交
46
  optional bool enable_ir_optimization = 16;
W
wangguibao 已提交
47 48 49
};

// model_toolkit conf
W
wangguibao 已提交
50
message ModelToolkitConf { repeated EngineDesc engines = 1; };
W
wangguibao 已提交
51 52 53

// reource conf
message ResourceConf {
W
wangguibao 已提交
54 55
  required string model_toolkit_path = 1;
  required string model_toolkit_file = 2;
W
wangjiawei04 已提交
56 57 58 59
  optional string general_model_path = 3;
  optional string general_model_file = 4;
  optional string cube_config_path = 5;
  optional string cube_config_file = 6;
W
wangjiawei04 已提交
60
  optional int32 cube_quant_bits = 7; // set 0 if no quant.
W
wangguibao 已提交
61 62 63 64
};

// DAG node depency info
message DAGNodeDependency {
W
wangguibao 已提交
65 66
  required string name = 1;
  required string mode = 2;
W
wangguibao 已提交
67 68 69 70
};

// DAG Node
message DAGNode {
W
wangguibao 已提交
71 72 73
  required string name = 1;
  required string type = 2;
  repeated DAGNodeDependency dependencies = 3;
W
wangguibao 已提交
74 75 76 77
};

// workflow entry
message Workflow {
W
wangguibao 已提交
78 79 80
  required string name = 1;
  required string workflow_type = 2;
  repeated DAGNode nodes = 3;
W
wangguibao 已提交
81 82 83
};

// Workflow conf
W
wangguibao 已提交
84
message WorkflowConf { repeated Workflow workflows = 1; }
W
wangguibao 已提交
85 86 87 88 89 90 91 92

// request_field_key: specifies use which request field as mapping key (see
// request_field_key in InferService below)
//
// If the value of the user request field specified by `request_field_key`
// matches the value of `request_field_value` in one of the
// ValueMappedWorkflows, the request will be directed to the workflow specified
// in the `workflow` field of that ValueMappedWorkflow
W
wangguibao 已提交
93
//
W
wangguibao 已提交
94
message ValueMappedWorkflow {
W
wangguibao 已提交
95 96
  required string request_field_value = 1;
  required string workflow = 2;
W
wangguibao 已提交
97 98 99
};

message InferService {
W
wangguibao 已提交
100 101
  required string name = 1;
  optional string merger = 2;
W
wangguibao 已提交
102

W
wangguibao 已提交
103
  optional bool enable_map_request_to_workflow = 3 [ default = false ];
W
wangguibao 已提交
104

W
wangguibao 已提交
105 106 107 108 109 110 111
  // If enable_map_request_to_workfow = true
  //
  // Each request will be mapped to a workflow according to the value in
  // in user request field specified by `request_field_key` (see the
  // comments for ValueMappedWorkflow above)
  optional string request_field_key = 4;
  repeated ValueMappedWorkflow value_mapped_workflows = 5;
W
wangguibao 已提交
112

W
wangguibao 已提交
113 114
  // If enable_map_request_to_workflow = false
  repeated string workflows = 6;
W
wangguibao 已提交
115 116 117 118
};

// InferService conf
message InferServiceConf {
W
wangguibao 已提交
119 120
  optional uint32 port = 1;
  repeated InferService services = 2;
W
wangguibao 已提交
121
};