Skip to content

Commit 50b07e4

Browse files
deqiangctensorflow-copybara
authored andcommitted
Provide a runtime option to lower bound the number of batch threads.
PiperOrigin-RevId: 626118642
1 parent 2235e43 commit 50b07e4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

tensorflow_serving/servables/tensorflow/tfrt_saved_model_factory.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ absl::Status TfrtSavedModelFactory::CreateTfrtSavedModelWithMetadata(
230230
ToTpuAllowUnpaddedBatch(config_.tpu_unpadded_batch_mode());
231231
compile_options.use_gpu_compile_and_execute_op =
232232
config_.tfrt_use_fused_gpu_op();
233+
compile_options.min_num_batch_threads = config_.tfrt_min_num_batch_threads();
233234

234235
options.graph_execution_options.run_placer_grappler_on_functions =
235236
config_.run_placer_grappler_on_functions();

tensorflow_serving/servables/tensorflow/tfrt_saved_model_source_adapter.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ message TfrtSavedModelConfig {
194194

195195
// Whether to use fused op for GPU compile, execute and data transfer.
196196
bool tfrt_use_fused_gpu_op = 2018;
197+
198+
// The minimum number of batch threads.
199+
int64 tfrt_min_num_batch_threads = 2019;
197200
}
198201

199202
// Config proto for TfrtSavedModelSourceAdapter.

0 commit comments

Comments
 (0)