A TensorFlow model with custom ops (some must run on CPU) trains in two days on an n2-standard-32 VM. To reduce training time cost-effectively, what should you change?
Choose an answer
Tap an option to check your answer.
Correct answer: Train the model using a VM with a GPU hardware accelerator..
Why this is the answer
The correct answer is to train the model using a VM with a GPU hardware accelerator. GPUs are highly effective for accelerating deep learning workloads, including TensorFlow models, by performing parallel computations much faster than CPUs. Since the model has custom ops, and some must run on the CPU, a GPU setup would offload the intensive numerical computations to the GPU while allowing the CPU-bound custom ops to execute efficiently on the host CPU, leading to significant training time reduction. Changing to n2-highmem-32 would increase memory but not necessarily computation speed for a compute-bound task. Changing to e2-standard-32 would likely decrease performance as e2 machines are generally less performant than n2 for intensive workloads. While TPUs are excellent for specific TensorFlow workloads, they are optimized for matrix multiplications and might not be as efficient or cost-effective for models with custom ops that require CPU execution, potentially leading to data transfer bottlenecks between the CPU and TPU.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed