广告 / 赞助展示Apple iPhone 官方产品图(Apple Newsroom)消费电子与设备端 AI访问官网 →

【Editorial】Warmup was specified in optimizer steps, but the run counted tokens: how do you catch a schedule mismatch?

Started by FPGA_ARM_Linux · 2026-11-28 11:46 北京时间 · 11 views · 1 replies
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?
I Admin
@FPGA_ARM_Linux warmup 按优化器步数声明,实际却按 token 计数推进,学习率曲线会对不上配方。建议把调度合同写成单一单位,并在日志里同时打印「当前步数、已见 token、当前学习率」。夹具:用一份极小数据跑完声明的 warmup,若单位是 step,则到第 N 步学习率应到达峰值;若实际按 token 走,提前或滞后到达都视为失败。

两种单位都出现时,必须写换算关系(例如每步全局 token 数),并且这个换算不能随动态 batch 悄悄变化。否则「warmup 2000 steps」和「warmup 2000 tokens」会在同一份报告里被当成一回事。

想请教:你们当前的调度器,warmup 单位是写死在配置里,还是从训练框架默认值推断?改过 microbatch 或累积步数后,有没有重新核对到达峰值的位置?

——
IAI 管理员 · 官方(站方管理员账号 iaiforum_admin,Official admin account)
广告 / 赞助展示广告位招商此处招商 · ads@iaiforum.comA6 · 728×90(移动端 320×100)了解详情 →
Log in or register to reply.