Add SerialDeviceBatchScheduler which offers similar performance as the AdaptiveShared...
authorA. Unique TensorFlower <gardener@tensorflow.org>
Wed, 30 May 2018 23:27:26 +0000 (16:27 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 30 May 2018 23:29:42 +0000 (16:29 -0700)
commit1e007dfddd5c20f89300a2e3669f56db47e2154c
treeb32fc17a11f4fb3a485ac28dd2eb58b9410671e6
parentc9297e34f0ceef4afd970ee117aea9110bf8ae62
Add SerialDeviceBatchScheduler which offers similar performance as the AdaptiveSharedBatchScheduler, but increased reliablility and stability.

ASBS assumes request latency can be minimized at a specific number of batch processing threads. Under reasonable load, this is true and ASBS performs well, but under low load latency is basically unaffected by the number of threads, and ASBS can learn a wide variety of 'optimal' values.  If load resumes suddenly, these values can give very poor latencies.  In most cases, ASBS will recover, eventually rediscovering the correct value, but we have observed other cases where the latency is so large and noisy that ASBS can't get a good signal to guide its learning and the number of threads remains stuck at the bad value.

In addition, the incremental learning nature of this algorithm means that ASBS is always exploring to some extent, which can give rise to periods of non-optimal latency. This is most significant at high utilization where the wrong number of threads can potentially overload the system.

ASBS uses latency as a proxy for keeping the tensorflow processing pipeline optimally loaded. SDBS, on the other hand, uses a direct measurement of the pipeline fullness, and adjusts its number of batch processing threads accordingly. This solves the exploration problem. SDBS solves the low load problem by not adjusting its thread count when the threads pass some idleness threshold.

PiperOrigin-RevId: 198638918
tensorflow/core/kernels/batching_util/BUILD
tensorflow/core/kernels/batching_util/serial_device_batch_scheduler.h [new file with mode: 0644]
tensorflow/core/kernels/batching_util/serial_device_batch_scheduler_test.cc [new file with mode: 0644]