[tf.data] Autotune prefetch buffer sizes
authorBrennan Saeta <saeta@google.com>
Wed, 28 Mar 2018 21:04:01 +0000 (14:04 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 28 Mar 2018 21:07:18 +0000 (14:07 -0700)
commitd355f4e2644b68ea643f573c564936ec23b93787
tree19ec2cfc40018c38bb5037353981f64f391a5393
parent70666858800a55585ae2775f97a1731db305388a
[tf.data] Autotune prefetch buffer sizes

In order to make it easier for tf.data users to achieve
high performance with their input pipelines, this change adds
the ability for the prefetch op to automatically tune its buffer
size.

To use the auto-tuning configuration of the `prefetch` transformation,
simply skip passing in a buffer size. Example:

```python
dataset = # ...
dataset = dataset.prefetch()  # Look ma, no buffer value req'd!
```
PiperOrigin-RevId: 190829736
tensorflow/contrib/data/__init__.py
tensorflow/core/kernels/data/BUILD
tensorflow/core/kernels/data/prefetch_autotuner.cc [new file with mode: 0644]
tensorflow/core/kernels/data/prefetch_autotuner.h [new file with mode: 0644]
tensorflow/core/kernels/data/prefetch_autotuner_test.cc [new file with mode: 0644]
tensorflow/core/kernels/data/prefetch_dataset_op.cc
tensorflow/python/data/ops/dataset_ops.py