Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud Architect practice bank has 2,335 more like it. Try 10 free: instant score, no account.
A machine learning engineering team is training a large-scale deep learning model on Google Cloud TPU accelerators using TensorFlow. During performance profiling with TensorBoard, the team observes that the TPU cores experience frequent idle periods and low Matrix Multiply Unit (MXU) utilization.
Further analysis indicates that the TPU accelerator is waiting on frequent communication handshakes with the host CPU after every individual batch step.
Which configuration change should the team make to reduce host-device communication overhead and maximize training throughput?
steps_per_execution isIn TensorFlow Keras, the steps_per_execution parameter in Model.compile controls the number of consecutive training batches processed by accelerator hardware (such as Cloud TPUs or NVIDIA GPUs) inside a single execution loop before control and metrics are returned to the host CPU.
When training on dedicated hardware accelerators like Cloud TPUs, transferring execution context back to the host CPU introduces latency across the PCIe or interconnect bus:
steps_per_execution is set to 1, meaning a host callback occurs after every single training step.steps_per_execution (for example, setting it to 100 or the number of steps in an epoch) packages multiple forward and backward passes together.
Increasing steps_per_execution directly targets the root cause of the performance bottleneck: excessive communication between the TPU server host CPU and the TPU accelerator device. It maximizes training throughput with a simple configuration adjustment in the high-level framework without degrading model convergence or accuracy.
This approach replaces optimized binary storage formats with plain-text comma-separated value (CSV) files for dataset ingestion.
steps_per_execution), not the source file format on disk.tf.train.Example protocol buffers that stream sequentially and efficiently into memory.tf.data prefetching and interleaving.The goal was to simplify human readability of raw dataset samples during local development and exploratory debugging on lightweight CPU environments.
This configuration attempts to use arbitrary, non-aligned batch sizes across TPU cores under the false assumption that avoiding TPU matrix dimensions avoids padding overhead.
The scenario required demonstrating how to intentionally trigger tensor padding warnings and sub-optimal MXU utilization during XLA compilation.
This approach reduces the global batch size below 64 to lower memory usage on accelerator memory registers.
steps_per_execution is increased.The primary problem was an out-of-memory error caused by intermediate activation storage during forward and backward passes.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated