kohya-ss / kohya-ss/sd-scripts
Feature request: different batch size per GPU
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.2k
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Description
Assume you have two GPUs: 1x 3090 24GB and 1x 3060 12GB.
When using DDP or DeepSpeed, the 3090 will not be able to use more than 12GB and will not be fully utilized because of this.
Some solutions are discussed for DDP in the following issue (see "Alternatives"): https://github.com/pytorch/pytorch/issues/67253
Another solution is using a custom DistributedSampler: https://discuss.pytorch.org/t/can-ddp-divide-dataset-unevenly-to-workers/146381/4
In constrast to DDP, DeepSpeed does not support this at all at the moment as it seems.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by examining the project's DDP and DeepSpeed integration, then read the linked PyTorch issue and custom DistributedSampler discussion. The issue names no files or tests, so first identify the relevant training entry points and existing batch-size handling. Done would mean supporting different per-GPU batch sizes in DeepSpeed while preserving correct distributed training.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- distributed-systems, machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100