TPU: Implement 3rd gen input pipeline config.
authorBrennan Saeta <saeta@google.com>
Thu, 29 Mar 2018 00:54:01 +0000 (17:54 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Thu, 29 Mar 2018 00:56:45 +0000 (17:56 -0700)
commit628552228c76d2ee7f2eef4d56175a89941e3e1d
tree6688f3429e19ee01f392ca1a1d9b15ab7a8ae80d
parent74949ee09b0ff48a2ff1ca7a27475ec6c2583d43
TPU: Implement 3rd gen input pipeline config.

In this new configuration, we are able to drive a Cloud TPU at full device performance, and achieve over 3k images/sec on ResNet-50. The previous bottleneck was the un-pipeline-able split that occurred after the iterator.get_next() call. This split (when not splitting on the batch-major dimension) caused the training job to be single-threaded-CPU-bottlenecked, resulting in a performance of only ~2650 images/sec on ResNet-50.

This latest input pipeline configuration requires the use of datasets. By requiring datasets, we gain the ability to call get_next() num_replicas times per host, and avoid the expensive split op. (Note: this also opens up potential future avenues for further optimization.) Despite this, we retain a lot of nice usability properties that per_host_v1 (aka input pipeline config v2) gave us.

PiperOrigin-RevId: 190865741
tensorflow/contrib/tpu/python/tpu/tpu_config.py
tensorflow/contrib/tpu/python/tpu/tpu_context.py
tensorflow/contrib/tpu/python/tpu/tpu_estimator.py