Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Machine Learning Engineer practice bank has an additional 974 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your team is pre-training a 400B-parameter dense Transformer language model on an 8-slice Cloud TPU Multislice cluster orchestrated on GKE. You face the following architectural constraints:
How should you partition the model and configure parallelism across the 8 slices to maximize Model FLOPs Utilization (MFU) while minimizing pipeline bubbles and communication overhead?
Megatron-style Tensor Parallelism (TP) is an intra-layer model partitioning technique that splits individual weight matrices—such as multi-head attention projections and multilayer perceptron (MLP) blocks—across multiple accelerators. Because every forward and backward pass through a sharded layer requires combining partial matrix products, TP relies on frequent, synchronous All-Reduce or All-Gather / Reduce-Scatter collective communications.
Placing Tensor Parallelism across the Data Center Network (DCN) while keeping pure Data Parallelism (DP) inside each slice inverts the optimal hardware mapping:
The model fit inside a single tightly coupled TPU slice (connected via ICI) or a single multi-GPU node (connected via NVLink Full Mesh), where ultra-high-bandwidth interconnects can sustain intra-layer tensor sharding without traversing the DCN.
Effective multi-dimensional parallelism follows topology-aware device placement: map the highest-communication strategy (TP) to the fastest local interconnect tier, and assign lower-communication strategies (Pipeline Parallelism and DP/FSDP) across slower inter-slice DCN links.
Pipeline Parallelism (PP)—implemented via schedules such as GPipe or PipeDream (1F1B)—partitions a model sequentially by assigning contiguous groups of layers to different stages across accelerators. A global batch is split into smaller micro-batches that stream through the pipeline stages, passing intermediate activations forward and activation gradients backward across stage boundaries.
Configuring an 8-stage pipeline without any cross-slice Data Parallelism (DP) or Fully Sharded Data Parallelism (FSDP) replicas and shrinking micro-batches to minimal sizes degrades hardware efficiency:
A model were so massive that even combining FSDP and TP within a slice could not fit one stage of layers without spanning all 8 slices sequentially, leaving zero capacity for multiple pipeline replicas.
When Pipeline Parallelism is required, minimizing pipeline depth (for example, depth 2 or 4) and pairing it with DP or FSDP replicas increases the batch size per pipeline and keeps pipeline bubbles small.
Hybrid 3D model parallelism coordinates multiple partitioning strategies across the cluster's physical network hierarchy. Tensor Parallelism (TP) and Fully Sharded Data Parallelism (FSDP) partition matrices, weights, gradients, and optimizer states across chips within each TPU slice over the ultra-fast Inter-Chip Interconnect (ICI), while Pipeline Parallelism (PP) and Data Parallelism (DP) / FSDP coordinate stages and replicas across slices over the Data Center Network (DCN).
Unlike cross-slice TP (which saturates the DCN), an 8-stage pipeline without replicas (which maximizes pipeline bubbles and shrinks micro-batches), or pure cross-slice FSDP (which requires exceeding the convergence batch ceiling), combining intra-slice TP/FSDP with minimal-depth PP + DP/FSDP aligns communication volume directly with hardware bandwidth tiers.
full activation rematerialization policy and pinned_host offloading, avoiding pipeline parallelism completely to eliminate pipeline bubbles.Fully Sharded Data Parallelism (FSDP) partitions model parameters, gradients, and optimizer states across all participating slices. Before each forward or backward computation, devices perform an All-Gather to reconstruct full layer weights and a Reduce-Scatter as gradients are produced. Pairing this with a full activation rematerialization (gradient checkpointing) policy and pinned_host offloading frees additional HBM by discarding or moving intermediate activations.
Although cross-slice FSDP reduces per-slice weight memory without pipeline bubbles, it fails the cluster's convergence and throughput constraints:
full rematerialization policy forces recomputation of nearly all intermediate activations during the backward pass, adding roughly 25–30% extra FLOPs and lowering net Model FLOPs Utilization (MFU).pinned_host memory introduces PCIe/DMA transfer latency that degrades performance when the workload is not strictly long-sequence memory-bound.The model's convergence permitted scaling the global batch size linearly across all 8 slices (large enough to exceed the hardware arithmetic intensity threshold over DCN) and very long sequence lengths made activation memory the primary bottleneck.
While FSDP is the preferred default when batch sizes can scale freely, Pipeline Parallelism is specifically designed for scenarios where achieving strong scaling under FSDP would push the global batch size past the model's convergence limit.
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 Validated