From 8178c840f265d4bee91fe9cf9fdd6dfef091a720 Mon Sep 17 00:00:00 2001 From: Pedro Cuenca Date: Mon, 6 Feb 2023 11:19:26 +0100 Subject: [PATCH] Mention training problems with xFormers 0.0.16 (#2254) --- docs/source/en/optimization/xformers.mdx | 6 ++++++ examples/text_to_image/README.md | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/source/en/optimization/xformers.mdx b/docs/source/en/optimization/xformers.mdx index 551b8b0686..15c62fe880 100644 --- a/docs/source/en/optimization/xformers.mdx +++ b/docs/source/en/optimization/xformers.mdx @@ -27,3 +27,9 @@ The xFormers PIP package requires the latest version of PyTorch (1.13.1 as of xF After xFormers is installed, you can use `enable_xformers_memory_efficient_attention()` for faster inference and reduced memory consumption, as discussed [here](fp16#memory-efficient-attention). + + + +According to [this issue](https://github.com/huggingface/diffusers/issues/2234#issuecomment-1416931212), xFormers `v0.0.16` cannot be used for training (fine-tune or Dreambooth) in some GPUs. If you observe that problem, please install a development version as indicated in that comment. + + diff --git a/examples/text_to_image/README.md b/examples/text_to_image/README.md index 965e2f2494..92de067f79 100644 --- a/examples/text_to_image/README.md +++ b/examples/text_to_image/README.md @@ -235,5 +235,12 @@ python train_text_to_image_flax.py \ --output_dir="sd-pokemon-model" ``` -### Training with xformers: -You can enable memory efficient attention by [installing xFormers](https://github.com/facebookresearch/xformers#installing-xformers) and padding the `--enable_xformers_memory_efficient_attention` argument to the script. This is not available with the Flax/JAX implementation. +### Training with xFormers: + +You can enable memory efficient attention by [installing xFormers](https://huggingface.co/docs/diffusers/main/en/optimization/xformers) and passing the `--enable_xformers_memory_efficient_attention` argument to the script. + +xFormers training is not available for Flax/JAX. + +**Note**: + +According to [this issue](https://github.com/huggingface/diffusers/issues/2234#issuecomment-1416931212), xFormers `v0.0.16` cannot be used for training in some GPUs. If you observe that problem, please install a development version as indicated in that comment.