How does increasing the batch size affect wall-clock training time?

Quick Overview

Asks how a larger batch size changes the wall-clock time needed to reach a target loss. Tests the split into steps and time per step, hardware saturation, the critical batch size, data-parallel communication, and gradient accumulation.

How does increasing the batch size affect wall-clock training time?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

How does increasing the batch size affect wall-clock training time? Consider the time to reach a target loss, not the time per epoch. ```hint Two factors Write the time to reach a target loss as the number of steps needed times the time per step, and ask how each factor changes with the batch size. ``` ```hint Fixed or growing hardware Treat two cases separately: one GPU that is already fully used, and a cluster where you add devices as the batch grows. ``` ### What a Strong Answer Covers - Wall-clock time to a target as steps needed times time per step - How time per step changes with batch size before and after the hardware saturates - How the number of steps changes with batch size, and what the critical batch size is - The difference between fixed hardware and adding devices, including communication cost - Practical caveats such as learning rate scaling, gradient accumulation, memory and final accuracy ### Follow-up Questions - How would you estimate the critical batch size for a model before running a large sweep? - When you double the batch size, how should you change the learning rate and warmup? - Why can gradient accumulation help a communication-bound data-parallel job but not a single-GPU job? - Does the critical batch size stay fixed over the course of training?

Overview: Asks how a larger batch size changes the wall-clock time needed to reach a target loss. Tests the split into steps and time per step, hardware saturation, the critical batch size, data-parallel communication, and gradient accumulation.

General logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

How does increasing the batch size affect wall-clock training time? Consider the time to reach a target loss, not the time per epoch.

What a Strong Answer Covers Guidance

  • Wall-clock time to a target as steps needed times time per step
  • How time per step changes with batch size before and after the hardware saturates
  • How the number of steps changes with batch size, and what the critical batch size is
  • The difference between fixed hardware and adding devices, including communication cost
  • Practical caveats such as learning rate scaling, gradient accumulation, memory and final accuracy

Follow-up Questions Guidance

  • How would you estimate the critical batch size for a model before running a large sweep?
  • When you double the batch size, how should you change the learning rate and warmup?
  • Why can gradient accumulation help a communication-bound data-parallel job but not a single-GPU job?
  • Does the critical batch size stay fixed over the course of training?