Upload folder using huggingface_hub
Browse files
configs/accelerate_config.yaml
CHANGED
|
@@ -1,10 +1,14 @@
|
|
| 1 |
-
# Flux LoRA Fine-tuning Config
|
| 2 |
-
# Run with: accelerate launch --config_file configs/accelerate_config.yaml scripts/training/
|
| 3 |
|
| 4 |
compute_environment: LOCAL_MACHINE
|
| 5 |
-
distributed_type:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
num_machines: 1
|
| 7 |
-
num_processes:
|
| 8 |
mixed_precision: bf16
|
| 9 |
gpu_ids: all
|
| 10 |
use_cpu: false
|
|
|
|
| 1 |
+
# Flux LoRA Fine-tuning Config - DeepSpeed ZeRO-3
|
| 2 |
+
# Run with: accelerate launch --config_file configs/accelerate_config.yaml scripts/training/train_flux_deepspeed.py
|
| 3 |
|
| 4 |
compute_environment: LOCAL_MACHINE
|
| 5 |
+
distributed_type: DEEPSPEED
|
| 6 |
+
deepspeed_config:
|
| 7 |
+
deepspeed_config_file: /home/adminuser/chungcat/configs/deepspeed_zero3.json
|
| 8 |
+
zero3_init_flag: true
|
| 9 |
+
zero3_save_16bit_model: true
|
| 10 |
num_machines: 1
|
| 11 |
+
num_processes: 2
|
| 12 |
mixed_precision: bf16
|
| 13 |
gpu_ids: all
|
| 14 |
use_cpu: false
|
configs/deepspeed_zero3.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bf16": {
|
| 3 |
+
"enabled": true
|
| 4 |
+
},
|
| 5 |
+
"zero_optimization": {
|
| 6 |
+
"stage": 3,
|
| 7 |
+
"overlap_comm": true,
|
| 8 |
+
"contiguous_gradients": true,
|
| 9 |
+
"reduce_bucket_size": 5e7,
|
| 10 |
+
"stage3_prefetch_bucket_size": 4e7,
|
| 11 |
+
"stage3_param_persistence_threshold": 1e5,
|
| 12 |
+
"stage3_gather_16bit_weights_on_model_save": true,
|
| 13 |
+
"sub_group_size": 1e9
|
| 14 |
+
},
|
| 15 |
+
"gradient_accumulation_steps": 4,
|
| 16 |
+
"gradient_clipping": 1.0,
|
| 17 |
+
"train_micro_batch_size_per_gpu": 4,
|
| 18 |
+
"wall_clock_breakdown": false
|
| 19 |
+
}
|