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

Dynamic/variable batch size support #16914

Open
HsunGong opened this issue Mar 1, 2023 · 5 comments
Open

Dynamic/variable batch size support #16914

HsunGong opened this issue Mar 1, 2023 · 5 comments
Labels
feature Is an improvement or enhancement

Comments

@HsunGong
Copy link

HsunGong commented Mar 1, 2023

Description & Motivation

Support like:

GPU1: batch-size=24
GPU2: batch-size=12
GPU3: batch-size=16
GPU4: batch-size=24


As different batch has different length

See

microsoft/DeepSpeed#1051

https://github.com/facebookresearch/fairseq/blob/b5a039c292facba9c73f59ff34621ec131d82341/fairseq/data/data_utils.py#L282

Pitch

No response

Alternatives

No response

Additional context

No response

cc @Borda

@HsunGong HsunGong added feature Is an improvement or enhancement needs triage Waiting to be triaged by maintainers labels Mar 1, 2023
@HsunGong
Copy link
Author

Hello

@FarzanT
Copy link

FarzanT commented Apr 24, 2023

Related to #15573

@Lightning-AI Lightning-AI deleted a comment from stale bot Apr 26, 2023
@Borda
Copy link
Member

Borda commented Apr 26, 2023

@HsunGong could you pls share your use case when these various batch sizes could be used? probably if you have a heterogenous set of GPU cards?

@HsunGong
Copy link
Author

HsunGong commented May 6, 2023

For sure, we have 2080ti, 3090, a10, a40 gpu cards, and we want to put dynamic batch size according to the gpu.
We've made it using pytorch-ddp by customizing samplers for each gpu.

@awaelchli awaelchli removed the needs triage Waiting to be triaged by maintainers label Nov 25, 2023
@bm-synth
Copy link

bm-synth commented Mar 11, 2024

if not too late: I started developing dynamic batch size and the corresponding LR scaling on deepspeed in PR 5237. Hopefully it will be enabled with a simple config file change and work out of the box in lightning. Stay tuned, should be done this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement
Projects
None yet
Development

No branches or pull requests

5 participants