Skip to content

Commit 7ff0105

Browse files
nnshah1QMassoz
andauthored
Updating Service and Model Config Protobuf for uint64 Request Priority (#93)
Co-authored-by: qmas <[email protected]>
1 parent 869bf83 commit 7ff0105

File tree

3 files changed

+46
-10
lines changed

3 files changed

+46
-10
lines changed

include/triton/common/triton_json.h

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,6 @@ class TritonJson {
228228
return TRITONJSON_STATUSSUCCESS;
229229
}
230230

231-
// FIXME Should have Set* for all types.
232-
233231
// Set/overwrite a signed integer in a value. This changes the
234232
// type of the value to signed int.
235233
TRITONJSON_STATUSTYPE SetInt(const int64_t value)
@@ -239,6 +237,24 @@ class TritonJson {
239237
return TRITONJSON_STATUSSUCCESS;
240238
}
241239

240+
// Set/overwrite an unsigned integer in a value. This changes the
241+
// type of the value to unsigned int.
242+
TRITONJSON_STATUSTYPE SetUInt(const uint64_t value)
243+
{
244+
rapidjson::Value& v = AsMutableValue();
245+
v.SetUint64(value);
246+
return TRITONJSON_STATUSSUCCESS;
247+
}
248+
249+
// Set/overwrite a double in a value. This changes the
250+
// type of the value to double.
251+
TRITONJSON_STATUSTYPE SetDouble(const double value)
252+
{
253+
rapidjson::Value& v = AsMutableValue();
254+
v.SetDouble(value);
255+
return TRITONJSON_STATUSSUCCESS;
256+
}
257+
242258
// Set/overwrite a string in a value. This changes the
243259
// type of the value to string
244260
TRITONJSON_STATUSTYPE SetString(const std::string& value)

protobuf/grpc_service.proto

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,12 @@ message InferParameter
440440
{
441441
//@@ .. cpp:var:: oneof parameter_choice
442442
//@@
443-
//@@ The parameter value can be a string, an int64 or
444-
//@@ a boolean
443+
//@@ The parameter value can be a string, an int64,
444+
//@@ an uint64, a double, or a boolean
445+
//@@
446+
//@@ Note: double and uint64 are currently
447+
//@@ placeholders for future use and
448+
//@@ are not supported for custom parameters
445449
//@@
446450
oneof parameter_choice
447451
{
@@ -462,6 +466,22 @@ message InferParameter
462466
//@@ A string parameter value.
463467
//@@
464468
string string_param = 3;
469+
470+
//@@ .. cpp:var:: double double_param
471+
//@@
472+
//@@ A double parameter value.
473+
//@@
474+
//@@ Not supported for custom parameters
475+
//@@
476+
double double_param = 4;
477+
478+
//@@ .. cpp:var:: uint64 uint64_param
479+
//@@
480+
//@@ A uint64 parameter value.
481+
//@@
482+
//@@ Not supported for custom parameters
483+
//@@
484+
uint64 uint64_param = 5;
465485
}
466486
}
467487

protobuf/model_config.proto

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ message ModelDynamicBatching
11341134
//@@
11351135
bool preserve_ordering = 3;
11361136

1137-
//@@ .. cpp:var:: uint32 priority_levels
1137+
//@@ .. cpp:var:: uint64 priority_levels
11381138
//@@
11391139
//@@ The number of priority levels to be enabled for the model,
11401140
//@@ the priority level starts from 1 and 1 is the highest priority.
@@ -1143,14 +1143,14 @@ message ModelDynamicBatching
11431143
//@@ priority 3, etc. Requests with the same priority level will be
11441144
//@@ handled in the order that they are received.
11451145
//@@
1146-
uint32 priority_levels = 4;
1146+
uint64 priority_levels = 4;
11471147

1148-
//@@ .. cpp:var:: uint32 default_priority_level
1148+
//@@ .. cpp:var:: uint64 default_priority_level
11491149
//@@
11501150
//@@ The priority level used for requests that don't specify their
11511151
//@@ priority. The value must be in the range [ 1, 'priority_levels' ].
11521152
//@@
1153-
uint32 default_priority_level = 5;
1153+
uint64 default_priority_level = 5;
11541154

11551155
//@@ .. cpp:var:: ModelQueuePolicy default_queue_policy
11561156
//@@
@@ -1161,13 +1161,13 @@ message ModelDynamicBatching
11611161
//@@
11621162
ModelQueuePolicy default_queue_policy = 6;
11631163

1164-
//@@ .. cpp:var:: map<uint32, ModelQueuePolicy> priority_queue_policy
1164+
//@@ .. cpp:var:: map<uint64, ModelQueuePolicy> priority_queue_policy
11651165
//@@
11661166
//@@ Specify the queue policy for the priority level. The default queue
11671167
//@@ policy will be used if a priority level doesn't specify a queue
11681168
//@@ policy.
11691169
//@@
1170-
map<uint32, ModelQueuePolicy> priority_queue_policy = 7;
1170+
map<uint64, ModelQueuePolicy> priority_queue_policy = 7;
11711171
}
11721172

11731173
//@@

0 commit comments

Comments
 (0)