nerdexam
Google

PROFESSIONAL-MACHINE-LEARNING-ENGINEER · Question #52

You are training a Resnet model on AI Platform using TPUs to visually categorize types of defects in automobile engines. You capture the training profile using the Cloud TPU profiler plugin and…

The correct answer is A. Use the interleave option for reading data. E. Decrease the batch size argument in your transformation. To reduce an input-bound bottleneck in a TPU training pipeline, parallelizing data reading and optimizing batch processing through smaller batch sizes can improve data throughput.

Submitted by tarun92· Apr 18, 2026Monitoring, optimizing, and maintaining ML solutions

Question

You are training a Resnet model on AI Platform using TPUs to visually categorize types of defects in automobile engines. You capture the training profile using the Cloud TPU profiler plugin and observe that it is highly input-bound. You want to reduce the bottleneck and speed up your model training process. Which modifications should you make to the tf.data dataset? (Choose two.)

Options

  • AUse the interleave option for reading data.
  • BReduce the value of the repeat parameter.
  • CIncrease the buffer size for the shuttle option.
  • DSet the prefetch option equal to the training batch size.
  • EDecrease the batch size argument in your transformation.

How the community answered

(28 responses)
  • A
    75% (21)
  • B
    7% (2)
  • C
    14% (4)
  • D
    4% (1)

Why each option

To reduce an input-bound bottleneck in a TPU training pipeline, parallelizing data reading and optimizing batch processing through smaller batch sizes can improve data throughput.

AUse the interleave option for reading data.Correct

The `interleave` option allows reading and processing data from multiple input files concurrently, which significantly speeds up the input pipeline by parallelizing I/O and preprocessing operations.

BReduce the value of the repeat parameter.

Reducing the `repeat` parameter primarily affects the number of training epochs, not the efficiency of the input pipeline itself.

CIncrease the buffer size for the shuttle option.

Increasing the buffer size for shuffling primarily impacts the randomness of data shuffling, not directly the overall speed of delivering data to a highly input-bound model.

DSet the prefetch option equal to the training batch size.

While `prefetch` is crucial for overlapping operations, setting its buffer size equal to the training batch size is not the optimal or standard configuration; typically, `tf.data.AUTOTUNE` or a suitable number of *batches* is used.

EDecrease the batch size argument in your transformation.Correct

If the input bottleneck is caused by slow, batch-wise data transformations or augmentations performed by the CPU, decreasing the batch size can allow the input pipeline to process and deliver smaller chunks of data more frequently, thus reducing the time the model waits for the next batch.

Concept tested: Optimizing `tf.data` input pipelines for TPUs

Source: https://www.tensorflow.org/guide/data_performance

Topics

#tf.data#Input Pipeline Optimization#Performance Tuning#Data Loading

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-MACHINE-LEARNING-ENGINEER Practice