Skip to content

Warm up Apollo groups toward their own learning rates - #569

Open
Afloat16 wants to merge 1 commit into
jettify:masterfrom
Afloat16:fix/apollo-group-warmup-rates-20261112
Open

Afloat16 wants to merge 1 commit into
jettify:masterfrom
Afloat16:fix/apollo-group-warmup-rates-20261112

Conversation

@Afloat16

Copy link
Copy Markdown

Problem

Apollo initializes base_lr in the shared defaults from the constructor's global learning rate. A parameter group with its own lr therefore warms up toward a different rate from the one it will use after warmup. Newly added groups inherit the same incorrect target.

For a group with lr=0.1 and global lr=0.01, warmup=2 and init_lr=0.001, two unit-gradient steps from 1.0 produce approximately 0.9935 instead of the independent-optimizer result 0.9485.

Change

Initialize base_lr when each group is registered, after defaults have been applied, using that group's effective lr. Explicit group base_lr values are preserved. The warmup schedule and update equations are unchanged.

Validation

Python 3.12.14, PyTorch 2.15.0+cpu:

  • New tests: 5 failed / 10 passed before; 15 passed after. Grouped trajectories match independent optimizers for list/generator inputs, different rate orders and warmup lengths, newly added groups, and explicit base rates preserved through actual checkpoint restoration.
  • The existing Apollo neural-network convergence test passes before and after.
  • Changed files pass Black 23.3.0, isort 5.9.3, pycodestyle, pyflakes, and git diff --check.

Validation covers the listed CPU cases; CUDA and the full optimizer test suite were not run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant