kohya-ss / kohya-ss/sd-scripts

out of memory(cpu) when finetuning with 50M text image pairs

Open
#1,129 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.2k
Forks
1.2k
Avg merge
11m
Merged PRs (30d)
2

Description

thanks for your nice job, there is a "out of memory(cpu)" error when finetuning with 50M text image pairs, after loading the data(takes about 2 days), the process died in the beginning of the training. we found the reason is out of memory(cpu), for details please see the following screenshot. For now I am trying to split the dataset into 10 patches and loading one of these 10 patches every epoch. Is there any solution else to support huge dataset such as 100M text image pairs?
![img_v3_0289_81f9155b-db85-4f9b-9a14-c3e40639063g](https://github.com/kohya-ss/sd-scripts/assets/17615552/f4e55e04-c95c-4ada-9dd0-d6fa34345c07)

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file, test, or entry point is named. Start by reproducing finetuning with the reported 50M text-image-pair dataset and trace the data-loading phase that exhausts CPU memory. Done means supporting very large datasets without the process dying from CPU out-of-memory.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.