CertKeen

Google Cloud Professional Machine Learning Engineer · Free practice question 10 of 12

tf.data prefetch and parallel map

Profiling of a GPU training job at Ingleby Motors shows the GPU idle while each batch is decoded and augmented on the CPU. Which TWO tf.data changes overlap or speed up input processing? (Select TWO.)

  1. A.Add prefetch with tf.data.AUTOTUNE so the next batches are prepared while the GPU trains
  2. B.Set num_parallel_calls=tf.data.AUTOTUNE on the map transformation for decoding and augmentation
  3. C.Reduce the number of training epochs
  4. D.Disable shuffling to make each epoch deterministic
  5. E.Lower the model's learning rate
Show answer and explanation

Correct answers: A. Add prefetch with tf.data.AUTOTUNE so the next batches are prepared while the GPU trains · B. Set num_parallel_calls=tf.data.AUTOTUNE on the map transformation for decoding and augmentation

Why: Prefetching overlaps input preparation with training steps, and a parallel map decodes and augments several elements at once on multiple CPU cores; both reduce GPU idle time. Fewer epochs shorten training without fixing the bottleneck, shuffling does not limit throughput in this way, and the learning rate does not affect input speed.

More free Google Cloud Professional Machine Learning Engineer questions