How to configure distributed training with minimal code changes?
You developed a Transformer model in TensorFlow to translate text. Your training data includes millions of documents in a Cloud Storage bucket. You plan to use distributed training to reduce training time. You need to configure the training job while minimizing the effort required to modify code and to manage the cluster’s configuration. What should you do?
Community Votes
100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The question tests the selection of a managed distributed training solution that balances performance with low operational overhead, specifically identifying MultiWorkerMirroredStrategy as the low-effort standard for multi-GPU setups.
To minimize code modification and cluster management effort for distributed TensorFlow training, use a Vertex AI custom training job with GPU accelerators and the tf.distribute.MultiWorkerMirroredStrategy.
Selecting Cloud TPU VMs (Option C) is a frequent error because, while TPUs are fast for Transformers, they typically require significant code changes compared to the minimal refactoring needed for MultiWorkerMirroredStrategy on GPUs.
Community Discussion (4 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Option A is the correct choice because Vertex AI custom training jobs provide a managed environment that handles cluster provisioning and scaling, significantly reducing management effort. Utilizingtf.distribute.MultiWorkerMirroredStrategy allows for synchronous data-parallel training across multiple GPU workers, which is ideal for Transformer models, and generally requires minimal code changes—mostly just wrapping the model creation and compilation in a strategy scope.Why the Other Options Are Wrong
Option B is incorrect because introducing a Reduction Server adds configuration complexity and is typically reserved for specific asynchronous training scenarios or extreme parameter server loads, rather than standard synchronous training. Option C is incorrect because migrating to Cloud TPUs often necessitates substantial code alterations, such as adjusting input pipelines and enabling XLA compilation, which violates the requirement to minimize code changes. Option D is incorrect becausetf.distribute.MirroredStrategy is designed for single-machine, multi-GPU training and does not support distributed training across a cluster of machines, which is necessary to efficiently process millions of documents.Community Comment Notes
Community comments strongly validate Option A, emphasizing its ability to leverage managed infrastructure for reduced overhead and its compatibility with existing TensorFlow code. Commenters specifically ruled out Option C due to the code modification requirements for TPUs and Option B due to its complex setup involving different machine types and Reduction Servers.Official Reference
Exam Strategy
When exam questions emphasize minimizing code changes and management effort for distributed training, always prefer Vertex AI Custom Jobs with MultiWorkerMirroredStrategy over TPUs or complex parameter server architectures, unless the workload explicitly demands TPU-specific optimizations.
Related Analysis
Practice All PMLE Questions
Access 65 questions with complete answers and detailed explanations.
View Full PMLE Practice Test →