Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bind max steps and lr iterations #67

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

Rilwan-Adewoyin
Copy link
Member

@Rilwan-Adewoyin Rilwan-Adewoyin commented Sep 30, 2024

Context & Current Setup:

  • User defines training.lr.iterations which effects how many steps the model learns for
  • However, this often does not align with the training.max_epochs value which is often larger
  • GPU hours potentially wasted as max_epochs =/= training.lr.iterations
  • Alternatively unexpected results from training length not aligning to iteration schedule behaviour

Changes Aim to tie training.lr.iterations to the training length

  1. Change default method to control run length to be by training.max_steps instead of training.max_epochs
  2. Changed default setting in config such that training.lr.iterations defaults to training.max_steps
  3. User now defines training.max_steps in order to define length of training
  4. User still has the optionality

@FussyDuck
Copy link

FussyDuck commented Sep 30, 2024

CLA assistant check
All committers have signed the CLA.

CHANGELOG.md Outdated Show resolved Hide resolved
mchantry
mchantry previously approved these changes Oct 9, 2024
Copy link
Member

@mchantry mchantry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I will run it by the ATS. Don't merge yet.

# Set max_epochs or max_steps. Training stops at the first limit reached.
max_epochs: null
max_steps: 150000

lr:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having this functionality it's great, so thanks @Rilwan-Adewoyin for implementing it!
just a quick question, what happens when/if they user pass both max_steps and max_epochs? will the code then run until max_epochs is reached and the scheduler used the max_steps?
My two cents here is that probably it could be nice to add some logger info to indicate this!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey thanks,
So the default pytorch lightning behaviour is that the code will run until the smallest of max_steps or max_epochs is reached, but the scheduler will be aligned to max_steps.

Yep that sounds like a good idea, so add a logger.info message when the user sets both

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.

4 participants