Skip to content

Commit 429ddb2

Browse files
Porting the grappler batch prioritization rewriter to TFRT.
PiperOrigin-RevId: 776869098
1 parent c59c8a4 commit 429ddb2

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

tensorflow_serving/servables/tensorflow/tfrt_saved_model_factory.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ absl::StatusOr<tfrt::SavedModel::Options> CreateCommonSavedModelOptions(
222222
compile_options.min_num_batch_threads = config.tfrt_min_num_batch_threads();
223223
compile_options.min_max_enqueued_batches =
224224
config.tfrt_min_max_enqueued_batches();
225+
compile_options.batch_queue_global_prioritization_num_threads =
226+
config.tfrt_batch_queue_global_prioritization_num_threads();
225227
compile_options.batch_padding_policy = config.batch_padding_policy();
226228
compile_options.batch_options = config.in_graph_batching_parameters();
227229

tensorflow_serving/servables/tensorflow/tfrt_saved_model_source_adapter.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ message TfrtSavedModelConfig {
234234

235235
// Batching parameters to be rewritten in the existing BatchFunction ops.
236236
BatchingOptions in_graph_batching_parameters = 2028;
237+
238+
// If non-zero, all models on this server are switched to use a prioritized
239+
// batching function using this number of global threads.
240+
int64 tfrt_batch_queue_global_prioritization_num_threads = 2029;
237241
}
238242

239243
// Config proto for TfrtSavedModelSourceAdapter.

0 commit comments

Comments
 (0)