stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Is it possible to implement Accelerate from Hugging Face for training?

Open Omegadarling opened this issue 1 year ago • 4 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues and checked the recent builds/commits

What would your feature do ?

Hugging Face created a library for training models with multiple GPUs and I have a few machines with multiple GPUs, including one with 10 x 3090s so I'd love to leverage all that power.

Proposed workflow

  1. Go to Train tab
  2. Check a box that says "use Accelerate library"
  3. Waste less time

Additional information

Here's the link to Accelerate: https://huggingface.co/docs/transformers/accelerate

Omegadarling avatar Jan 06 '23 02:01 Omegadarling

I thought it is there already?

https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/066390eb5683945a6e094a817584ada6b1f7118e/webui.sh#L158-L163

wfjsw avatar Jan 06 '23 05:01 wfjsw

accelerate was added as an optional toggle for dreambooth extension, not for textual inversion or hypernetwork I believe.

ClashSAN avatar Jan 06 '23 05:01 ClashSAN

@ClashSAN

accelerate was added as an optional toggle for dreambooth extension, not for textual inversion or hypernetwork I believe.

I use Dreambooth all the time and I've never seen that option. Is it something in the script but not in the GUI?

Omegadarling avatar Jan 06 '23 06:01 Omegadarling

https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/0d098e46568a268180974953fe2783fff1333040

Is it something in the script but not in the GUI?

that's likely. diffusers library will usually ask if you want to run with accelerate option. it should just work once installed, but its better to confirm on their extensions page.

I don't know the answer because I haven't used dreambooth extension

ClashSAN avatar Jan 06 '23 06:01 ClashSAN

set ACCELERATE="True" in webui-user.bat doesn't install the necessary stuff automatically. I did manually install it and create the config file, but all kinds of WARNING: Ignoring invalid distribution -celerate (c:\stable-diffusion-webui\venv\lib\site-packages) when I try to run Accelerate. It works again if I remove the set ACCELERATE="True" , so what's the deal with Accelerate?

Here's a copy of what happens after I add set ACCELERATE="True" log.txt

Omegadarling avatar Jan 07 '23 22:01 Omegadarling

I'm not sure what I need to fix to get Accelerate to work. Here's another log, possibly with more info, possibly pretty much the same. Is there a WIKI to explain the proper way to use Accelerate with Automatic1111? SD_accelerateTrue_log_2023-01-11-1743.txt

Omegadarling avatar Jan 11 '23 22:01 Omegadarling

I decided to run pip install -r .\requirements.txt and try running with set ACCELERATE="True" again and now I'm getting new errors, and yet somehow it seems like this is progress. Here's my powershell log: SD_accelerateTrue_log_2023-01-11-1823.txt

I can't tell what matters, but the first error it throws is NOTE: Redirects are currently not supported in Windows or MacOs.

Omegadarling avatar Jan 11 '23 23:01 Omegadarling