mirror of
https://github.com/storytold/FineTrainers-Conditioning.git
synced 2026-10-09 00:09:45 +00:00
[Docs] : Update README.md (#35)
* Update README.md * Update README.md --------- Co-authored-by: Aryan <contact.aryanvs@gmail.com>
This commit is contained in:
committed by
GitHub
parent
4f2744ee59
commit
a6c246c29d
@@ -61,7 +61,7 @@ Below we provide additional sections detailing on more options explored in this
|
||||
|
||||
Before starting the training, please check whether the dataset has been prepared according to the [dataset specifications](assets/dataset.md). We provide training scripts suitable for text-to-video and image-to-video generation, compatible with the [CogVideoX model family](https://huggingface.co/collections/THUDM/cogvideo-66c08e62f1685a3ade464cce). Training can be started using the `train*.sh` scripts, depending on the task you want to train. Let's take LoRA fine-tuning for text-to-video as an example.
|
||||
|
||||
- Configure environment variables according as per your choice:
|
||||
- Configure environment variables as per your choice:
|
||||
|
||||
```bash
|
||||
export TORCH_LOGS="+dynamo,recompiles,graph_breaks"
|
||||
@@ -184,7 +184,7 @@ Note: Training scripts are untested on MPS, so performance and memory requiremen
|
||||
|
||||
Supported and verified memory optimizations for training include:
|
||||
|
||||
- `CPUOffloadOptimizer` from [`torchao`](https://github.com/pytorch/ao). You can read about its capabilities and limitations [here](https://github.com/pytorch/ao/tree/main/torchao/prototype/low_bit_optim#optimizer-cpu-offload). In short, it allows you to use the CPU for storing trainable parameters and gradients. This results in the optimizer step happening on the CPU, which requires a fast CPU optimizer, such as `torch.optim.AdamW(fused=True)` or applying `torch.compile` on the optimizer step. Additionally, it is recommended to not `torch.compile` your model for training. Gradient clipping and accumulation is not supported yet either.
|
||||
- `CPUOffloadOptimizer` from [`torchao`](https://github.com/pytorch/ao). You can read about its capabilities and limitations [here](https://github.com/pytorch/ao/tree/main/torchao/prototype/low_bit_optim#optimizer-cpu-offload). In short, it allows you to use the CPU for storing trainable parameters and gradients. This results in the optimizer step happening on the CPU, which requires a fast CPU optimizer, such as `torch.optim.AdamW(fused=True)` or applying `torch.compile` on the optimizer step. Additionally, it is recommended not to `torch.compile` your model for training. Gradient clipping and accumulation is not supported yet either.
|
||||
- Low-bit optimizers from [`bitsandbytes`](https://huggingface.co/docs/bitsandbytes/optimizers). TODO: to test and make [`torchao`](https://github.com/pytorch/ao/tree/main/torchao/prototype/low_bit_optim) ones work
|
||||
- DeepSpeed Zero2: Since we rely on `accelerate`, follow [this guide](https://huggingface.co/docs/accelerate/en/usage_guides/deepspeed) to configure your `accelerate` installation to enable training with DeepSpeed Zero2 optimizations.
|
||||
|
||||
@@ -410,7 +410,7 @@ With `train_batch_size = 4`:
|
||||
</details>
|
||||
|
||||
> [!NOTE]
|
||||
> - `memory_after_validation` is indicative of the peak memory required for training. This is because apart from the activations, parameters and gradients stored for training, you also need to load the vae and text encoder in memory and spend some memory to perform inference. In order to reduce total memory required to perform training, one can choose to not perform validation/testing as part of the training script.
|
||||
> - `memory_after_validation` is indicative of the peak memory required for training. This is because apart from the activations, parameters and gradients stored for training, you also need to load the vae and text encoder in memory and spend some memory to perform inference. In order to reduce total memory required to perform training, one can choose not to perform validation/testing as part of the training script.
|
||||
>
|
||||
> - `memory_before_validation` is the true indicator of the peak memory required for training if you choose to not perform validation/testing.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user