M10-037M10: Engineering Deep-Dive & Technical BQAI Infra Deep-Dive & Postmortem BQHard
⚡Flashcard Drill➔Mastery:

AI Infra Optimization BQ: Lifting Distributed Training MFU From 28% to 52%+

🎯 Active Recall Self-Check (Draft First, Verify After)
Login-free practice tracker: recall core answer, audit pitfalls, and log review status.
Step 1 · Draft your concise answer & assumptions
Step 2 · Check Pitfalls & Follow-up Inquiries
Next: M10-038 →
📐 Mathematical Definition
MFU=6⋅Nparams⋅Btokens/TstepPeak FLOPsdevice⋅NGPUs:  28%→52%\text{MFU} = \frac{6 \cdot N_{\text{params}} \cdot B_{\text{tokens}} / T_{\text{step}}}{\text{Peak FLOPs}_{\text{device}} \cdot N_{\text{GPUs}}}:\; 28\% \to 52\%
⚡ One-Sentence Core Answer
Use Nsight Systems and PyTorch Profiler traces to eliminate CPU data-loading stalls, unoverlapped FSDP AllGather bubbles, and unfused kernel launch overhead—raising MFU from 28% to 52%+.

📌 Key Takeaways

  • •
    Baseline Trap: nvidia-smi showed 95% utilization on 128 H100s, yet true Model FLOPs Utilization (MFU) was only 28%
  • •
    Profiler Findings: 1) periodic multi-millisecond CPU dataloader/tokenization stalls; 2) exposed FSDP AllGather/ReduceScatter waits; 3) unfused RoPE/RMSNorm/CrossEntropy memory-bound kernel launches
  • •
    Optimizations: pre-tokenized streaming shards, FSDP prefetch + bucket tuning for comms overlap, and FlashAttention + Triton fused CrossEntropy (unlocking larger micro-batches)
  • •
    Outcome: lifted MFU from 28% to 52.4%, cutting training wall-clock time and cluster spend by ~46%

📐 Mathematical Derivations

nvidia-smi GPU-Util only measures whether any kernel occupies an SM; true efficiency is measured strictly by MFU against theoretical hardware peak FLOPs.

🏭 Production Trade-offs

Fused chunked CrossEntropy eliminates materializing massive [B, S, V] FP32 logit tensors, saving VRAM without accuracy loss or recomputation overhead.
⚠️ Common Interview Pitfalls
  • ✕
    Trusting nvidia-smi 98% utilization blindly without inspecting Tensor-Core active time and NCCL idle gaps in Nsight
  • ✕
    Enabling full activation checkpointing everywhere even when spare VRAM could hold larger micro-batches
🎯 Interviewer Follow-up Inquiries
  • ?
    How do you pinpoint a single straggler GPU (thermal throttling, PCIe degradation, or IB packet drops) stalling a 128-GPU AllReduce?
  • ?
    What extra MFU gains and numerical-stability pitfalls did you hit when moving from BF16 to FP8 training?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
🎯 Drill This Card Now➔
📚

Associated Knowledge Base Guides & Mindmaps

← PreviousM10-036: AI Infra Deep-Dive: Solving KV Cache Exhaustion & Preemption Thrashing in vLLM📋 Back to BankNext →M10-038: AI Infra Leadership BQ: Resolving Multi-Org GPU Scarcity & Priority Conflicts