Model and Inference EngineeringTraining execution and recoveryStaff
How should learning-rate progress behave when mixed-precision overflow skips an optimizer update?
By Amit Kumar3 min readWorked answer includedReviewed 28 Sept 2026
The question
Interview question
A mixed-precision trainer calls its scaler and learning-rate scheduler for every accumulated batch. On overflow, the scaler skips the underlying weight update but the scheduler advances. Explain when this changes the intended recipe, which counters should be authoritative, and how to test resume behavior after a skipped update. Consider both update-based and token-based schedules.
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
The learning-rate scheduler decides the size of future updates using a progress counter. That counter must have a defined meaning. Suppose, hypothetically, warmup lasts 100 successful updates. After 80 real updates and 20 overflow skips, advancing once per attempted batch ends warmup even though only 80 updates occurred. A token-budget schedule might intentionally count those consumed batches, but that is a different contract. The same number on a dashboard cannot stand for both.
It depends on what “step” means in the schedule, but a recipe defined by successful optimizer updates has drifted. The learning rate may warm up or decay without the corresponding weight update. An early run of overflows can exhaust a meaningful part of warmup before training has taken those steps. PyTorch's AMP examples explain that GradScaler may skip optimizer.step() if it finds nonfinite gradients, and the optimizer scheduler guidance addresses optimizer and scheduler call ordering. Calling a scaler wrapper is not proof that an optimizer update occurred.
I would log at least three counters: batches consumed, backward or accumulation windows attempted, and committed optimizer updates. Add skipped-overflow counts, effective tokens used for each update, current scale and learning rate. Trace which counter feeds the scheduler, checkpoint naming, evaluation cadence and resume logic. In distributed training, all ranks must agree whether a step committed, and any schedule state must advance consistently. One training rank has nonfinite gradients while the global loss looks normal. Can the step commit? asks whether a nonfinite distributed step should commit. Here we are examining all the other state that may advance even when it did not.
If the intended schedule is tokens seen rather than successful updates, advancing after a skipped optimizer step may be an explicit choice. Then say so and check whether tokens that produced no update should count toward that budget. Schedules based on wall time, tokens and optimizer updates answer different questions. A training team should not move between them by accident when changing AMP behavior. For a committed-update schedule, call the scheduler only when the optimizer actually ran. Use an authoritative success signal supported by the framework, rather than guessing from a scaler value that may change for other reasons across versions.
How do we test it? Force a controlled nonfinite gradient in one accumulation window, verify that model and optimizer state do not change, and verify the scheduler and successful-step counter behave according to the chosen recipe. Resume from a checkpoint after that skipped window and compare the subsequent learning rates and updates. A loss curve alone may not reveal this, since many runs tolerate small schedule differences. The bug matters most during warmup, frequent overflows, or tight token budgets where skipped steps are not rare.
Related questions
Keep practising model and inference engineering
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux