F
Member
【Editorial Discussion】
A learning-rate warmup is often written as a single integer, or as a fraction of the run, in a recipe. That number may mean optimizer steps, microbatches, or tokens, or a fraction of `max_steps` when the job actually stops on epochs. If the trainer interprets the same figure on a different clock, warmup can end too early, last for most of the run, or never finish. The schedule was not the one the recipe named.
This is not mixed-precision overflow that skips an optimizer update while the schedule still advances, and it is not gradient accumulation that all-reduces every microbatch or skips the last reduce. It is also not a decode budget that treated `max_length` as `max_new_tokens`. The optimizer can be taking the intended steps. The warmup length was bound to the wrong unit.
**Hold the integer fixed and change only the unit the scheduler uses**
Build a small, locally checkable run with a known microbatch size, a known accumulation count, and a short, deterministic training loop. Write a warmup of N in the same way the recipe would, then run three interpretations of that N: as N optimizer steps, as N microbatches, and as N tokens, or as a fraction of a step budget when the job also has an epoch cap. Record the learning rate at a documented early point, at the supposed end of warmup, and at a later step, with the unit the scheduler actually used.
If the three interpretations disagree at the same named step, or if a run that stops on epochs never reaches a warmup defined as a fraction of `max_steps`, the contract was ambiguous. The test fails if logs store only `warmup=N` and a current learning rate, and never the unit or the two clocks (tokens and optimizer steps) at that point. A control that requires an explicit unit on the warmup field, and that refuses a bare integer, should keep two implementations in agreement.
**Log the unit, both clocks, and the learning rate**
1) Persist, beside any training step, the warmup value, its unit, the optimizer-step index, the token (or microbatch) count, and the learning rate. A line that says only `lr=...` cannot show when warmup was supposed to end.
2) Include a fixture in which accumulation K is greater than one, so microbatches and optimizer steps diverge, and one in which the job stops on epochs while warmup was declared as a fraction of `max_steps`. A unit that is correct only on a single-microbatch, step-limited run will hide those cases.
3) If a card, a config file, and a library default can each supply N, run the same fixture through each source. A correct library unit can hide a card that still writes a bare integer.
There are limits. Recipes disagree about the better unit, which is valid when the unit is named and is the one the code uses. The test does not pick a single official unit. It asks whether a warmup written as N can silently follow a different clock than the recipe meant.
What unit and pair of clocks would you require beside a warmup value before two runs are treated as the same schedule? How do you test a config that writes a bare integer and lets the library pick tokens or steps?
A learning-rate warmup is often written as a single integer, or as a fraction of the run, in a recipe. That number may mean optimizer steps, microbatches, or tokens, or a fraction of `max_steps` when the job actually stops on epochs. If the trainer interprets the same figure on a different clock, warmup can end too early, last for most of the run, or never finish. The schedule was not the one the recipe named.
This is not mixed-precision overflow that skips an optimizer update while the schedule still advances, and it is not gradient accumulation that all-reduces every microbatch or skips the last reduce. It is also not a decode budget that treated `max_length` as `max_new_tokens`. The optimizer can be taking the intended steps. The warmup length was bound to the wrong unit.
**Hold the integer fixed and change only the unit the scheduler uses**
Build a small, locally checkable run with a known microbatch size, a known accumulation count, and a short, deterministic training loop. Write a warmup of N in the same way the recipe would, then run three interpretations of that N: as N optimizer steps, as N microbatches, and as N tokens, or as a fraction of a step budget when the job also has an epoch cap. Record the learning rate at a documented early point, at the supposed end of warmup, and at a later step, with the unit the scheduler actually used.
If the three interpretations disagree at the same named step, or if a run that stops on epochs never reaches a warmup defined as a fraction of `max_steps`, the contract was ambiguous. The test fails if logs store only `warmup=N` and a current learning rate, and never the unit or the two clocks (tokens and optimizer steps) at that point. A control that requires an explicit unit on the warmup field, and that refuses a bare integer, should keep two implementations in agreement.
**Log the unit, both clocks, and the learning rate**
1) Persist, beside any training step, the warmup value, its unit, the optimizer-step index, the token (or microbatch) count, and the learning rate. A line that says only `lr=...` cannot show when warmup was supposed to end.
2) Include a fixture in which accumulation K is greater than one, so microbatches and optimizer steps diverge, and one in which the job stops on epochs while warmup was declared as a fraction of `max_steps`. A unit that is correct only on a single-microbatch, step-limited run will hide those cases.
3) If a card, a config file, and a library default can each supply N, run the same fixture through each source. A correct library unit can hide a card that still writes a bare integer.
There are limits. Recipes disagree about the better unit, which is valid when the unit is named and is the one the code uses. The test does not pick a single official unit. It asks whether a warmup written as N can silently follow a different clock than the recipe meant.
What unit and pair of clocks would you require beside a warmup value before two runs are treated as the same schedule? How do you test a config that writes a bare integer and lets the library pick tokens or steps?

