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

Feature/sg 541 auto batch selection #628

Merged
merged 11 commits into from
Jan 22, 2023

Conversation

shaydeci
Copy link
Collaborator

@shaydeci shaydeci commented Jan 16, 2023

Auto batch size selection, works out of the box for DDP.

Implemented as a "pre_launch_callback"- new feature needed for this design- upon calling train_from_config, there's often the need to modify the recipe config (for example to scale lr according to the actually number of available gpus).

The callback takes the cfg as an input, and increasingly tries different batch sizes until reaching COOM (or predefined max_batch_size), then optionally adapts the lr.

Additionally, I added the option to not kill the DDP group (needed for the consecutive batch size trial runs).

@dagshub
Copy link

dagshub bot commented Jan 16, 2023

…_batch_selection

# Conflicts:
#	src/super_gradients/training/params.py
#	src/super_gradients/training/sg_trainer/sg_trainer.py
@shaydeci shaydeci marked this pull request as ready for review January 16, 2023 13:22
Copy link
Collaborator

@ofrimasad ofrimasad left a comment

Choose a reason for hiding this comment

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

minor comments

Copy link
Collaborator

@ofrimasad ofrimasad left a comment

Choose a reason for hiding this comment

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

LGTM

@shaydeci shaydeci merged commit 564fb35 into master Jan 22, 2023
@shaydeci shaydeci deleted the feature/SG-541_auto_batch_selection branch January 22, 2023 09:10
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.

None yet

3 participants