Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .DS_Store +0 -0
- .gitattributes +3 -0
- 852/.DS_Store +0 -0
- 852/20250411_21-03-36/epoch1/.adapter_model.safetensors.UkAnlj +3 -0
- 852/20250411_21-03-36/epoch1/adapter_config.json +38 -0
- 852/20250411_21-03-36/events.out.tfevents.1744405901.ip-172-31-72-18.ec2.internal.688981.0 +3 -0
- 852/20250411_21-03-36/latest +1 -0
- 852/20250411_21-03-36/main_example.toml +112 -0
- epoch1/adapter_config.json +38 -0
- epoch1/adapter_model.safetensors +3 -0
- epoch1/main_example.toml +112 -0
- epoch10/adapter_config.json +38 -0
- epoch10/adapter_model.safetensors +3 -0
- epoch10/main_example.toml +112 -0
- epoch11/adapter_config.json +38 -0
- epoch11/adapter_model.safetensors +3 -0
- epoch11/main_example.toml +112 -0
- epoch12/adapter_config.json +38 -0
- epoch12/adapter_model.safetensors +3 -0
- epoch12/main_example.toml +112 -0
- epoch13/adapter_config.json +38 -0
- epoch13/adapter_model.safetensors +3 -0
- epoch13/main_example.toml +112 -0
- epoch14/adapter_config.json +38 -0
- epoch14/adapter_model.safetensors +3 -0
- epoch14/main_example.toml +112 -0
- epoch15/adapter_config.json +38 -0
- epoch15/adapter_model.safetensors +3 -0
- epoch15/main_example.toml +112 -0
- epoch16/adapter_config.json +38 -0
- epoch16/adapter_model.safetensors +3 -0
- epoch16/main_example.toml +112 -0
- epoch2/.adapter_model.safetensors.xd7wPd +3 -0
- epoch2/adapter_config.json +38 -0
- epoch2/adapter_model.safetensors +3 -0
- epoch2/main_example.toml +112 -0
- epoch3/adapter_config.json +38 -0
- epoch3/adapter_model.safetensors +3 -0
- epoch3/main_example.toml +112 -0
- epoch4/adapter_config.json +38 -0
- epoch4/adapter_model.safetensors +3 -0
- epoch4/main_example.toml +112 -0
- epoch5/adapter_config.json +38 -0
- epoch5/adapter_model.safetensors +3 -0
- epoch5/main_example.toml +112 -0
- epoch6/adapter_config.json +38 -0
- epoch6/adapter_model.safetensors +3 -0
- epoch6/main_example.toml +112 -0
- epoch7/adapter_config.json +38 -0
- epoch7/adapter_model.safetensors +3 -0
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
.gitattributes
CHANGED
|
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
852/20250411_21-03-36/epoch1/.adapter_model.safetensors.UkAnlj filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
epoch2/.adapter_model.safetensors.xd7wPd filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
global_step26/.mp_rank_00_model_states.pt.xawzDB filter=lfs diff=lfs merge=lfs -text
|
852/.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
852/20250411_21-03-36/epoch1/.adapter_model.safetensors.UkAnlj
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3374512ed4a2aab4ecb618826444b294ebe506807a8de17813267270fc315dbd
|
| 3 |
+
size 78643200
|
852/20250411_21-03-36/epoch1/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": null,
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": false,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 48,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 48,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"k",
|
| 28 |
+
"ffn.0",
|
| 29 |
+
"o",
|
| 30 |
+
"v",
|
| 31 |
+
"ffn.2",
|
| 32 |
+
"q"
|
| 33 |
+
],
|
| 34 |
+
"task_type": null,
|
| 35 |
+
"trainable_token_indices": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
852/20250411_21-03-36/events.out.tfevents.1744405901.ip-172-31-72-18.ec2.internal.688981.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ae71113042cbe90e21b8e468f8ed264b08656067012910351934fc5e34b53ede
|
| 3 |
+
size 2410
|
852/20250411_21-03-36/latest
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
global_step45
|
852/20250411_21-03-36/main_example.toml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Output path for training runs. Each training run makes a new directory in here.
|
| 2 |
+
output_dir = '/data/diffusion_pipe_training_runs/852'
|
| 3 |
+
|
| 4 |
+
# Dataset config file.
|
| 5 |
+
dataset = '/data/shiv/diffusion-pipe/examples/852_dataset.toml'
|
| 6 |
+
# You can have separate eval datasets. Give them a name for Tensorboard metrics.
|
| 7 |
+
# eval_datasets = [
|
| 8 |
+
# {name = 'something', config = 'path/to/eval_dataset.toml'},
|
| 9 |
+
# ]
|
| 10 |
+
|
| 11 |
+
# training settings
|
| 12 |
+
|
| 13 |
+
# I usually set this to a really high value because I don't know how long I want to train.
|
| 14 |
+
epochs = 3
|
| 15 |
+
# Batch size of a single forward/backward pass for one GPU.
|
| 16 |
+
micro_batch_size_per_gpu = 16
|
| 17 |
+
# Pipeline parallelism degree. A single instance of the model is divided across this many GPUs.
|
| 18 |
+
pipeline_stages = 1
|
| 19 |
+
# Number of micro-batches sent through the pipeline for each training step.
|
| 20 |
+
# If pipeline_stages > 1, a higher GAS means better GPU utilization due to smaller pipeline bubbles (where GPUs aren't overlapping computation).
|
| 21 |
+
gradient_accumulation_steps = 8
|
| 22 |
+
# Grad norm clipping.
|
| 23 |
+
gradient_clipping = 1.0
|
| 24 |
+
# Learning rate warmup.
|
| 25 |
+
warmup_steps = 5
|
| 26 |
+
|
| 27 |
+
# Block swapping is supported for Wan, HunyuanVideo, Flux, and Chroma. This value controls the number
|
| 28 |
+
# of blocks kept offloaded to RAM. Increasing it lowers VRAM use, but has a performance penalty. The
|
| 29 |
+
# exactly performance penalty depends on the model and the type of training you are doing (e.g. images vs video).
|
| 30 |
+
# Block swapping only works for LoRA training, and requires pipeline_stages=1.
|
| 31 |
+
blocks_to_swap = 24
|
| 32 |
+
|
| 33 |
+
# eval settings
|
| 34 |
+
|
| 35 |
+
eval_every_n_epochs = 1
|
| 36 |
+
eval_before_first_step = false
|
| 37 |
+
# Might want to set these lower for eval so that less images get dropped (eval dataset size is usually much smaller than training set).
|
| 38 |
+
# Each size bucket of images/videos is rounded down to the nearest multiple of the global batch size, so higher global batch size means
|
| 39 |
+
# more dropped images. Usually doesn't matter for training but the eval set is much smaller so it can matter.
|
| 40 |
+
eval_micro_batch_size_per_gpu = 1
|
| 41 |
+
eval_gradient_accumulation_steps = 1
|
| 42 |
+
# If using block swap, you can disable it for eval. Eval uses less memory, so depending on block swapping amount you can maybe get away with
|
| 43 |
+
# doing this, and then eval is much faster.
|
| 44 |
+
disable_block_swap_for_eval = true
|
| 45 |
+
|
| 46 |
+
# misc settings
|
| 47 |
+
|
| 48 |
+
# Probably want to set this a bit higher if you have a smaller dataset so you don't end up with a million saved models.
|
| 49 |
+
save_every_n_epochs = 1
|
| 50 |
+
# Can checkpoint the training state every n number of epochs or minutes. Set only one of these. You can resume from checkpoints using the --resume_from_checkpoint flag.
|
| 51 |
+
#checkpoint_every_n_epochs = 1
|
| 52 |
+
checkpoint_every_n_minutes = 60
|
| 53 |
+
# Always set to true unless you have a huge amount of VRAM.
|
| 54 |
+
# This can also be 'unsloth' to reduce VRAM even more, with a slight performance hit.
|
| 55 |
+
activation_checkpointing = true
|
| 56 |
+
|
| 57 |
+
# Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
|
| 58 |
+
partition_method = 'parameters'
|
| 59 |
+
# Alternatively you can use 'manual' in combination with partition_split, which specifies the split points for dividing
|
| 60 |
+
# layers between GPUs. For example, with two GPUs, partition_split=[10] puts layers 0-9 on GPU 0, and the rest on GPU 1.
|
| 61 |
+
# With three GPUs, partition_split=[10, 20] puts layers 0-9 on GPU 0, layers 10-19 on GPU 1, and the rest on GPU 2.
|
| 62 |
+
# Length of partition_split must be pipeline_stages-1.
|
| 63 |
+
#partition_split = [N]
|
| 64 |
+
|
| 65 |
+
# dtype for saving the LoRA or model, if different from training dtype
|
| 66 |
+
save_dtype = 'bfloat16'
|
| 67 |
+
# If experiencing CUDA OOM errors with memory fragmentation, set this env var: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 68 |
+
# Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
|
| 69 |
+
caching_batch_size = 8
|
| 70 |
+
# How often deepspeed logs to console.
|
| 71 |
+
steps_per_print = 100
|
| 72 |
+
# How to extract video clips for training from a single input video file.
|
| 73 |
+
# The video file is first assigned to one of the configured frame buckets, but then we must extract one or more clips of exactly the right
|
| 74 |
+
# number of frames for that bucket.
|
| 75 |
+
# single_beginning: one clip starting at the beginning of the video
|
| 76 |
+
# single_middle: one clip from the middle of the video (cutting off the start and end equally)
|
| 77 |
+
# multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
|
| 78 |
+
# default is single_beginning
|
| 79 |
+
video_clip_mode = 'single_beginning'
|
| 80 |
+
|
| 81 |
+
# This is how you configure HunyuanVideo. Other models will be different. See docs/supported_models.md for
|
| 82 |
+
# details on the configuration and options for each model.
|
| 83 |
+
[model]
|
| 84 |
+
type = 'wan'
|
| 85 |
+
ckpt_path = '/data/shiv/diffusion-pipe/models/wan1.3'
|
| 86 |
+
# Base dtype used for all models.
|
| 87 |
+
dtype = 'bfloat16'
|
| 88 |
+
# Wan supports fp8 for the transformer when training LoRA.
|
| 89 |
+
# transformer_dtype = 'float8'
|
| 90 |
+
# How to sample timesteps to train on. Can be logit_normal or uniform.
|
| 91 |
+
timestep_sample_method = 'logit_normal'
|
| 92 |
+
|
| 93 |
+
# For models that support full fine tuning, simply delete or comment out the [adapter] table to FFT.
|
| 94 |
+
[adapter]
|
| 95 |
+
type = 'lora'
|
| 96 |
+
# Dtype for the LoRA weights you are training.
|
| 97 |
+
dtype = 'bfloat16'
|
| 98 |
+
# LoRA rank - determines capacity to learn (higher = more capacity, more VRAM usage)
|
| 99 |
+
rank = 48
|
| 100 |
+
|
| 101 |
+
# Higher rank = more capacity to learn but uses more VRAM and may overfit
|
| 102 |
+
# The alpha value (scaling factor) is automatically set equal to rank in this codebase
|
| 103 |
+
# You can initialize the lora weights from a previously trained lora.
|
| 104 |
+
init_from_existing = '/data/diffusion_pipe_training_runs/640/20250411_15-20-06/epoch3'
|
| 105 |
+
|
| 106 |
+
[optimizer]
|
| 107 |
+
# AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
|
| 108 |
+
# Look at train.py for other options. You could also easily edit the file and add your own.
|
| 109 |
+
type = 'adamw_optimi'
|
| 110 |
+
lr = 1e-5
|
| 111 |
+
betas = [0.9, 0.99]
|
| 112 |
+
weight_decay = 0.01
|
epoch1/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": null,
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": false,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 48,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 48,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"ffn.0",
|
| 28 |
+
"v",
|
| 29 |
+
"q",
|
| 30 |
+
"o",
|
| 31 |
+
"k",
|
| 32 |
+
"ffn.2"
|
| 33 |
+
],
|
| 34 |
+
"task_type": null,
|
| 35 |
+
"trainable_token_indices": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
epoch1/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5cf46892854e655cf605c49400b34350e8111bc5ff3c528b7d383d53bc71a7a2
|
| 3 |
+
size 131309776
|
epoch1/main_example.toml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Output path for training runs. Each training run makes a new directory in here.
|
| 2 |
+
output_dir = '/data/diffusion_pipe_training_runs/852'
|
| 3 |
+
|
| 4 |
+
# Dataset config file.
|
| 5 |
+
dataset = '/data/shiv/diffusion-pipe/examples/852_dataset.toml'
|
| 6 |
+
# You can have separate eval datasets. Give them a name for Tensorboard metrics.
|
| 7 |
+
# eval_datasets = [
|
| 8 |
+
# {name = 'something', config = 'path/to/eval_dataset.toml'},
|
| 9 |
+
# ]
|
| 10 |
+
|
| 11 |
+
# training settings
|
| 12 |
+
|
| 13 |
+
# I usually set this to a really high value because I don't know how long I want to train.
|
| 14 |
+
epochs = 1000
|
| 15 |
+
# Batch size of a single forward/backward pass for one GPU.
|
| 16 |
+
micro_batch_size_per_gpu = 16
|
| 17 |
+
# Pipeline parallelism degree. A single instance of the model is divided across this many GPUs.
|
| 18 |
+
pipeline_stages = 1
|
| 19 |
+
# Number of micro-batches sent through the pipeline for each training step.
|
| 20 |
+
# If pipeline_stages > 1, a higher GAS means better GPU utilization due to smaller pipeline bubbles (where GPUs aren't overlapping computation).
|
| 21 |
+
gradient_accumulation_steps = 8
|
| 22 |
+
# Grad norm clipping.
|
| 23 |
+
gradient_clipping = 1.0
|
| 24 |
+
# Learning rate warmup.
|
| 25 |
+
warmup_steps = 5
|
| 26 |
+
|
| 27 |
+
# Block swapping is supported for Wan, HunyuanVideo, Flux, and Chroma. This value controls the number
|
| 28 |
+
# of blocks kept offloaded to RAM. Increasing it lowers VRAM use, but has a performance penalty. The
|
| 29 |
+
# exactly performance penalty depends on the model and the type of training you are doing (e.g. images vs video).
|
| 30 |
+
# Block swapping only works for LoRA training, and requires pipeline_stages=1.
|
| 31 |
+
blocks_to_swap = 24
|
| 32 |
+
|
| 33 |
+
# eval settings
|
| 34 |
+
|
| 35 |
+
eval_every_n_epochs = 1
|
| 36 |
+
eval_before_first_step = false
|
| 37 |
+
# Might want to set these lower for eval so that less images get dropped (eval dataset size is usually much smaller than training set).
|
| 38 |
+
# Each size bucket of images/videos is rounded down to the nearest multiple of the global batch size, so higher global batch size means
|
| 39 |
+
# more dropped images. Usually doesn't matter for training but the eval set is much smaller so it can matter.
|
| 40 |
+
eval_micro_batch_size_per_gpu = 1
|
| 41 |
+
eval_gradient_accumulation_steps = 1
|
| 42 |
+
# If using block swap, you can disable it for eval. Eval uses less memory, so depending on block swapping amount you can maybe get away with
|
| 43 |
+
# doing this, and then eval is much faster.
|
| 44 |
+
disable_block_swap_for_eval = true
|
| 45 |
+
|
| 46 |
+
# misc settings
|
| 47 |
+
|
| 48 |
+
# Probably want to set this a bit higher if you have a smaller dataset so you don't end up with a million saved models.
|
| 49 |
+
save_every_n_epochs = 1
|
| 50 |
+
# Can checkpoint the training state every n number of epochs or minutes. Set only one of these. You can resume from checkpoints using the --resume_from_checkpoint flag.
|
| 51 |
+
#checkpoint_every_n_epochs = 1
|
| 52 |
+
checkpoint_every_n_minutes = 60
|
| 53 |
+
# Always set to true unless you have a huge amount of VRAM.
|
| 54 |
+
# This can also be 'unsloth' to reduce VRAM even more, with a slight performance hit.
|
| 55 |
+
activation_checkpointing = true
|
| 56 |
+
|
| 57 |
+
# Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
|
| 58 |
+
partition_method = 'parameters'
|
| 59 |
+
# Alternatively you can use 'manual' in combination with partition_split, which specifies the split points for dividing
|
| 60 |
+
# layers between GPUs. For example, with two GPUs, partition_split=[10] puts layers 0-9 on GPU 0, and the rest on GPU 1.
|
| 61 |
+
# With three GPUs, partition_split=[10, 20] puts layers 0-9 on GPU 0, layers 10-19 on GPU 1, and the rest on GPU 2.
|
| 62 |
+
# Length of partition_split must be pipeline_stages-1.
|
| 63 |
+
#partition_split = [N]
|
| 64 |
+
|
| 65 |
+
# dtype for saving the LoRA or model, if different from training dtype
|
| 66 |
+
save_dtype = 'bfloat16'
|
| 67 |
+
# If experiencing CUDA OOM errors with memory fragmentation, set this env var: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 68 |
+
# Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
|
| 69 |
+
caching_batch_size = 8
|
| 70 |
+
# How often deepspeed logs to console.
|
| 71 |
+
steps_per_print = 100
|
| 72 |
+
# How to extract video clips for training from a single input video file.
|
| 73 |
+
# The video file is first assigned to one of the configured frame buckets, but then we must extract one or more clips of exactly the right
|
| 74 |
+
# number of frames for that bucket.
|
| 75 |
+
# single_beginning: one clip starting at the beginning of the video
|
| 76 |
+
# single_middle: one clip from the middle of the video (cutting off the start and end equally)
|
| 77 |
+
# multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
|
| 78 |
+
# default is single_beginning
|
| 79 |
+
video_clip_mode = 'single_beginning'
|
| 80 |
+
|
| 81 |
+
# This is how you configure HunyuanVideo. Other models will be different. See docs/supported_models.md for
|
| 82 |
+
# details on the configuration and options for each model.
|
| 83 |
+
[model]
|
| 84 |
+
type = 'wan'
|
| 85 |
+
ckpt_path = '/data/shiv/diffusion-pipe/models/wan1.3'
|
| 86 |
+
# Base dtype used for all models.
|
| 87 |
+
dtype = 'bfloat16'
|
| 88 |
+
# Wan supports fp8 for the transformer when training LoRA.
|
| 89 |
+
# transformer_dtype = 'float8'
|
| 90 |
+
# How to sample timesteps to train on. Can be logit_normal or uniform.
|
| 91 |
+
timestep_sample_method = 'logit_normal'
|
| 92 |
+
|
| 93 |
+
# For models that support full fine tuning, simply delete or comment out the [adapter] table to FFT.
|
| 94 |
+
[adapter]
|
| 95 |
+
type = 'lora'
|
| 96 |
+
# Dtype for the LoRA weights you are training.
|
| 97 |
+
dtype = 'bfloat16'
|
| 98 |
+
# LoRA rank - determines capacity to learn (higher = more capacity, more VRAM usage)
|
| 99 |
+
rank = 48
|
| 100 |
+
|
| 101 |
+
# Higher rank = more capacity to learn but uses more VRAM and may overfit
|
| 102 |
+
# The alpha value (scaling factor) is automatically set equal to rank in this codebase
|
| 103 |
+
# You can initialize the lora weights from a previously trained lora.
|
| 104 |
+
init_from_existing = '/data/diffusion_pipe_training_runs/852/20250411_21-03-36/epoch3'
|
| 105 |
+
|
| 106 |
+
[optimizer]
|
| 107 |
+
# AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
|
| 108 |
+
# Look at train.py for other options. You could also easily edit the file and add your own.
|
| 109 |
+
type = 'adamw_optimi'
|
| 110 |
+
lr = 1e-5
|
| 111 |
+
betas = [0.9, 0.99]
|
| 112 |
+
weight_decay = 0.01
|
epoch10/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": null,
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": false,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 48,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 48,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"ffn.0",
|
| 28 |
+
"v",
|
| 29 |
+
"q",
|
| 30 |
+
"o",
|
| 31 |
+
"k",
|
| 32 |
+
"ffn.2"
|
| 33 |
+
],
|
| 34 |
+
"task_type": null,
|
| 35 |
+
"trainable_token_indices": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
epoch10/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:34c593b1f9b411f88f1225eb8c0f5d5aa92e6fec0ec26041cef30f07cb8cbebb
|
| 3 |
+
size 131309776
|
epoch10/main_example.toml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Output path for training runs. Each training run makes a new directory in here.
|
| 2 |
+
output_dir = '/data/diffusion_pipe_training_runs/852'
|
| 3 |
+
|
| 4 |
+
# Dataset config file.
|
| 5 |
+
dataset = '/data/shiv/diffusion-pipe/examples/852_dataset.toml'
|
| 6 |
+
# You can have separate eval datasets. Give them a name for Tensorboard metrics.
|
| 7 |
+
# eval_datasets = [
|
| 8 |
+
# {name = 'something', config = 'path/to/eval_dataset.toml'},
|
| 9 |
+
# ]
|
| 10 |
+
|
| 11 |
+
# training settings
|
| 12 |
+
|
| 13 |
+
# I usually set this to a really high value because I don't know how long I want to train.
|
| 14 |
+
epochs = 1000
|
| 15 |
+
# Batch size of a single forward/backward pass for one GPU.
|
| 16 |
+
micro_batch_size_per_gpu = 16
|
| 17 |
+
# Pipeline parallelism degree. A single instance of the model is divided across this many GPUs.
|
| 18 |
+
pipeline_stages = 1
|
| 19 |
+
# Number of micro-batches sent through the pipeline for each training step.
|
| 20 |
+
# If pipeline_stages > 1, a higher GAS means better GPU utilization due to smaller pipeline bubbles (where GPUs aren't overlapping computation).
|
| 21 |
+
gradient_accumulation_steps = 8
|
| 22 |
+
# Grad norm clipping.
|
| 23 |
+
gradient_clipping = 1.0
|
| 24 |
+
# Learning rate warmup.
|
| 25 |
+
warmup_steps = 5
|
| 26 |
+
|
| 27 |
+
# Block swapping is supported for Wan, HunyuanVideo, Flux, and Chroma. This value controls the number
|
| 28 |
+
# of blocks kept offloaded to RAM. Increasing it lowers VRAM use, but has a performance penalty. The
|
| 29 |
+
# exactly performance penalty depends on the model and the type of training you are doing (e.g. images vs video).
|
| 30 |
+
# Block swapping only works for LoRA training, and requires pipeline_stages=1.
|
| 31 |
+
blocks_to_swap = 24
|
| 32 |
+
|
| 33 |
+
# eval settings
|
| 34 |
+
|
| 35 |
+
eval_every_n_epochs = 1
|
| 36 |
+
eval_before_first_step = false
|
| 37 |
+
# Might want to set these lower for eval so that less images get dropped (eval dataset size is usually much smaller than training set).
|
| 38 |
+
# Each size bucket of images/videos is rounded down to the nearest multiple of the global batch size, so higher global batch size means
|
| 39 |
+
# more dropped images. Usually doesn't matter for training but the eval set is much smaller so it can matter.
|
| 40 |
+
eval_micro_batch_size_per_gpu = 1
|
| 41 |
+
eval_gradient_accumulation_steps = 1
|
| 42 |
+
# If using block swap, you can disable it for eval. Eval uses less memory, so depending on block swapping amount you can maybe get away with
|
| 43 |
+
# doing this, and then eval is much faster.
|
| 44 |
+
disable_block_swap_for_eval = true
|
| 45 |
+
|
| 46 |
+
# misc settings
|
| 47 |
+
|
| 48 |
+
# Probably want to set this a bit higher if you have a smaller dataset so you don't end up with a million saved models.
|
| 49 |
+
save_every_n_epochs = 1
|
| 50 |
+
# Can checkpoint the training state every n number of epochs or minutes. Set only one of these. You can resume from checkpoints using the --resume_from_checkpoint flag.
|
| 51 |
+
#checkpoint_every_n_epochs = 1
|
| 52 |
+
checkpoint_every_n_minutes = 60
|
| 53 |
+
# Always set to true unless you have a huge amount of VRAM.
|
| 54 |
+
# This can also be 'unsloth' to reduce VRAM even more, with a slight performance hit.
|
| 55 |
+
activation_checkpointing = true
|
| 56 |
+
|
| 57 |
+
# Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
|
| 58 |
+
partition_method = 'parameters'
|
| 59 |
+
# Alternatively you can use 'manual' in combination with partition_split, which specifies the split points for dividing
|
| 60 |
+
# layers between GPUs. For example, with two GPUs, partition_split=[10] puts layers 0-9 on GPU 0, and the rest on GPU 1.
|
| 61 |
+
# With three GPUs, partition_split=[10, 20] puts layers 0-9 on GPU 0, layers 10-19 on GPU 1, and the rest on GPU 2.
|
| 62 |
+
# Length of partition_split must be pipeline_stages-1.
|
| 63 |
+
#partition_split = [N]
|
| 64 |
+
|
| 65 |
+
# dtype for saving the LoRA or model, if different from training dtype
|
| 66 |
+
save_dtype = 'bfloat16'
|
| 67 |
+
# If experiencing CUDA OOM errors with memory fragmentation, set this env var: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 68 |
+
# Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
|
| 69 |
+
caching_batch_size = 8
|
| 70 |
+
# How often deepspeed logs to console.
|
| 71 |
+
steps_per_print = 100
|
| 72 |
+
# How to extract video clips for training from a single input video file.
|
| 73 |
+
# The video file is first assigned to one of the configured frame buckets, but then we must extract one or more clips of exactly the right
|
| 74 |
+
# number of frames for that bucket.
|
| 75 |
+
# single_beginning: one clip starting at the beginning of the video
|
| 76 |
+
# single_middle: one clip from the middle of the video (cutting off the start and end equally)
|
| 77 |
+
# multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
|
| 78 |
+
# default is single_beginning
|
| 79 |
+
video_clip_mode = 'single_beginning'
|
| 80 |
+
|
| 81 |
+
# This is how you configure HunyuanVideo. Other models will be different. See docs/supported_models.md for
|
| 82 |
+
# details on the configuration and options for each model.
|
| 83 |
+
[model]
|
| 84 |
+
type = 'wan'
|
| 85 |
+
ckpt_path = '/data/shiv/diffusion-pipe/models/wan1.3'
|
| 86 |
+
# Base dtype used for all models.
|
| 87 |
+
dtype = 'bfloat16'
|
| 88 |
+
# Wan supports fp8 for the transformer when training LoRA.
|
| 89 |
+
# transformer_dtype = 'float8'
|
| 90 |
+
# How to sample timesteps to train on. Can be logit_normal or uniform.
|
| 91 |
+
timestep_sample_method = 'logit_normal'
|
| 92 |
+
|
| 93 |
+
# For models that support full fine tuning, simply delete or comment out the [adapter] table to FFT.
|
| 94 |
+
[adapter]
|
| 95 |
+
type = 'lora'
|
| 96 |
+
# Dtype for the LoRA weights you are training.
|
| 97 |
+
dtype = 'bfloat16'
|
| 98 |
+
# LoRA rank - determines capacity to learn (higher = more capacity, more VRAM usage)
|
| 99 |
+
rank = 48
|
| 100 |
+
|
| 101 |
+
# Higher rank = more capacity to learn but uses more VRAM and may overfit
|
| 102 |
+
# The alpha value (scaling factor) is automatically set equal to rank in this codebase
|
| 103 |
+
# You can initialize the lora weights from a previously trained lora.
|
| 104 |
+
init_from_existing = '/data/diffusion_pipe_training_runs/852/20250411_21-03-36/epoch3'
|
| 105 |
+
|
| 106 |
+
[optimizer]
|
| 107 |
+
# AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
|
| 108 |
+
# Look at train.py for other options. You could also easily edit the file and add your own.
|
| 109 |
+
type = 'adamw_optimi'
|
| 110 |
+
lr = 1e-5
|
| 111 |
+
betas = [0.9, 0.99]
|
| 112 |
+
weight_decay = 0.01
|
epoch11/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": null,
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": false,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 48,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 48,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"ffn.0",
|
| 28 |
+
"v",
|
| 29 |
+
"q",
|
| 30 |
+
"o",
|
| 31 |
+
"k",
|
| 32 |
+
"ffn.2"
|
| 33 |
+
],
|
| 34 |
+
"task_type": null,
|
| 35 |
+
"trainable_token_indices": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
epoch11/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1cabdbef940fed88ca816517b7c8407089ddd4df137827dc2aa88c5490b0b207
|
| 3 |
+
size 131309776
|
epoch11/main_example.toml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Output path for training runs. Each training run makes a new directory in here.
|
| 2 |
+
output_dir = '/data/diffusion_pipe_training_runs/852'
|
| 3 |
+
|
| 4 |
+
# Dataset config file.
|
| 5 |
+
dataset = '/data/shiv/diffusion-pipe/examples/852_dataset.toml'
|
| 6 |
+
# You can have separate eval datasets. Give them a name for Tensorboard metrics.
|
| 7 |
+
# eval_datasets = [
|
| 8 |
+
# {name = 'something', config = 'path/to/eval_dataset.toml'},
|
| 9 |
+
# ]
|
| 10 |
+
|
| 11 |
+
# training settings
|
| 12 |
+
|
| 13 |
+
# I usually set this to a really high value because I don't know how long I want to train.
|
| 14 |
+
epochs = 1000
|
| 15 |
+
# Batch size of a single forward/backward pass for one GPU.
|
| 16 |
+
micro_batch_size_per_gpu = 16
|
| 17 |
+
# Pipeline parallelism degree. A single instance of the model is divided across this many GPUs.
|
| 18 |
+
pipeline_stages = 1
|
| 19 |
+
# Number of micro-batches sent through the pipeline for each training step.
|
| 20 |
+
# If pipeline_stages > 1, a higher GAS means better GPU utilization due to smaller pipeline bubbles (where GPUs aren't overlapping computation).
|
| 21 |
+
gradient_accumulation_steps = 8
|
| 22 |
+
# Grad norm clipping.
|
| 23 |
+
gradient_clipping = 1.0
|
| 24 |
+
# Learning rate warmup.
|
| 25 |
+
warmup_steps = 5
|
| 26 |
+
|
| 27 |
+
# Block swapping is supported for Wan, HunyuanVideo, Flux, and Chroma. This value controls the number
|
| 28 |
+
# of blocks kept offloaded to RAM. Increasing it lowers VRAM use, but has a performance penalty. The
|
| 29 |
+
# exactly performance penalty depends on the model and the type of training you are doing (e.g. images vs video).
|
| 30 |
+
# Block swapping only works for LoRA training, and requires pipeline_stages=1.
|
| 31 |
+
blocks_to_swap = 24
|
| 32 |
+
|
| 33 |
+
# eval settings
|
| 34 |
+
|
| 35 |
+
eval_every_n_epochs = 1
|
| 36 |
+
eval_before_first_step = false
|
| 37 |
+
# Might want to set these lower for eval so that less images get dropped (eval dataset size is usually much smaller than training set).
|
| 38 |
+
# Each size bucket of images/videos is rounded down to the nearest multiple of the global batch size, so higher global batch size means
|
| 39 |
+
# more dropped images. Usually doesn't matter for training but the eval set is much smaller so it can matter.
|
| 40 |
+
eval_micro_batch_size_per_gpu = 1
|
| 41 |
+
eval_gradient_accumulation_steps = 1
|
| 42 |
+
# If using block swap, you can disable it for eval. Eval uses less memory, so depending on block swapping amount you can maybe get away with
|
| 43 |
+
# doing this, and then eval is much faster.
|
| 44 |
+
disable_block_swap_for_eval = true
|
| 45 |
+
|
| 46 |
+
# misc settings
|
| 47 |
+
|
| 48 |
+
# Probably want to set this a bit higher if you have a smaller dataset so you don't end up with a million saved models.
|
| 49 |
+
save_every_n_epochs = 1
|
| 50 |
+
# Can checkpoint the training state every n number of epochs or minutes. Set only one of these. You can resume from checkpoints using the --resume_from_checkpoint flag.
|
| 51 |
+
#checkpoint_every_n_epochs = 1
|
| 52 |
+
checkpoint_every_n_minutes = 60
|
| 53 |
+
# Always set to true unless you have a huge amount of VRAM.
|
| 54 |
+
# This can also be 'unsloth' to reduce VRAM even more, with a slight performance hit.
|
| 55 |
+
activation_checkpointing = true
|
| 56 |
+
|
| 57 |
+
# Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
|
| 58 |
+
partition_method = 'parameters'
|
| 59 |
+
# Alternatively you can use 'manual' in combination with partition_split, which specifies the split points for dividing
|
| 60 |
+
# layers between GPUs. For example, with two GPUs, partition_split=[10] puts layers 0-9 on GPU 0, and the rest on GPU 1.
|
| 61 |
+
# With three GPUs, partition_split=[10, 20] puts layers 0-9 on GPU 0, layers 10-19 on GPU 1, and the rest on GPU 2.
|
| 62 |
+
# Length of partition_split must be pipeline_stages-1.
|
| 63 |
+
#partition_split = [N]
|
| 64 |
+
|
| 65 |
+
# dtype for saving the LoRA or model, if different from training dtype
|
| 66 |
+
save_dtype = 'bfloat16'
|
| 67 |
+
# If experiencing CUDA OOM errors with memory fragmentation, set this env var: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 68 |
+
# Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
|
| 69 |
+
caching_batch_size = 8
|
| 70 |
+
# How often deepspeed logs to console.
|
| 71 |
+
steps_per_print = 100
|
| 72 |
+
# How to extract video clips for training from a single input video file.
|
| 73 |
+
# The video file is first assigned to one of the configured frame buckets, but then we must extract one or more clips of exactly the right
|
| 74 |
+
# number of frames for that bucket.
|
| 75 |
+
# single_beginning: one clip starting at the beginning of the video
|
| 76 |
+
# single_middle: one clip from the middle of the video (cutting off the start and end equally)
|
| 77 |
+
# multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
|
| 78 |
+
# default is single_beginning
|
| 79 |
+
video_clip_mode = 'single_beginning'
|
| 80 |
+
|
| 81 |
+
# This is how you configure HunyuanVideo. Other models will be different. See docs/supported_models.md for
|
| 82 |
+
# details on the configuration and options for each model.
|
| 83 |
+
[model]
|
| 84 |
+
type = 'wan'
|
| 85 |
+
ckpt_path = '/data/shiv/diffusion-pipe/models/wan1.3'
|
| 86 |
+
# Base dtype used for all models.
|
| 87 |
+
dtype = 'bfloat16'
|
| 88 |
+
# Wan supports fp8 for the transformer when training LoRA.
|
| 89 |
+
# transformer_dtype = 'float8'
|
| 90 |
+
# How to sample timesteps to train on. Can be logit_normal or uniform.
|
| 91 |
+
timestep_sample_method = 'logit_normal'
|
| 92 |
+
|
| 93 |
+
# For models that support full fine tuning, simply delete or comment out the [adapter] table to FFT.
|
| 94 |
+
[adapter]
|
| 95 |
+
type = 'lora'
|
| 96 |
+
# Dtype for the LoRA weights you are training.
|
| 97 |
+
dtype = 'bfloat16'
|
| 98 |
+
# LoRA rank - determines capacity to learn (higher = more capacity, more VRAM usage)
|
| 99 |
+
rank = 48
|
| 100 |
+
|
| 101 |
+
# Higher rank = more capacity to learn but uses more VRAM and may overfit
|
| 102 |
+
# The alpha value (scaling factor) is automatically set equal to rank in this codebase
|
| 103 |
+
# You can initialize the lora weights from a previously trained lora.
|
| 104 |
+
init_from_existing = '/data/diffusion_pipe_training_runs/852/20250411_21-03-36/epoch3'
|
| 105 |
+
|
| 106 |
+
[optimizer]
|
| 107 |
+
# AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
|
| 108 |
+
# Look at train.py for other options. You could also easily edit the file and add your own.
|
| 109 |
+
type = 'adamw_optimi'
|
| 110 |
+
lr = 1e-5
|
| 111 |
+
betas = [0.9, 0.99]
|
| 112 |
+
weight_decay = 0.01
|
epoch12/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": null,
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": false,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 48,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 48,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"ffn.0",
|
| 28 |
+
"v",
|
| 29 |
+
"q",
|
| 30 |
+
"o",
|
| 31 |
+
"k",
|
| 32 |
+
"ffn.2"
|
| 33 |
+
],
|
| 34 |
+
"task_type": null,
|
| 35 |
+
"trainable_token_indices": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
epoch12/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e1836e1d99ce48ae7ab405d109d81d2e868fa61d507de216ddd7b5d252729639
|
| 3 |
+
size 131309776
|
epoch12/main_example.toml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Output path for training runs. Each training run makes a new directory in here.
|
| 2 |
+
output_dir = '/data/diffusion_pipe_training_runs/852'
|
| 3 |
+
|
| 4 |
+
# Dataset config file.
|
| 5 |
+
dataset = '/data/shiv/diffusion-pipe/examples/852_dataset.toml'
|
| 6 |
+
# You can have separate eval datasets. Give them a name for Tensorboard metrics.
|
| 7 |
+
# eval_datasets = [
|
| 8 |
+
# {name = 'something', config = 'path/to/eval_dataset.toml'},
|
| 9 |
+
# ]
|
| 10 |
+
|
| 11 |
+
# training settings
|
| 12 |
+
|
| 13 |
+
# I usually set this to a really high value because I don't know how long I want to train.
|
| 14 |
+
epochs = 1000
|
| 15 |
+
# Batch size of a single forward/backward pass for one GPU.
|
| 16 |
+
micro_batch_size_per_gpu = 16
|
| 17 |
+
# Pipeline parallelism degree. A single instance of the model is divided across this many GPUs.
|
| 18 |
+
pipeline_stages = 1
|
| 19 |
+
# Number of micro-batches sent through the pipeline for each training step.
|
| 20 |
+
# If pipeline_stages > 1, a higher GAS means better GPU utilization due to smaller pipeline bubbles (where GPUs aren't overlapping computation).
|
| 21 |
+
gradient_accumulation_steps = 8
|
| 22 |
+
# Grad norm clipping.
|
| 23 |
+
gradient_clipping = 1.0
|
| 24 |
+
# Learning rate warmup.
|
| 25 |
+
warmup_steps = 5
|
| 26 |
+
|
| 27 |
+
# Block swapping is supported for Wan, HunyuanVideo, Flux, and Chroma. This value controls the number
|
| 28 |
+
# of blocks kept offloaded to RAM. Increasing it lowers VRAM use, but has a performance penalty. The
|
| 29 |
+
# exactly performance penalty depends on the model and the type of training you are doing (e.g. images vs video).
|
| 30 |
+
# Block swapping only works for LoRA training, and requires pipeline_stages=1.
|
| 31 |
+
blocks_to_swap = 24
|
| 32 |
+
|
| 33 |
+
# eval settings
|
| 34 |
+
|
| 35 |
+
eval_every_n_epochs = 1
|
| 36 |
+
eval_before_first_step = false
|
| 37 |
+
# Might want to set these lower for eval so that less images get dropped (eval dataset size is usually much smaller than training set).
|
| 38 |
+
# Each size bucket of images/videos is rounded down to the nearest multiple of the global batch size, so higher global batch size means
|
| 39 |
+
# more dropped images. Usually doesn't matter for training but the eval set is much smaller so it can matter.
|
| 40 |
+
eval_micro_batch_size_per_gpu = 1
|
| 41 |
+
eval_gradient_accumulation_steps = 1
|
| 42 |
+
# If using block swap, you can disable it for eval. Eval uses less memory, so depending on block swapping amount you can maybe get away with
|
| 43 |
+
# doing this, and then eval is much faster.
|
| 44 |
+
disable_block_swap_for_eval = true
|
| 45 |
+
|
| 46 |
+
# misc settings
|
| 47 |
+
|
| 48 |
+
# Probably want to set this a bit higher if you have a smaller dataset so you don't end up with a million saved models.
|
| 49 |
+
save_every_n_epochs = 1
|
| 50 |
+
# Can checkpoint the training state every n number of epochs or minutes. Set only one of these. You can resume from checkpoints using the --resume_from_checkpoint flag.
|
| 51 |
+
#checkpoint_every_n_epochs = 1
|
| 52 |
+
checkpoint_every_n_minutes = 60
|
| 53 |
+
# Always set to true unless you have a huge amount of VRAM.
|
| 54 |
+
# This can also be 'unsloth' to reduce VRAM even more, with a slight performance hit.
|
| 55 |
+
activation_checkpointing = true
|
| 56 |
+
|
| 57 |
+
# Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
|
| 58 |
+
partition_method = 'parameters'
|
| 59 |
+
# Alternatively you can use 'manual' in combination with partition_split, which specifies the split points for dividing
|
| 60 |
+
# layers between GPUs. For example, with two GPUs, partition_split=[10] puts layers 0-9 on GPU 0, and the rest on GPU 1.
|
| 61 |
+
# With three GPUs, partition_split=[10, 20] puts layers 0-9 on GPU 0, layers 10-19 on GPU 1, and the rest on GPU 2.
|
| 62 |
+
# Length of partition_split must be pipeline_stages-1.
|
| 63 |
+
#partition_split = [N]
|
| 64 |
+
|
| 65 |
+
# dtype for saving the LoRA or model, if different from training dtype
|
| 66 |
+
save_dtype = 'bfloat16'
|
| 67 |
+
# If experiencing CUDA OOM errors with memory fragmentation, set this env var: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 68 |
+
# Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
|
| 69 |
+
caching_batch_size = 8
|
| 70 |
+
# How often deepspeed logs to console.
|
| 71 |
+
steps_per_print = 100
|
| 72 |
+
# How to extract video clips for training from a single input video file.
|
| 73 |
+
# The video file is first assigned to one of the configured frame buckets, but then we must extract one or more clips of exactly the right
|
| 74 |
+
# number of frames for that bucket.
|
| 75 |
+
# single_beginning: one clip starting at the beginning of the video
|
| 76 |
+
# single_middle: one clip from the middle of the video (cutting off the start and end equally)
|
| 77 |
+
# multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
|
| 78 |
+
# default is single_beginning
|
| 79 |
+
video_clip_mode = 'single_beginning'
|
| 80 |
+
|
| 81 |
+
# This is how you configure HunyuanVideo. Other models will be different. See docs/supported_models.md for
|
| 82 |
+
# details on the configuration and options for each model.
|
| 83 |
+
[model]
|
| 84 |
+
type = 'wan'
|
| 85 |
+
ckpt_path = '/data/shiv/diffusion-pipe/models/wan1.3'
|
| 86 |
+
# Base dtype used for all models.
|
| 87 |
+
dtype = 'bfloat16'
|
| 88 |
+
# Wan supports fp8 for the transformer when training LoRA.
|
| 89 |
+
# transformer_dtype = 'float8'
|
| 90 |
+
# How to sample timesteps to train on. Can be logit_normal or uniform.
|
| 91 |
+
timestep_sample_method = 'logit_normal'
|
| 92 |
+
|
| 93 |
+
# For models that support full fine tuning, simply delete or comment out the [adapter] table to FFT.
|
| 94 |
+
[adapter]
|
| 95 |
+
type = 'lora'
|
| 96 |
+
# Dtype for the LoRA weights you are training.
|
| 97 |
+
dtype = 'bfloat16'
|
| 98 |
+
# LoRA rank - determines capacity to learn (higher = more capacity, more VRAM usage)
|
| 99 |
+
rank = 48
|
| 100 |
+
|
| 101 |
+
# Higher rank = more capacity to learn but uses more VRAM and may overfit
|
| 102 |
+
# The alpha value (scaling factor) is automatically set equal to rank in this codebase
|
| 103 |
+
# You can initialize the lora weights from a previously trained lora.
|
| 104 |
+
init_from_existing = '/data/diffusion_pipe_training_runs/852/20250411_21-03-36/epoch3'
|
| 105 |
+
|
| 106 |
+
[optimizer]
|
| 107 |
+
# AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
|
| 108 |
+
# Look at train.py for other options. You could also easily edit the file and add your own.
|
| 109 |
+
type = 'adamw_optimi'
|
| 110 |
+
lr = 1e-5
|
| 111 |
+
betas = [0.9, 0.99]
|
| 112 |
+
weight_decay = 0.01
|
epoch13/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": null,
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": false,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 48,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 48,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"ffn.0",
|
| 28 |
+
"v",
|
| 29 |
+
"q",
|
| 30 |
+
"o",
|
| 31 |
+
"k",
|
| 32 |
+
"ffn.2"
|
| 33 |
+
],
|
| 34 |
+
"task_type": null,
|
| 35 |
+
"trainable_token_indices": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
epoch13/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6207a69da9033073c04f18c78fb55145dba733876014c10cfcdde20b0e1eb7cf
|
| 3 |
+
size 131309776
|
epoch13/main_example.toml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Output path for training runs. Each training run makes a new directory in here.
|
| 2 |
+
output_dir = '/data/diffusion_pipe_training_runs/852'
|
| 3 |
+
|
| 4 |
+
# Dataset config file.
|
| 5 |
+
dataset = '/data/shiv/diffusion-pipe/examples/852_dataset.toml'
|
| 6 |
+
# You can have separate eval datasets. Give them a name for Tensorboard metrics.
|
| 7 |
+
# eval_datasets = [
|
| 8 |
+
# {name = 'something', config = 'path/to/eval_dataset.toml'},
|
| 9 |
+
# ]
|
| 10 |
+
|
| 11 |
+
# training settings
|
| 12 |
+
|
| 13 |
+
# I usually set this to a really high value because I don't know how long I want to train.
|
| 14 |
+
epochs = 1000
|
| 15 |
+
# Batch size of a single forward/backward pass for one GPU.
|
| 16 |
+
micro_batch_size_per_gpu = 16
|
| 17 |
+
# Pipeline parallelism degree. A single instance of the model is divided across this many GPUs.
|
| 18 |
+
pipeline_stages = 1
|
| 19 |
+
# Number of micro-batches sent through the pipeline for each training step.
|
| 20 |
+
# If pipeline_stages > 1, a higher GAS means better GPU utilization due to smaller pipeline bubbles (where GPUs aren't overlapping computation).
|
| 21 |
+
gradient_accumulation_steps = 8
|
| 22 |
+
# Grad norm clipping.
|
| 23 |
+
gradient_clipping = 1.0
|
| 24 |
+
# Learning rate warmup.
|
| 25 |
+
warmup_steps = 5
|
| 26 |
+
|
| 27 |
+
# Block swapping is supported for Wan, HunyuanVideo, Flux, and Chroma. This value controls the number
|
| 28 |
+
# of blocks kept offloaded to RAM. Increasing it lowers VRAM use, but has a performance penalty. The
|
| 29 |
+
# exactly performance penalty depends on the model and the type of training you are doing (e.g. images vs video).
|
| 30 |
+
# Block swapping only works for LoRA training, and requires pipeline_stages=1.
|
| 31 |
+
blocks_to_swap = 24
|
| 32 |
+
|
| 33 |
+
# eval settings
|
| 34 |
+
|
| 35 |
+
eval_every_n_epochs = 1
|
| 36 |
+
eval_before_first_step = false
|
| 37 |
+
# Might want to set these lower for eval so that less images get dropped (eval dataset size is usually much smaller than training set).
|
| 38 |
+
# Each size bucket of images/videos is rounded down to the nearest multiple of the global batch size, so higher global batch size means
|
| 39 |
+
# more dropped images. Usually doesn't matter for training but the eval set is much smaller so it can matter.
|
| 40 |
+
eval_micro_batch_size_per_gpu = 1
|
| 41 |
+
eval_gradient_accumulation_steps = 1
|
| 42 |
+
# If using block swap, you can disable it for eval. Eval uses less memory, so depending on block swapping amount you can maybe get away with
|
| 43 |
+
# doing this, and then eval is much faster.
|
| 44 |
+
disable_block_swap_for_eval = true
|
| 45 |
+
|
| 46 |
+
# misc settings
|
| 47 |
+
|
| 48 |
+
# Probably want to set this a bit higher if you have a smaller dataset so you don't end up with a million saved models.
|
| 49 |
+
save_every_n_epochs = 1
|
| 50 |
+
# Can checkpoint the training state every n number of epochs or minutes. Set only one of these. You can resume from checkpoints using the --resume_from_checkpoint flag.
|
| 51 |
+
#checkpoint_every_n_epochs = 1
|
| 52 |
+
checkpoint_every_n_minutes = 60
|
| 53 |
+
# Always set to true unless you have a huge amount of VRAM.
|
| 54 |
+
# This can also be 'unsloth' to reduce VRAM even more, with a slight performance hit.
|
| 55 |
+
activation_checkpointing = true
|
| 56 |
+
|
| 57 |
+
# Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
|
| 58 |
+
partition_method = 'parameters'
|
| 59 |
+
# Alternatively you can use 'manual' in combination with partition_split, which specifies the split points for dividing
|
| 60 |
+
# layers between GPUs. For example, with two GPUs, partition_split=[10] puts layers 0-9 on GPU 0, and the rest on GPU 1.
|
| 61 |
+
# With three GPUs, partition_split=[10, 20] puts layers 0-9 on GPU 0, layers 10-19 on GPU 1, and the rest on GPU 2.
|
| 62 |
+
# Length of partition_split must be pipeline_stages-1.
|
| 63 |
+
#partition_split = [N]
|
| 64 |
+
|
| 65 |
+
# dtype for saving the LoRA or model, if different from training dtype
|
| 66 |
+
save_dtype = 'bfloat16'
|
| 67 |
+
# If experiencing CUDA OOM errors with memory fragmentation, set this env var: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 68 |
+
# Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
|
| 69 |
+
caching_batch_size = 8
|
| 70 |
+
# How often deepspeed logs to console.
|
| 71 |
+
steps_per_print = 100
|
| 72 |
+
# How to extract video clips for training from a single input video file.
|
| 73 |
+
# The video file is first assigned to one of the configured frame buckets, but then we must extract one or more clips of exactly the right
|
| 74 |
+
# number of frames for that bucket.
|
| 75 |
+
# single_beginning: one clip starting at the beginning of the video
|
| 76 |
+
# single_middle: one clip from the middle of the video (cutting off the start and end equally)
|
| 77 |
+
# multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
|
| 78 |
+
# default is single_beginning
|
| 79 |
+
video_clip_mode = 'single_beginning'
|
| 80 |
+
|
| 81 |
+
# This is how you configure HunyuanVideo. Other models will be different. See docs/supported_models.md for
|
| 82 |
+
# details on the configuration and options for each model.
|
| 83 |
+
[model]
|
| 84 |
+
type = 'wan'
|
| 85 |
+
ckpt_path = '/data/shiv/diffusion-pipe/models/wan1.3'
|
| 86 |
+
# Base dtype used for all models.
|
| 87 |
+
dtype = 'bfloat16'
|
| 88 |
+
# Wan supports fp8 for the transformer when training LoRA.
|
| 89 |
+
# transformer_dtype = 'float8'
|
| 90 |
+
# How to sample timesteps to train on. Can be logit_normal or uniform.
|
| 91 |
+
timestep_sample_method = 'logit_normal'
|
| 92 |
+
|
| 93 |
+
# For models that support full fine tuning, simply delete or comment out the [adapter] table to FFT.
|
| 94 |
+
[adapter]
|
| 95 |
+
type = 'lora'
|
| 96 |
+
# Dtype for the LoRA weights you are training.
|
| 97 |
+
dtype = 'bfloat16'
|
| 98 |
+
# LoRA rank - determines capacity to learn (higher = more capacity, more VRAM usage)
|
| 99 |
+
rank = 48
|
| 100 |
+
|
| 101 |
+
# Higher rank = more capacity to learn but uses more VRAM and may overfit
|
| 102 |
+
# The alpha value (scaling factor) is automatically set equal to rank in this codebase
|
| 103 |
+
# You can initialize the lora weights from a previously trained lora.
|
| 104 |
+
init_from_existing = '/data/diffusion_pipe_training_runs/852/20250411_21-03-36/epoch3'
|
| 105 |
+
|
| 106 |
+
[optimizer]
|
| 107 |
+
# AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
|
| 108 |
+
# Look at train.py for other options. You could also easily edit the file and add your own.
|
| 109 |
+
type = 'adamw_optimi'
|
| 110 |
+
lr = 1e-5
|
| 111 |
+
betas = [0.9, 0.99]
|
| 112 |
+
weight_decay = 0.01
|
epoch14/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": null,
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": false,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 48,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 48,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"ffn.0",
|
| 28 |
+
"v",
|
| 29 |
+
"q",
|
| 30 |
+
"o",
|
| 31 |
+
"k",
|
| 32 |
+
"ffn.2"
|
| 33 |
+
],
|
| 34 |
+
"task_type": null,
|
| 35 |
+
"trainable_token_indices": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
epoch14/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f7764dd7fcc86abaf41899c9cb6df56da64484d6903ed8c179250637db7216f8
|
| 3 |
+
size 131309776
|
epoch14/main_example.toml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Output path for training runs. Each training run makes a new directory in here.
|
| 2 |
+
output_dir = '/data/diffusion_pipe_training_runs/852'
|
| 3 |
+
|
| 4 |
+
# Dataset config file.
|
| 5 |
+
dataset = '/data/shiv/diffusion-pipe/examples/852_dataset.toml'
|
| 6 |
+
# You can have separate eval datasets. Give them a name for Tensorboard metrics.
|
| 7 |
+
# eval_datasets = [
|
| 8 |
+
# {name = 'something', config = 'path/to/eval_dataset.toml'},
|
| 9 |
+
# ]
|
| 10 |
+
|
| 11 |
+
# training settings
|
| 12 |
+
|
| 13 |
+
# I usually set this to a really high value because I don't know how long I want to train.
|
| 14 |
+
epochs = 1000
|
| 15 |
+
# Batch size of a single forward/backward pass for one GPU.
|
| 16 |
+
micro_batch_size_per_gpu = 16
|
| 17 |
+
# Pipeline parallelism degree. A single instance of the model is divided across this many GPUs.
|
| 18 |
+
pipeline_stages = 1
|
| 19 |
+
# Number of micro-batches sent through the pipeline for each training step.
|
| 20 |
+
# If pipeline_stages > 1, a higher GAS means better GPU utilization due to smaller pipeline bubbles (where GPUs aren't overlapping computation).
|
| 21 |
+
gradient_accumulation_steps = 8
|
| 22 |
+
# Grad norm clipping.
|
| 23 |
+
gradient_clipping = 1.0
|
| 24 |
+
# Learning rate warmup.
|
| 25 |
+
warmup_steps = 5
|
| 26 |
+
|
| 27 |
+
# Block swapping is supported for Wan, HunyuanVideo, Flux, and Chroma. This value controls the number
|
| 28 |
+
# of blocks kept offloaded to RAM. Increasing it lowers VRAM use, but has a performance penalty. The
|
| 29 |
+
# exactly performance penalty depends on the model and the type of training you are doing (e.g. images vs video).
|
| 30 |
+
# Block swapping only works for LoRA training, and requires pipeline_stages=1.
|
| 31 |
+
blocks_to_swap = 24
|
| 32 |
+
|
| 33 |
+
# eval settings
|
| 34 |
+
|
| 35 |
+
eval_every_n_epochs = 1
|
| 36 |
+
eval_before_first_step = false
|
| 37 |
+
# Might want to set these lower for eval so that less images get dropped (eval dataset size is usually much smaller than training set).
|
| 38 |
+
# Each size bucket of images/videos is rounded down to the nearest multiple of the global batch size, so higher global batch size means
|
| 39 |
+
# more dropped images. Usually doesn't matter for training but the eval set is much smaller so it can matter.
|
| 40 |
+
eval_micro_batch_size_per_gpu = 1
|
| 41 |
+
eval_gradient_accumulation_steps = 1
|
| 42 |
+
# If using block swap, you can disable it for eval. Eval uses less memory, so depending on block swapping amount you can maybe get away with
|
| 43 |
+
# doing this, and then eval is much faster.
|
| 44 |
+
disable_block_swap_for_eval = true
|
| 45 |
+
|
| 46 |
+
# misc settings
|
| 47 |
+
|
| 48 |
+
# Probably want to set this a bit higher if you have a smaller dataset so you don't end up with a million saved models.
|
| 49 |
+
save_every_n_epochs = 1
|
| 50 |
+
# Can checkpoint the training state every n number of epochs or minutes. Set only one of these. You can resume from checkpoints using the --resume_from_checkpoint flag.
|
| 51 |
+
#checkpoint_every_n_epochs = 1
|
| 52 |
+
checkpoint_every_n_minutes = 60
|
| 53 |
+
# Always set to true unless you have a huge amount of VRAM.
|
| 54 |
+
# This can also be 'unsloth' to reduce VRAM even more, with a slight performance hit.
|
| 55 |
+
activation_checkpointing = true
|
| 56 |
+
|
| 57 |
+
# Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
|
| 58 |
+
partition_method = 'parameters'
|
| 59 |
+
# Alternatively you can use 'manual' in combination with partition_split, which specifies the split points for dividing
|
| 60 |
+
# layers between GPUs. For example, with two GPUs, partition_split=[10] puts layers 0-9 on GPU 0, and the rest on GPU 1.
|
| 61 |
+
# With three GPUs, partition_split=[10, 20] puts layers 0-9 on GPU 0, layers 10-19 on GPU 1, and the rest on GPU 2.
|
| 62 |
+
# Length of partition_split must be pipeline_stages-1.
|
| 63 |
+
#partition_split = [N]
|
| 64 |
+
|
| 65 |
+
# dtype for saving the LoRA or model, if different from training dtype
|
| 66 |
+
save_dtype = 'bfloat16'
|
| 67 |
+
# If experiencing CUDA OOM errors with memory fragmentation, set this env var: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 68 |
+
# Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
|
| 69 |
+
caching_batch_size = 8
|
| 70 |
+
# How often deepspeed logs to console.
|
| 71 |
+
steps_per_print = 100
|
| 72 |
+
# How to extract video clips for training from a single input video file.
|
| 73 |
+
# The video file is first assigned to one of the configured frame buckets, but then we must extract one or more clips of exactly the right
|
| 74 |
+
# number of frames for that bucket.
|
| 75 |
+
# single_beginning: one clip starting at the beginning of the video
|
| 76 |
+
# single_middle: one clip from the middle of the video (cutting off the start and end equally)
|
| 77 |
+
# multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
|
| 78 |
+
# default is single_beginning
|
| 79 |
+
video_clip_mode = 'single_beginning'
|
| 80 |
+
|
| 81 |
+
# This is how you configure HunyuanVideo. Other models will be different. See docs/supported_models.md for
|
| 82 |
+
# details on the configuration and options for each model.
|
| 83 |
+
[model]
|
| 84 |
+
type = 'wan'
|
| 85 |
+
ckpt_path = '/data/shiv/diffusion-pipe/models/wan1.3'
|
| 86 |
+
# Base dtype used for all models.
|
| 87 |
+
dtype = 'bfloat16'
|
| 88 |
+
# Wan supports fp8 for the transformer when training LoRA.
|
| 89 |
+
# transformer_dtype = 'float8'
|
| 90 |
+
# How to sample timesteps to train on. Can be logit_normal or uniform.
|
| 91 |
+
timestep_sample_method = 'logit_normal'
|
| 92 |
+
|
| 93 |
+
# For models that support full fine tuning, simply delete or comment out the [adapter] table to FFT.
|
| 94 |
+
[adapter]
|
| 95 |
+
type = 'lora'
|
| 96 |
+
# Dtype for the LoRA weights you are training.
|
| 97 |
+
dtype = 'bfloat16'
|
| 98 |
+
# LoRA rank - determines capacity to learn (higher = more capacity, more VRAM usage)
|
| 99 |
+
rank = 48
|
| 100 |
+
|
| 101 |
+
# Higher rank = more capacity to learn but uses more VRAM and may overfit
|
| 102 |
+
# The alpha value (scaling factor) is automatically set equal to rank in this codebase
|
| 103 |
+
# You can initialize the lora weights from a previously trained lora.
|
| 104 |
+
init_from_existing = '/data/diffusion_pipe_training_runs/852/20250411_21-03-36/epoch3'
|
| 105 |
+
|
| 106 |
+
[optimizer]
|
| 107 |
+
# AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
|
| 108 |
+
# Look at train.py for other options. You could also easily edit the file and add your own.
|
| 109 |
+
type = 'adamw_optimi'
|
| 110 |
+
lr = 1e-5
|
| 111 |
+
betas = [0.9, 0.99]
|
| 112 |
+
weight_decay = 0.01
|
epoch15/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": null,
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": false,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 48,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 48,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"ffn.0",
|
| 28 |
+
"v",
|
| 29 |
+
"q",
|
| 30 |
+
"o",
|
| 31 |
+
"k",
|
| 32 |
+
"ffn.2"
|
| 33 |
+
],
|
| 34 |
+
"task_type": null,
|
| 35 |
+
"trainable_token_indices": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
epoch15/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:451f68156cc76949c7d2a70831b093d926635cbe8253ff1cb2a7382335a3bd7b
|
| 3 |
+
size 131309776
|
epoch15/main_example.toml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Output path for training runs. Each training run makes a new directory in here.
|
| 2 |
+
output_dir = '/data/diffusion_pipe_training_runs/852'
|
| 3 |
+
|
| 4 |
+
# Dataset config file.
|
| 5 |
+
dataset = '/data/shiv/diffusion-pipe/examples/852_dataset.toml'
|
| 6 |
+
# You can have separate eval datasets. Give them a name for Tensorboard metrics.
|
| 7 |
+
# eval_datasets = [
|
| 8 |
+
# {name = 'something', config = 'path/to/eval_dataset.toml'},
|
| 9 |
+
# ]
|
| 10 |
+
|
| 11 |
+
# training settings
|
| 12 |
+
|
| 13 |
+
# I usually set this to a really high value because I don't know how long I want to train.
|
| 14 |
+
epochs = 1000
|
| 15 |
+
# Batch size of a single forward/backward pass for one GPU.
|
| 16 |
+
micro_batch_size_per_gpu = 16
|
| 17 |
+
# Pipeline parallelism degree. A single instance of the model is divided across this many GPUs.
|
| 18 |
+
pipeline_stages = 1
|
| 19 |
+
# Number of micro-batches sent through the pipeline for each training step.
|
| 20 |
+
# If pipeline_stages > 1, a higher GAS means better GPU utilization due to smaller pipeline bubbles (where GPUs aren't overlapping computation).
|
| 21 |
+
gradient_accumulation_steps = 8
|
| 22 |
+
# Grad norm clipping.
|
| 23 |
+
gradient_clipping = 1.0
|
| 24 |
+
# Learning rate warmup.
|
| 25 |
+
warmup_steps = 5
|
| 26 |
+
|
| 27 |
+
# Block swapping is supported for Wan, HunyuanVideo, Flux, and Chroma. This value controls the number
|
| 28 |
+
# of blocks kept offloaded to RAM. Increasing it lowers VRAM use, but has a performance penalty. The
|
| 29 |
+
# exactly performance penalty depends on the model and the type of training you are doing (e.g. images vs video).
|
| 30 |
+
# Block swapping only works for LoRA training, and requires pipeline_stages=1.
|
| 31 |
+
blocks_to_swap = 24
|
| 32 |
+
|
| 33 |
+
# eval settings
|
| 34 |
+
|
| 35 |
+
eval_every_n_epochs = 1
|
| 36 |
+
eval_before_first_step = false
|
| 37 |
+
# Might want to set these lower for eval so that less images get dropped (eval dataset size is usually much smaller than training set).
|
| 38 |
+
# Each size bucket of images/videos is rounded down to the nearest multiple of the global batch size, so higher global batch size means
|
| 39 |
+
# more dropped images. Usually doesn't matter for training but the eval set is much smaller so it can matter.
|
| 40 |
+
eval_micro_batch_size_per_gpu = 1
|
| 41 |
+
eval_gradient_accumulation_steps = 1
|
| 42 |
+
# If using block swap, you can disable it for eval. Eval uses less memory, so depending on block swapping amount you can maybe get away with
|
| 43 |
+
# doing this, and then eval is much faster.
|
| 44 |
+
disable_block_swap_for_eval = true
|
| 45 |
+
|
| 46 |
+
# misc settings
|
| 47 |
+
|
| 48 |
+
# Probably want to set this a bit higher if you have a smaller dataset so you don't end up with a million saved models.
|
| 49 |
+
save_every_n_epochs = 1
|
| 50 |
+
# Can checkpoint the training state every n number of epochs or minutes. Set only one of these. You can resume from checkpoints using the --resume_from_checkpoint flag.
|
| 51 |
+
#checkpoint_every_n_epochs = 1
|
| 52 |
+
checkpoint_every_n_minutes = 60
|
| 53 |
+
# Always set to true unless you have a huge amount of VRAM.
|
| 54 |
+
# This can also be 'unsloth' to reduce VRAM even more, with a slight performance hit.
|
| 55 |
+
activation_checkpointing = true
|
| 56 |
+
|
| 57 |
+
# Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
|
| 58 |
+
partition_method = 'parameters'
|
| 59 |
+
# Alternatively you can use 'manual' in combination with partition_split, which specifies the split points for dividing
|
| 60 |
+
# layers between GPUs. For example, with two GPUs, partition_split=[10] puts layers 0-9 on GPU 0, and the rest on GPU 1.
|
| 61 |
+
# With three GPUs, partition_split=[10, 20] puts layers 0-9 on GPU 0, layers 10-19 on GPU 1, and the rest on GPU 2.
|
| 62 |
+
# Length of partition_split must be pipeline_stages-1.
|
| 63 |
+
#partition_split = [N]
|
| 64 |
+
|
| 65 |
+
# dtype for saving the LoRA or model, if different from training dtype
|
| 66 |
+
save_dtype = 'bfloat16'
|
| 67 |
+
# If experiencing CUDA OOM errors with memory fragmentation, set this env var: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 68 |
+
# Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
|
| 69 |
+
caching_batch_size = 8
|
| 70 |
+
# How often deepspeed logs to console.
|
| 71 |
+
steps_per_print = 100
|
| 72 |
+
# How to extract video clips for training from a single input video file.
|
| 73 |
+
# The video file is first assigned to one of the configured frame buckets, but then we must extract one or more clips of exactly the right
|
| 74 |
+
# number of frames for that bucket.
|
| 75 |
+
# single_beginning: one clip starting at the beginning of the video
|
| 76 |
+
# single_middle: one clip from the middle of the video (cutting off the start and end equally)
|
| 77 |
+
# multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
|
| 78 |
+
# default is single_beginning
|
| 79 |
+
video_clip_mode = 'single_beginning'
|
| 80 |
+
|
| 81 |
+
# This is how you configure HunyuanVideo. Other models will be different. See docs/supported_models.md for
|
| 82 |
+
# details on the configuration and options for each model.
|
| 83 |
+
[model]
|
| 84 |
+
type = 'wan'
|
| 85 |
+
ckpt_path = '/data/shiv/diffusion-pipe/models/wan1.3'
|
| 86 |
+
# Base dtype used for all models.
|
| 87 |
+
dtype = 'bfloat16'
|
| 88 |
+
# Wan supports fp8 for the transformer when training LoRA.
|
| 89 |
+
# transformer_dtype = 'float8'
|
| 90 |
+
# How to sample timesteps to train on. Can be logit_normal or uniform.
|
| 91 |
+
timestep_sample_method = 'logit_normal'
|
| 92 |
+
|
| 93 |
+
# For models that support full fine tuning, simply delete or comment out the [adapter] table to FFT.
|
| 94 |
+
[adapter]
|
| 95 |
+
type = 'lora'
|
| 96 |
+
# Dtype for the LoRA weights you are training.
|
| 97 |
+
dtype = 'bfloat16'
|
| 98 |
+
# LoRA rank - determines capacity to learn (higher = more capacity, more VRAM usage)
|
| 99 |
+
rank = 48
|
| 100 |
+
|
| 101 |
+
# Higher rank = more capacity to learn but uses more VRAM and may overfit
|
| 102 |
+
# The alpha value (scaling factor) is automatically set equal to rank in this codebase
|
| 103 |
+
# You can initialize the lora weights from a previously trained lora.
|
| 104 |
+
init_from_existing = '/data/diffusion_pipe_training_runs/852/20250411_21-03-36/epoch3'
|
| 105 |
+
|
| 106 |
+
[optimizer]
|
| 107 |
+
# AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
|
| 108 |
+
# Look at train.py for other options. You could also easily edit the file and add your own.
|
| 109 |
+
type = 'adamw_optimi'
|
| 110 |
+
lr = 1e-5
|
| 111 |
+
betas = [0.9, 0.99]
|
| 112 |
+
weight_decay = 0.01
|
epoch16/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": null,
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": false,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 48,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 48,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"ffn.0",
|
| 28 |
+
"v",
|
| 29 |
+
"q",
|
| 30 |
+
"o",
|
| 31 |
+
"k",
|
| 32 |
+
"ffn.2"
|
| 33 |
+
],
|
| 34 |
+
"task_type": null,
|
| 35 |
+
"trainable_token_indices": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
epoch16/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:08f75e871f448c45369de1963e36c708bbcc80911bd2882fac87fe1555d5b4b1
|
| 3 |
+
size 131309776
|
epoch16/main_example.toml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Output path for training runs. Each training run makes a new directory in here.
|
| 2 |
+
output_dir = '/data/diffusion_pipe_training_runs/852'
|
| 3 |
+
|
| 4 |
+
# Dataset config file.
|
| 5 |
+
dataset = '/data/shiv/diffusion-pipe/examples/852_dataset.toml'
|
| 6 |
+
# You can have separate eval datasets. Give them a name for Tensorboard metrics.
|
| 7 |
+
# eval_datasets = [
|
| 8 |
+
# {name = 'something', config = 'path/to/eval_dataset.toml'},
|
| 9 |
+
# ]
|
| 10 |
+
|
| 11 |
+
# training settings
|
| 12 |
+
|
| 13 |
+
# I usually set this to a really high value because I don't know how long I want to train.
|
| 14 |
+
epochs = 1000
|
| 15 |
+
# Batch size of a single forward/backward pass for one GPU.
|
| 16 |
+
micro_batch_size_per_gpu = 16
|
| 17 |
+
# Pipeline parallelism degree. A single instance of the model is divided across this many GPUs.
|
| 18 |
+
pipeline_stages = 1
|
| 19 |
+
# Number of micro-batches sent through the pipeline for each training step.
|
| 20 |
+
# If pipeline_stages > 1, a higher GAS means better GPU utilization due to smaller pipeline bubbles (where GPUs aren't overlapping computation).
|
| 21 |
+
gradient_accumulation_steps = 8
|
| 22 |
+
# Grad norm clipping.
|
| 23 |
+
gradient_clipping = 1.0
|
| 24 |
+
# Learning rate warmup.
|
| 25 |
+
warmup_steps = 5
|
| 26 |
+
|
| 27 |
+
# Block swapping is supported for Wan, HunyuanVideo, Flux, and Chroma. This value controls the number
|
| 28 |
+
# of blocks kept offloaded to RAM. Increasing it lowers VRAM use, but has a performance penalty. The
|
| 29 |
+
# exactly performance penalty depends on the model and the type of training you are doing (e.g. images vs video).
|
| 30 |
+
# Block swapping only works for LoRA training, and requires pipeline_stages=1.
|
| 31 |
+
blocks_to_swap = 24
|
| 32 |
+
|
| 33 |
+
# eval settings
|
| 34 |
+
|
| 35 |
+
eval_every_n_epochs = 1
|
| 36 |
+
eval_before_first_step = false
|
| 37 |
+
# Might want to set these lower for eval so that less images get dropped (eval dataset size is usually much smaller than training set).
|
| 38 |
+
# Each size bucket of images/videos is rounded down to the nearest multiple of the global batch size, so higher global batch size means
|
| 39 |
+
# more dropped images. Usually doesn't matter for training but the eval set is much smaller so it can matter.
|
| 40 |
+
eval_micro_batch_size_per_gpu = 1
|
| 41 |
+
eval_gradient_accumulation_steps = 1
|
| 42 |
+
# If using block swap, you can disable it for eval. Eval uses less memory, so depending on block swapping amount you can maybe get away with
|
| 43 |
+
# doing this, and then eval is much faster.
|
| 44 |
+
disable_block_swap_for_eval = true
|
| 45 |
+
|
| 46 |
+
# misc settings
|
| 47 |
+
|
| 48 |
+
# Probably want to set this a bit higher if you have a smaller dataset so you don't end up with a million saved models.
|
| 49 |
+
save_every_n_epochs = 1
|
| 50 |
+
# Can checkpoint the training state every n number of epochs or minutes. Set only one of these. You can resume from checkpoints using the --resume_from_checkpoint flag.
|
| 51 |
+
#checkpoint_every_n_epochs = 1
|
| 52 |
+
checkpoint_every_n_minutes = 60
|
| 53 |
+
# Always set to true unless you have a huge amount of VRAM.
|
| 54 |
+
# This can also be 'unsloth' to reduce VRAM even more, with a slight performance hit.
|
| 55 |
+
activation_checkpointing = true
|
| 56 |
+
|
| 57 |
+
# Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
|
| 58 |
+
partition_method = 'parameters'
|
| 59 |
+
# Alternatively you can use 'manual' in combination with partition_split, which specifies the split points for dividing
|
| 60 |
+
# layers between GPUs. For example, with two GPUs, partition_split=[10] puts layers 0-9 on GPU 0, and the rest on GPU 1.
|
| 61 |
+
# With three GPUs, partition_split=[10, 20] puts layers 0-9 on GPU 0, layers 10-19 on GPU 1, and the rest on GPU 2.
|
| 62 |
+
# Length of partition_split must be pipeline_stages-1.
|
| 63 |
+
#partition_split = [N]
|
| 64 |
+
|
| 65 |
+
# dtype for saving the LoRA or model, if different from training dtype
|
| 66 |
+
save_dtype = 'bfloat16'
|
| 67 |
+
# If experiencing CUDA OOM errors with memory fragmentation, set this env var: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 68 |
+
# Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
|
| 69 |
+
caching_batch_size = 8
|
| 70 |
+
# How often deepspeed logs to console.
|
| 71 |
+
steps_per_print = 100
|
| 72 |
+
# How to extract video clips for training from a single input video file.
|
| 73 |
+
# The video file is first assigned to one of the configured frame buckets, but then we must extract one or more clips of exactly the right
|
| 74 |
+
# number of frames for that bucket.
|
| 75 |
+
# single_beginning: one clip starting at the beginning of the video
|
| 76 |
+
# single_middle: one clip from the middle of the video (cutting off the start and end equally)
|
| 77 |
+
# multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
|
| 78 |
+
# default is single_beginning
|
| 79 |
+
video_clip_mode = 'single_beginning'
|
| 80 |
+
|
| 81 |
+
# This is how you configure HunyuanVideo. Other models will be different. See docs/supported_models.md for
|
| 82 |
+
# details on the configuration and options for each model.
|
| 83 |
+
[model]
|
| 84 |
+
type = 'wan'
|
| 85 |
+
ckpt_path = '/data/shiv/diffusion-pipe/models/wan1.3'
|
| 86 |
+
# Base dtype used for all models.
|
| 87 |
+
dtype = 'bfloat16'
|
| 88 |
+
# Wan supports fp8 for the transformer when training LoRA.
|
| 89 |
+
# transformer_dtype = 'float8'
|
| 90 |
+
# How to sample timesteps to train on. Can be logit_normal or uniform.
|
| 91 |
+
timestep_sample_method = 'logit_normal'
|
| 92 |
+
|
| 93 |
+
# For models that support full fine tuning, simply delete or comment out the [adapter] table to FFT.
|
| 94 |
+
[adapter]
|
| 95 |
+
type = 'lora'
|
| 96 |
+
# Dtype for the LoRA weights you are training.
|
| 97 |
+
dtype = 'bfloat16'
|
| 98 |
+
# LoRA rank - determines capacity to learn (higher = more capacity, more VRAM usage)
|
| 99 |
+
rank = 48
|
| 100 |
+
|
| 101 |
+
# Higher rank = more capacity to learn but uses more VRAM and may overfit
|
| 102 |
+
# The alpha value (scaling factor) is automatically set equal to rank in this codebase
|
| 103 |
+
# You can initialize the lora weights from a previously trained lora.
|
| 104 |
+
init_from_existing = '/data/diffusion_pipe_training_runs/852/20250411_21-03-36/epoch3'
|
| 105 |
+
|
| 106 |
+
[optimizer]
|
| 107 |
+
# AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
|
| 108 |
+
# Look at train.py for other options. You could also easily edit the file and add your own.
|
| 109 |
+
type = 'adamw_optimi'
|
| 110 |
+
lr = 1e-5
|
| 111 |
+
betas = [0.9, 0.99]
|
| 112 |
+
weight_decay = 0.01
|
epoch2/.adapter_model.safetensors.xd7wPd
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:10c533ac4f4e367c1fe51f90aa2d12549c4081541346e8ccc278b082b95d55b0
|
| 3 |
+
size 12845056
|
epoch2/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": null,
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": false,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 48,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 48,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"ffn.0",
|
| 28 |
+
"v",
|
| 29 |
+
"q",
|
| 30 |
+
"o",
|
| 31 |
+
"k",
|
| 32 |
+
"ffn.2"
|
| 33 |
+
],
|
| 34 |
+
"task_type": null,
|
| 35 |
+
"trainable_token_indices": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
epoch2/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1579443bf437b9e4bbcf20632d92d8c8c0f04fa1c4c58b65f60d8524e4c7e4dc
|
| 3 |
+
size 131309776
|
epoch2/main_example.toml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Output path for training runs. Each training run makes a new directory in here.
|
| 2 |
+
output_dir = '/data/diffusion_pipe_training_runs/852'
|
| 3 |
+
|
| 4 |
+
# Dataset config file.
|
| 5 |
+
dataset = '/data/shiv/diffusion-pipe/examples/852_dataset.toml'
|
| 6 |
+
# You can have separate eval datasets. Give them a name for Tensorboard metrics.
|
| 7 |
+
# eval_datasets = [
|
| 8 |
+
# {name = 'something', config = 'path/to/eval_dataset.toml'},
|
| 9 |
+
# ]
|
| 10 |
+
|
| 11 |
+
# training settings
|
| 12 |
+
|
| 13 |
+
# I usually set this to a really high value because I don't know how long I want to train.
|
| 14 |
+
epochs = 1000
|
| 15 |
+
# Batch size of a single forward/backward pass for one GPU.
|
| 16 |
+
micro_batch_size_per_gpu = 16
|
| 17 |
+
# Pipeline parallelism degree. A single instance of the model is divided across this many GPUs.
|
| 18 |
+
pipeline_stages = 1
|
| 19 |
+
# Number of micro-batches sent through the pipeline for each training step.
|
| 20 |
+
# If pipeline_stages > 1, a higher GAS means better GPU utilization due to smaller pipeline bubbles (where GPUs aren't overlapping computation).
|
| 21 |
+
gradient_accumulation_steps = 8
|
| 22 |
+
# Grad norm clipping.
|
| 23 |
+
gradient_clipping = 1.0
|
| 24 |
+
# Learning rate warmup.
|
| 25 |
+
warmup_steps = 5
|
| 26 |
+
|
| 27 |
+
# Block swapping is supported for Wan, HunyuanVideo, Flux, and Chroma. This value controls the number
|
| 28 |
+
# of blocks kept offloaded to RAM. Increasing it lowers VRAM use, but has a performance penalty. The
|
| 29 |
+
# exactly performance penalty depends on the model and the type of training you are doing (e.g. images vs video).
|
| 30 |
+
# Block swapping only works for LoRA training, and requires pipeline_stages=1.
|
| 31 |
+
blocks_to_swap = 24
|
| 32 |
+
|
| 33 |
+
# eval settings
|
| 34 |
+
|
| 35 |
+
eval_every_n_epochs = 1
|
| 36 |
+
eval_before_first_step = false
|
| 37 |
+
# Might want to set these lower for eval so that less images get dropped (eval dataset size is usually much smaller than training set).
|
| 38 |
+
# Each size bucket of images/videos is rounded down to the nearest multiple of the global batch size, so higher global batch size means
|
| 39 |
+
# more dropped images. Usually doesn't matter for training but the eval set is much smaller so it can matter.
|
| 40 |
+
eval_micro_batch_size_per_gpu = 1
|
| 41 |
+
eval_gradient_accumulation_steps = 1
|
| 42 |
+
# If using block swap, you can disable it for eval. Eval uses less memory, so depending on block swapping amount you can maybe get away with
|
| 43 |
+
# doing this, and then eval is much faster.
|
| 44 |
+
disable_block_swap_for_eval = true
|
| 45 |
+
|
| 46 |
+
# misc settings
|
| 47 |
+
|
| 48 |
+
# Probably want to set this a bit higher if you have a smaller dataset so you don't end up with a million saved models.
|
| 49 |
+
save_every_n_epochs = 1
|
| 50 |
+
# Can checkpoint the training state every n number of epochs or minutes. Set only one of these. You can resume from checkpoints using the --resume_from_checkpoint flag.
|
| 51 |
+
#checkpoint_every_n_epochs = 1
|
| 52 |
+
checkpoint_every_n_minutes = 60
|
| 53 |
+
# Always set to true unless you have a huge amount of VRAM.
|
| 54 |
+
# This can also be 'unsloth' to reduce VRAM even more, with a slight performance hit.
|
| 55 |
+
activation_checkpointing = true
|
| 56 |
+
|
| 57 |
+
# Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
|
| 58 |
+
partition_method = 'parameters'
|
| 59 |
+
# Alternatively you can use 'manual' in combination with partition_split, which specifies the split points for dividing
|
| 60 |
+
# layers between GPUs. For example, with two GPUs, partition_split=[10] puts layers 0-9 on GPU 0, and the rest on GPU 1.
|
| 61 |
+
# With three GPUs, partition_split=[10, 20] puts layers 0-9 on GPU 0, layers 10-19 on GPU 1, and the rest on GPU 2.
|
| 62 |
+
# Length of partition_split must be pipeline_stages-1.
|
| 63 |
+
#partition_split = [N]
|
| 64 |
+
|
| 65 |
+
# dtype for saving the LoRA or model, if different from training dtype
|
| 66 |
+
save_dtype = 'bfloat16'
|
| 67 |
+
# If experiencing CUDA OOM errors with memory fragmentation, set this env var: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 68 |
+
# Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
|
| 69 |
+
caching_batch_size = 8
|
| 70 |
+
# How often deepspeed logs to console.
|
| 71 |
+
steps_per_print = 100
|
| 72 |
+
# How to extract video clips for training from a single input video file.
|
| 73 |
+
# The video file is first assigned to one of the configured frame buckets, but then we must extract one or more clips of exactly the right
|
| 74 |
+
# number of frames for that bucket.
|
| 75 |
+
# single_beginning: one clip starting at the beginning of the video
|
| 76 |
+
# single_middle: one clip from the middle of the video (cutting off the start and end equally)
|
| 77 |
+
# multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
|
| 78 |
+
# default is single_beginning
|
| 79 |
+
video_clip_mode = 'single_beginning'
|
| 80 |
+
|
| 81 |
+
# This is how you configure HunyuanVideo. Other models will be different. See docs/supported_models.md for
|
| 82 |
+
# details on the configuration and options for each model.
|
| 83 |
+
[model]
|
| 84 |
+
type = 'wan'
|
| 85 |
+
ckpt_path = '/data/shiv/diffusion-pipe/models/wan1.3'
|
| 86 |
+
# Base dtype used for all models.
|
| 87 |
+
dtype = 'bfloat16'
|
| 88 |
+
# Wan supports fp8 for the transformer when training LoRA.
|
| 89 |
+
# transformer_dtype = 'float8'
|
| 90 |
+
# How to sample timesteps to train on. Can be logit_normal or uniform.
|
| 91 |
+
timestep_sample_method = 'logit_normal'
|
| 92 |
+
|
| 93 |
+
# For models that support full fine tuning, simply delete or comment out the [adapter] table to FFT.
|
| 94 |
+
[adapter]
|
| 95 |
+
type = 'lora'
|
| 96 |
+
# Dtype for the LoRA weights you are training.
|
| 97 |
+
dtype = 'bfloat16'
|
| 98 |
+
# LoRA rank - determines capacity to learn (higher = more capacity, more VRAM usage)
|
| 99 |
+
rank = 48
|
| 100 |
+
|
| 101 |
+
# Higher rank = more capacity to learn but uses more VRAM and may overfit
|
| 102 |
+
# The alpha value (scaling factor) is automatically set equal to rank in this codebase
|
| 103 |
+
# You can initialize the lora weights from a previously trained lora.
|
| 104 |
+
init_from_existing = '/data/diffusion_pipe_training_runs/852/20250411_21-03-36/epoch3'
|
| 105 |
+
|
| 106 |
+
[optimizer]
|
| 107 |
+
# AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
|
| 108 |
+
# Look at train.py for other options. You could also easily edit the file and add your own.
|
| 109 |
+
type = 'adamw_optimi'
|
| 110 |
+
lr = 1e-5
|
| 111 |
+
betas = [0.9, 0.99]
|
| 112 |
+
weight_decay = 0.01
|
epoch3/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": null,
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": false,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 48,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 48,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"ffn.0",
|
| 28 |
+
"v",
|
| 29 |
+
"q",
|
| 30 |
+
"o",
|
| 31 |
+
"k",
|
| 32 |
+
"ffn.2"
|
| 33 |
+
],
|
| 34 |
+
"task_type": null,
|
| 35 |
+
"trainable_token_indices": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
epoch3/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f9b74d4d1ac0d6be9574a9705cebb1e7ca24f5bda8aacbb578f5a211676c6483
|
| 3 |
+
size 131309776
|
epoch3/main_example.toml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Output path for training runs. Each training run makes a new directory in here.
|
| 2 |
+
output_dir = '/data/diffusion_pipe_training_runs/852'
|
| 3 |
+
|
| 4 |
+
# Dataset config file.
|
| 5 |
+
dataset = '/data/shiv/diffusion-pipe/examples/852_dataset.toml'
|
| 6 |
+
# You can have separate eval datasets. Give them a name for Tensorboard metrics.
|
| 7 |
+
# eval_datasets = [
|
| 8 |
+
# {name = 'something', config = 'path/to/eval_dataset.toml'},
|
| 9 |
+
# ]
|
| 10 |
+
|
| 11 |
+
# training settings
|
| 12 |
+
|
| 13 |
+
# I usually set this to a really high value because I don't know how long I want to train.
|
| 14 |
+
epochs = 1000
|
| 15 |
+
# Batch size of a single forward/backward pass for one GPU.
|
| 16 |
+
micro_batch_size_per_gpu = 16
|
| 17 |
+
# Pipeline parallelism degree. A single instance of the model is divided across this many GPUs.
|
| 18 |
+
pipeline_stages = 1
|
| 19 |
+
# Number of micro-batches sent through the pipeline for each training step.
|
| 20 |
+
# If pipeline_stages > 1, a higher GAS means better GPU utilization due to smaller pipeline bubbles (where GPUs aren't overlapping computation).
|
| 21 |
+
gradient_accumulation_steps = 8
|
| 22 |
+
# Grad norm clipping.
|
| 23 |
+
gradient_clipping = 1.0
|
| 24 |
+
# Learning rate warmup.
|
| 25 |
+
warmup_steps = 5
|
| 26 |
+
|
| 27 |
+
# Block swapping is supported for Wan, HunyuanVideo, Flux, and Chroma. This value controls the number
|
| 28 |
+
# of blocks kept offloaded to RAM. Increasing it lowers VRAM use, but has a performance penalty. The
|
| 29 |
+
# exactly performance penalty depends on the model and the type of training you are doing (e.g. images vs video).
|
| 30 |
+
# Block swapping only works for LoRA training, and requires pipeline_stages=1.
|
| 31 |
+
blocks_to_swap = 24
|
| 32 |
+
|
| 33 |
+
# eval settings
|
| 34 |
+
|
| 35 |
+
eval_every_n_epochs = 1
|
| 36 |
+
eval_before_first_step = false
|
| 37 |
+
# Might want to set these lower for eval so that less images get dropped (eval dataset size is usually much smaller than training set).
|
| 38 |
+
# Each size bucket of images/videos is rounded down to the nearest multiple of the global batch size, so higher global batch size means
|
| 39 |
+
# more dropped images. Usually doesn't matter for training but the eval set is much smaller so it can matter.
|
| 40 |
+
eval_micro_batch_size_per_gpu = 1
|
| 41 |
+
eval_gradient_accumulation_steps = 1
|
| 42 |
+
# If using block swap, you can disable it for eval. Eval uses less memory, so depending on block swapping amount you can maybe get away with
|
| 43 |
+
# doing this, and then eval is much faster.
|
| 44 |
+
disable_block_swap_for_eval = true
|
| 45 |
+
|
| 46 |
+
# misc settings
|
| 47 |
+
|
| 48 |
+
# Probably want to set this a bit higher if you have a smaller dataset so you don't end up with a million saved models.
|
| 49 |
+
save_every_n_epochs = 1
|
| 50 |
+
# Can checkpoint the training state every n number of epochs or minutes. Set only one of these. You can resume from checkpoints using the --resume_from_checkpoint flag.
|
| 51 |
+
#checkpoint_every_n_epochs = 1
|
| 52 |
+
checkpoint_every_n_minutes = 60
|
| 53 |
+
# Always set to true unless you have a huge amount of VRAM.
|
| 54 |
+
# This can also be 'unsloth' to reduce VRAM even more, with a slight performance hit.
|
| 55 |
+
activation_checkpointing = true
|
| 56 |
+
|
| 57 |
+
# Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
|
| 58 |
+
partition_method = 'parameters'
|
| 59 |
+
# Alternatively you can use 'manual' in combination with partition_split, which specifies the split points for dividing
|
| 60 |
+
# layers between GPUs. For example, with two GPUs, partition_split=[10] puts layers 0-9 on GPU 0, and the rest on GPU 1.
|
| 61 |
+
# With three GPUs, partition_split=[10, 20] puts layers 0-9 on GPU 0, layers 10-19 on GPU 1, and the rest on GPU 2.
|
| 62 |
+
# Length of partition_split must be pipeline_stages-1.
|
| 63 |
+
#partition_split = [N]
|
| 64 |
+
|
| 65 |
+
# dtype for saving the LoRA or model, if different from training dtype
|
| 66 |
+
save_dtype = 'bfloat16'
|
| 67 |
+
# If experiencing CUDA OOM errors with memory fragmentation, set this env var: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 68 |
+
# Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
|
| 69 |
+
caching_batch_size = 8
|
| 70 |
+
# How often deepspeed logs to console.
|
| 71 |
+
steps_per_print = 100
|
| 72 |
+
# How to extract video clips for training from a single input video file.
|
| 73 |
+
# The video file is first assigned to one of the configured frame buckets, but then we must extract one or more clips of exactly the right
|
| 74 |
+
# number of frames for that bucket.
|
| 75 |
+
# single_beginning: one clip starting at the beginning of the video
|
| 76 |
+
# single_middle: one clip from the middle of the video (cutting off the start and end equally)
|
| 77 |
+
# multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
|
| 78 |
+
# default is single_beginning
|
| 79 |
+
video_clip_mode = 'single_beginning'
|
| 80 |
+
|
| 81 |
+
# This is how you configure HunyuanVideo. Other models will be different. See docs/supported_models.md for
|
| 82 |
+
# details on the configuration and options for each model.
|
| 83 |
+
[model]
|
| 84 |
+
type = 'wan'
|
| 85 |
+
ckpt_path = '/data/shiv/diffusion-pipe/models/wan1.3'
|
| 86 |
+
# Base dtype used for all models.
|
| 87 |
+
dtype = 'bfloat16'
|
| 88 |
+
# Wan supports fp8 for the transformer when training LoRA.
|
| 89 |
+
# transformer_dtype = 'float8'
|
| 90 |
+
# How to sample timesteps to train on. Can be logit_normal or uniform.
|
| 91 |
+
timestep_sample_method = 'logit_normal'
|
| 92 |
+
|
| 93 |
+
# For models that support full fine tuning, simply delete or comment out the [adapter] table to FFT.
|
| 94 |
+
[adapter]
|
| 95 |
+
type = 'lora'
|
| 96 |
+
# Dtype for the LoRA weights you are training.
|
| 97 |
+
dtype = 'bfloat16'
|
| 98 |
+
# LoRA rank - determines capacity to learn (higher = more capacity, more VRAM usage)
|
| 99 |
+
rank = 48
|
| 100 |
+
|
| 101 |
+
# Higher rank = more capacity to learn but uses more VRAM and may overfit
|
| 102 |
+
# The alpha value (scaling factor) is automatically set equal to rank in this codebase
|
| 103 |
+
# You can initialize the lora weights from a previously trained lora.
|
| 104 |
+
init_from_existing = '/data/diffusion_pipe_training_runs/852/20250411_21-03-36/epoch3'
|
| 105 |
+
|
| 106 |
+
[optimizer]
|
| 107 |
+
# AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
|
| 108 |
+
# Look at train.py for other options. You could also easily edit the file and add your own.
|
| 109 |
+
type = 'adamw_optimi'
|
| 110 |
+
lr = 1e-5
|
| 111 |
+
betas = [0.9, 0.99]
|
| 112 |
+
weight_decay = 0.01
|
epoch4/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": null,
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": false,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 48,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 48,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"ffn.0",
|
| 28 |
+
"v",
|
| 29 |
+
"q",
|
| 30 |
+
"o",
|
| 31 |
+
"k",
|
| 32 |
+
"ffn.2"
|
| 33 |
+
],
|
| 34 |
+
"task_type": null,
|
| 35 |
+
"trainable_token_indices": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
epoch4/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c0324be93b40dbc5c6bd7375d132167b631e4cc0caf572d7893d185c3adbef1b
|
| 3 |
+
size 131309776
|
epoch4/main_example.toml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Output path for training runs. Each training run makes a new directory in here.
|
| 2 |
+
output_dir = '/data/diffusion_pipe_training_runs/852'
|
| 3 |
+
|
| 4 |
+
# Dataset config file.
|
| 5 |
+
dataset = '/data/shiv/diffusion-pipe/examples/852_dataset.toml'
|
| 6 |
+
# You can have separate eval datasets. Give them a name for Tensorboard metrics.
|
| 7 |
+
# eval_datasets = [
|
| 8 |
+
# {name = 'something', config = 'path/to/eval_dataset.toml'},
|
| 9 |
+
# ]
|
| 10 |
+
|
| 11 |
+
# training settings
|
| 12 |
+
|
| 13 |
+
# I usually set this to a really high value because I don't know how long I want to train.
|
| 14 |
+
epochs = 1000
|
| 15 |
+
# Batch size of a single forward/backward pass for one GPU.
|
| 16 |
+
micro_batch_size_per_gpu = 16
|
| 17 |
+
# Pipeline parallelism degree. A single instance of the model is divided across this many GPUs.
|
| 18 |
+
pipeline_stages = 1
|
| 19 |
+
# Number of micro-batches sent through the pipeline for each training step.
|
| 20 |
+
# If pipeline_stages > 1, a higher GAS means better GPU utilization due to smaller pipeline bubbles (where GPUs aren't overlapping computation).
|
| 21 |
+
gradient_accumulation_steps = 8
|
| 22 |
+
# Grad norm clipping.
|
| 23 |
+
gradient_clipping = 1.0
|
| 24 |
+
# Learning rate warmup.
|
| 25 |
+
warmup_steps = 5
|
| 26 |
+
|
| 27 |
+
# Block swapping is supported for Wan, HunyuanVideo, Flux, and Chroma. This value controls the number
|
| 28 |
+
# of blocks kept offloaded to RAM. Increasing it lowers VRAM use, but has a performance penalty. The
|
| 29 |
+
# exactly performance penalty depends on the model and the type of training you are doing (e.g. images vs video).
|
| 30 |
+
# Block swapping only works for LoRA training, and requires pipeline_stages=1.
|
| 31 |
+
blocks_to_swap = 24
|
| 32 |
+
|
| 33 |
+
# eval settings
|
| 34 |
+
|
| 35 |
+
eval_every_n_epochs = 1
|
| 36 |
+
eval_before_first_step = false
|
| 37 |
+
# Might want to set these lower for eval so that less images get dropped (eval dataset size is usually much smaller than training set).
|
| 38 |
+
# Each size bucket of images/videos is rounded down to the nearest multiple of the global batch size, so higher global batch size means
|
| 39 |
+
# more dropped images. Usually doesn't matter for training but the eval set is much smaller so it can matter.
|
| 40 |
+
eval_micro_batch_size_per_gpu = 1
|
| 41 |
+
eval_gradient_accumulation_steps = 1
|
| 42 |
+
# If using block swap, you can disable it for eval. Eval uses less memory, so depending on block swapping amount you can maybe get away with
|
| 43 |
+
# doing this, and then eval is much faster.
|
| 44 |
+
disable_block_swap_for_eval = true
|
| 45 |
+
|
| 46 |
+
# misc settings
|
| 47 |
+
|
| 48 |
+
# Probably want to set this a bit higher if you have a smaller dataset so you don't end up with a million saved models.
|
| 49 |
+
save_every_n_epochs = 1
|
| 50 |
+
# Can checkpoint the training state every n number of epochs or minutes. Set only one of these. You can resume from checkpoints using the --resume_from_checkpoint flag.
|
| 51 |
+
#checkpoint_every_n_epochs = 1
|
| 52 |
+
checkpoint_every_n_minutes = 60
|
| 53 |
+
# Always set to true unless you have a huge amount of VRAM.
|
| 54 |
+
# This can also be 'unsloth' to reduce VRAM even more, with a slight performance hit.
|
| 55 |
+
activation_checkpointing = true
|
| 56 |
+
|
| 57 |
+
# Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
|
| 58 |
+
partition_method = 'parameters'
|
| 59 |
+
# Alternatively you can use 'manual' in combination with partition_split, which specifies the split points for dividing
|
| 60 |
+
# layers between GPUs. For example, with two GPUs, partition_split=[10] puts layers 0-9 on GPU 0, and the rest on GPU 1.
|
| 61 |
+
# With three GPUs, partition_split=[10, 20] puts layers 0-9 on GPU 0, layers 10-19 on GPU 1, and the rest on GPU 2.
|
| 62 |
+
# Length of partition_split must be pipeline_stages-1.
|
| 63 |
+
#partition_split = [N]
|
| 64 |
+
|
| 65 |
+
# dtype for saving the LoRA or model, if different from training dtype
|
| 66 |
+
save_dtype = 'bfloat16'
|
| 67 |
+
# If experiencing CUDA OOM errors with memory fragmentation, set this env var: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 68 |
+
# Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
|
| 69 |
+
caching_batch_size = 8
|
| 70 |
+
# How often deepspeed logs to console.
|
| 71 |
+
steps_per_print = 100
|
| 72 |
+
# How to extract video clips for training from a single input video file.
|
| 73 |
+
# The video file is first assigned to one of the configured frame buckets, but then we must extract one or more clips of exactly the right
|
| 74 |
+
# number of frames for that bucket.
|
| 75 |
+
# single_beginning: one clip starting at the beginning of the video
|
| 76 |
+
# single_middle: one clip from the middle of the video (cutting off the start and end equally)
|
| 77 |
+
# multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
|
| 78 |
+
# default is single_beginning
|
| 79 |
+
video_clip_mode = 'single_beginning'
|
| 80 |
+
|
| 81 |
+
# This is how you configure HunyuanVideo. Other models will be different. See docs/supported_models.md for
|
| 82 |
+
# details on the configuration and options for each model.
|
| 83 |
+
[model]
|
| 84 |
+
type = 'wan'
|
| 85 |
+
ckpt_path = '/data/shiv/diffusion-pipe/models/wan1.3'
|
| 86 |
+
# Base dtype used for all models.
|
| 87 |
+
dtype = 'bfloat16'
|
| 88 |
+
# Wan supports fp8 for the transformer when training LoRA.
|
| 89 |
+
# transformer_dtype = 'float8'
|
| 90 |
+
# How to sample timesteps to train on. Can be logit_normal or uniform.
|
| 91 |
+
timestep_sample_method = 'logit_normal'
|
| 92 |
+
|
| 93 |
+
# For models that support full fine tuning, simply delete or comment out the [adapter] table to FFT.
|
| 94 |
+
[adapter]
|
| 95 |
+
type = 'lora'
|
| 96 |
+
# Dtype for the LoRA weights you are training.
|
| 97 |
+
dtype = 'bfloat16'
|
| 98 |
+
# LoRA rank - determines capacity to learn (higher = more capacity, more VRAM usage)
|
| 99 |
+
rank = 48
|
| 100 |
+
|
| 101 |
+
# Higher rank = more capacity to learn but uses more VRAM and may overfit
|
| 102 |
+
# The alpha value (scaling factor) is automatically set equal to rank in this codebase
|
| 103 |
+
# You can initialize the lora weights from a previously trained lora.
|
| 104 |
+
init_from_existing = '/data/diffusion_pipe_training_runs/852/20250411_21-03-36/epoch3'
|
| 105 |
+
|
| 106 |
+
[optimizer]
|
| 107 |
+
# AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
|
| 108 |
+
# Look at train.py for other options. You could also easily edit the file and add your own.
|
| 109 |
+
type = 'adamw_optimi'
|
| 110 |
+
lr = 1e-5
|
| 111 |
+
betas = [0.9, 0.99]
|
| 112 |
+
weight_decay = 0.01
|
epoch5/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": null,
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": false,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 48,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 48,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"ffn.0",
|
| 28 |
+
"v",
|
| 29 |
+
"q",
|
| 30 |
+
"o",
|
| 31 |
+
"k",
|
| 32 |
+
"ffn.2"
|
| 33 |
+
],
|
| 34 |
+
"task_type": null,
|
| 35 |
+
"trainable_token_indices": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
epoch5/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:448b2adefb9592047faa04100b8d87a78898ceaca39eba85346f68bef0dc8a70
|
| 3 |
+
size 131309776
|
epoch5/main_example.toml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Output path for training runs. Each training run makes a new directory in here.
|
| 2 |
+
output_dir = '/data/diffusion_pipe_training_runs/852'
|
| 3 |
+
|
| 4 |
+
# Dataset config file.
|
| 5 |
+
dataset = '/data/shiv/diffusion-pipe/examples/852_dataset.toml'
|
| 6 |
+
# You can have separate eval datasets. Give them a name for Tensorboard metrics.
|
| 7 |
+
# eval_datasets = [
|
| 8 |
+
# {name = 'something', config = 'path/to/eval_dataset.toml'},
|
| 9 |
+
# ]
|
| 10 |
+
|
| 11 |
+
# training settings
|
| 12 |
+
|
| 13 |
+
# I usually set this to a really high value because I don't know how long I want to train.
|
| 14 |
+
epochs = 1000
|
| 15 |
+
# Batch size of a single forward/backward pass for one GPU.
|
| 16 |
+
micro_batch_size_per_gpu = 16
|
| 17 |
+
# Pipeline parallelism degree. A single instance of the model is divided across this many GPUs.
|
| 18 |
+
pipeline_stages = 1
|
| 19 |
+
# Number of micro-batches sent through the pipeline for each training step.
|
| 20 |
+
# If pipeline_stages > 1, a higher GAS means better GPU utilization due to smaller pipeline bubbles (where GPUs aren't overlapping computation).
|
| 21 |
+
gradient_accumulation_steps = 8
|
| 22 |
+
# Grad norm clipping.
|
| 23 |
+
gradient_clipping = 1.0
|
| 24 |
+
# Learning rate warmup.
|
| 25 |
+
warmup_steps = 5
|
| 26 |
+
|
| 27 |
+
# Block swapping is supported for Wan, HunyuanVideo, Flux, and Chroma. This value controls the number
|
| 28 |
+
# of blocks kept offloaded to RAM. Increasing it lowers VRAM use, but has a performance penalty. The
|
| 29 |
+
# exactly performance penalty depends on the model and the type of training you are doing (e.g. images vs video).
|
| 30 |
+
# Block swapping only works for LoRA training, and requires pipeline_stages=1.
|
| 31 |
+
blocks_to_swap = 24
|
| 32 |
+
|
| 33 |
+
# eval settings
|
| 34 |
+
|
| 35 |
+
eval_every_n_epochs = 1
|
| 36 |
+
eval_before_first_step = false
|
| 37 |
+
# Might want to set these lower for eval so that less images get dropped (eval dataset size is usually much smaller than training set).
|
| 38 |
+
# Each size bucket of images/videos is rounded down to the nearest multiple of the global batch size, so higher global batch size means
|
| 39 |
+
# more dropped images. Usually doesn't matter for training but the eval set is much smaller so it can matter.
|
| 40 |
+
eval_micro_batch_size_per_gpu = 1
|
| 41 |
+
eval_gradient_accumulation_steps = 1
|
| 42 |
+
# If using block swap, you can disable it for eval. Eval uses less memory, so depending on block swapping amount you can maybe get away with
|
| 43 |
+
# doing this, and then eval is much faster.
|
| 44 |
+
disable_block_swap_for_eval = true
|
| 45 |
+
|
| 46 |
+
# misc settings
|
| 47 |
+
|
| 48 |
+
# Probably want to set this a bit higher if you have a smaller dataset so you don't end up with a million saved models.
|
| 49 |
+
save_every_n_epochs = 1
|
| 50 |
+
# Can checkpoint the training state every n number of epochs or minutes. Set only one of these. You can resume from checkpoints using the --resume_from_checkpoint flag.
|
| 51 |
+
#checkpoint_every_n_epochs = 1
|
| 52 |
+
checkpoint_every_n_minutes = 60
|
| 53 |
+
# Always set to true unless you have a huge amount of VRAM.
|
| 54 |
+
# This can also be 'unsloth' to reduce VRAM even more, with a slight performance hit.
|
| 55 |
+
activation_checkpointing = true
|
| 56 |
+
|
| 57 |
+
# Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
|
| 58 |
+
partition_method = 'parameters'
|
| 59 |
+
# Alternatively you can use 'manual' in combination with partition_split, which specifies the split points for dividing
|
| 60 |
+
# layers between GPUs. For example, with two GPUs, partition_split=[10] puts layers 0-9 on GPU 0, and the rest on GPU 1.
|
| 61 |
+
# With three GPUs, partition_split=[10, 20] puts layers 0-9 on GPU 0, layers 10-19 on GPU 1, and the rest on GPU 2.
|
| 62 |
+
# Length of partition_split must be pipeline_stages-1.
|
| 63 |
+
#partition_split = [N]
|
| 64 |
+
|
| 65 |
+
# dtype for saving the LoRA or model, if different from training dtype
|
| 66 |
+
save_dtype = 'bfloat16'
|
| 67 |
+
# If experiencing CUDA OOM errors with memory fragmentation, set this env var: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 68 |
+
# Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
|
| 69 |
+
caching_batch_size = 8
|
| 70 |
+
# How often deepspeed logs to console.
|
| 71 |
+
steps_per_print = 100
|
| 72 |
+
# How to extract video clips for training from a single input video file.
|
| 73 |
+
# The video file is first assigned to one of the configured frame buckets, but then we must extract one or more clips of exactly the right
|
| 74 |
+
# number of frames for that bucket.
|
| 75 |
+
# single_beginning: one clip starting at the beginning of the video
|
| 76 |
+
# single_middle: one clip from the middle of the video (cutting off the start and end equally)
|
| 77 |
+
# multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
|
| 78 |
+
# default is single_beginning
|
| 79 |
+
video_clip_mode = 'single_beginning'
|
| 80 |
+
|
| 81 |
+
# This is how you configure HunyuanVideo. Other models will be different. See docs/supported_models.md for
|
| 82 |
+
# details on the configuration and options for each model.
|
| 83 |
+
[model]
|
| 84 |
+
type = 'wan'
|
| 85 |
+
ckpt_path = '/data/shiv/diffusion-pipe/models/wan1.3'
|
| 86 |
+
# Base dtype used for all models.
|
| 87 |
+
dtype = 'bfloat16'
|
| 88 |
+
# Wan supports fp8 for the transformer when training LoRA.
|
| 89 |
+
# transformer_dtype = 'float8'
|
| 90 |
+
# How to sample timesteps to train on. Can be logit_normal or uniform.
|
| 91 |
+
timestep_sample_method = 'logit_normal'
|
| 92 |
+
|
| 93 |
+
# For models that support full fine tuning, simply delete or comment out the [adapter] table to FFT.
|
| 94 |
+
[adapter]
|
| 95 |
+
type = 'lora'
|
| 96 |
+
# Dtype for the LoRA weights you are training.
|
| 97 |
+
dtype = 'bfloat16'
|
| 98 |
+
# LoRA rank - determines capacity to learn (higher = more capacity, more VRAM usage)
|
| 99 |
+
rank = 48
|
| 100 |
+
|
| 101 |
+
# Higher rank = more capacity to learn but uses more VRAM and may overfit
|
| 102 |
+
# The alpha value (scaling factor) is automatically set equal to rank in this codebase
|
| 103 |
+
# You can initialize the lora weights from a previously trained lora.
|
| 104 |
+
init_from_existing = '/data/diffusion_pipe_training_runs/852/20250411_21-03-36/epoch3'
|
| 105 |
+
|
| 106 |
+
[optimizer]
|
| 107 |
+
# AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
|
| 108 |
+
# Look at train.py for other options. You could also easily edit the file and add your own.
|
| 109 |
+
type = 'adamw_optimi'
|
| 110 |
+
lr = 1e-5
|
| 111 |
+
betas = [0.9, 0.99]
|
| 112 |
+
weight_decay = 0.01
|
epoch6/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": null,
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": false,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 48,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 48,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"ffn.0",
|
| 28 |
+
"v",
|
| 29 |
+
"q",
|
| 30 |
+
"o",
|
| 31 |
+
"k",
|
| 32 |
+
"ffn.2"
|
| 33 |
+
],
|
| 34 |
+
"task_type": null,
|
| 35 |
+
"trainable_token_indices": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
epoch6/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:589e70f7de5d53123a61feea4128834ff0f06e5ef855ec98bbbe7f4a3fae5de8
|
| 3 |
+
size 131309776
|
epoch6/main_example.toml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Output path for training runs. Each training run makes a new directory in here.
|
| 2 |
+
output_dir = '/data/diffusion_pipe_training_runs/852'
|
| 3 |
+
|
| 4 |
+
# Dataset config file.
|
| 5 |
+
dataset = '/data/shiv/diffusion-pipe/examples/852_dataset.toml'
|
| 6 |
+
# You can have separate eval datasets. Give them a name for Tensorboard metrics.
|
| 7 |
+
# eval_datasets = [
|
| 8 |
+
# {name = 'something', config = 'path/to/eval_dataset.toml'},
|
| 9 |
+
# ]
|
| 10 |
+
|
| 11 |
+
# training settings
|
| 12 |
+
|
| 13 |
+
# I usually set this to a really high value because I don't know how long I want to train.
|
| 14 |
+
epochs = 1000
|
| 15 |
+
# Batch size of a single forward/backward pass for one GPU.
|
| 16 |
+
micro_batch_size_per_gpu = 16
|
| 17 |
+
# Pipeline parallelism degree. A single instance of the model is divided across this many GPUs.
|
| 18 |
+
pipeline_stages = 1
|
| 19 |
+
# Number of micro-batches sent through the pipeline for each training step.
|
| 20 |
+
# If pipeline_stages > 1, a higher GAS means better GPU utilization due to smaller pipeline bubbles (where GPUs aren't overlapping computation).
|
| 21 |
+
gradient_accumulation_steps = 8
|
| 22 |
+
# Grad norm clipping.
|
| 23 |
+
gradient_clipping = 1.0
|
| 24 |
+
# Learning rate warmup.
|
| 25 |
+
warmup_steps = 5
|
| 26 |
+
|
| 27 |
+
# Block swapping is supported for Wan, HunyuanVideo, Flux, and Chroma. This value controls the number
|
| 28 |
+
# of blocks kept offloaded to RAM. Increasing it lowers VRAM use, but has a performance penalty. The
|
| 29 |
+
# exactly performance penalty depends on the model and the type of training you are doing (e.g. images vs video).
|
| 30 |
+
# Block swapping only works for LoRA training, and requires pipeline_stages=1.
|
| 31 |
+
blocks_to_swap = 24
|
| 32 |
+
|
| 33 |
+
# eval settings
|
| 34 |
+
|
| 35 |
+
eval_every_n_epochs = 1
|
| 36 |
+
eval_before_first_step = false
|
| 37 |
+
# Might want to set these lower for eval so that less images get dropped (eval dataset size is usually much smaller than training set).
|
| 38 |
+
# Each size bucket of images/videos is rounded down to the nearest multiple of the global batch size, so higher global batch size means
|
| 39 |
+
# more dropped images. Usually doesn't matter for training but the eval set is much smaller so it can matter.
|
| 40 |
+
eval_micro_batch_size_per_gpu = 1
|
| 41 |
+
eval_gradient_accumulation_steps = 1
|
| 42 |
+
# If using block swap, you can disable it for eval. Eval uses less memory, so depending on block swapping amount you can maybe get away with
|
| 43 |
+
# doing this, and then eval is much faster.
|
| 44 |
+
disable_block_swap_for_eval = true
|
| 45 |
+
|
| 46 |
+
# misc settings
|
| 47 |
+
|
| 48 |
+
# Probably want to set this a bit higher if you have a smaller dataset so you don't end up with a million saved models.
|
| 49 |
+
save_every_n_epochs = 1
|
| 50 |
+
# Can checkpoint the training state every n number of epochs or minutes. Set only one of these. You can resume from checkpoints using the --resume_from_checkpoint flag.
|
| 51 |
+
#checkpoint_every_n_epochs = 1
|
| 52 |
+
checkpoint_every_n_minutes = 60
|
| 53 |
+
# Always set to true unless you have a huge amount of VRAM.
|
| 54 |
+
# This can also be 'unsloth' to reduce VRAM even more, with a slight performance hit.
|
| 55 |
+
activation_checkpointing = true
|
| 56 |
+
|
| 57 |
+
# Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
|
| 58 |
+
partition_method = 'parameters'
|
| 59 |
+
# Alternatively you can use 'manual' in combination with partition_split, which specifies the split points for dividing
|
| 60 |
+
# layers between GPUs. For example, with two GPUs, partition_split=[10] puts layers 0-9 on GPU 0, and the rest on GPU 1.
|
| 61 |
+
# With three GPUs, partition_split=[10, 20] puts layers 0-9 on GPU 0, layers 10-19 on GPU 1, and the rest on GPU 2.
|
| 62 |
+
# Length of partition_split must be pipeline_stages-1.
|
| 63 |
+
#partition_split = [N]
|
| 64 |
+
|
| 65 |
+
# dtype for saving the LoRA or model, if different from training dtype
|
| 66 |
+
save_dtype = 'bfloat16'
|
| 67 |
+
# If experiencing CUDA OOM errors with memory fragmentation, set this env var: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 68 |
+
# Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
|
| 69 |
+
caching_batch_size = 8
|
| 70 |
+
# How often deepspeed logs to console.
|
| 71 |
+
steps_per_print = 100
|
| 72 |
+
# How to extract video clips for training from a single input video file.
|
| 73 |
+
# The video file is first assigned to one of the configured frame buckets, but then we must extract one or more clips of exactly the right
|
| 74 |
+
# number of frames for that bucket.
|
| 75 |
+
# single_beginning: one clip starting at the beginning of the video
|
| 76 |
+
# single_middle: one clip from the middle of the video (cutting off the start and end equally)
|
| 77 |
+
# multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
|
| 78 |
+
# default is single_beginning
|
| 79 |
+
video_clip_mode = 'single_beginning'
|
| 80 |
+
|
| 81 |
+
# This is how you configure HunyuanVideo. Other models will be different. See docs/supported_models.md for
|
| 82 |
+
# details on the configuration and options for each model.
|
| 83 |
+
[model]
|
| 84 |
+
type = 'wan'
|
| 85 |
+
ckpt_path = '/data/shiv/diffusion-pipe/models/wan1.3'
|
| 86 |
+
# Base dtype used for all models.
|
| 87 |
+
dtype = 'bfloat16'
|
| 88 |
+
# Wan supports fp8 for the transformer when training LoRA.
|
| 89 |
+
# transformer_dtype = 'float8'
|
| 90 |
+
# How to sample timesteps to train on. Can be logit_normal or uniform.
|
| 91 |
+
timestep_sample_method = 'logit_normal'
|
| 92 |
+
|
| 93 |
+
# For models that support full fine tuning, simply delete or comment out the [adapter] table to FFT.
|
| 94 |
+
[adapter]
|
| 95 |
+
type = 'lora'
|
| 96 |
+
# Dtype for the LoRA weights you are training.
|
| 97 |
+
dtype = 'bfloat16'
|
| 98 |
+
# LoRA rank - determines capacity to learn (higher = more capacity, more VRAM usage)
|
| 99 |
+
rank = 48
|
| 100 |
+
|
| 101 |
+
# Higher rank = more capacity to learn but uses more VRAM and may overfit
|
| 102 |
+
# The alpha value (scaling factor) is automatically set equal to rank in this codebase
|
| 103 |
+
# You can initialize the lora weights from a previously trained lora.
|
| 104 |
+
init_from_existing = '/data/diffusion_pipe_training_runs/852/20250411_21-03-36/epoch3'
|
| 105 |
+
|
| 106 |
+
[optimizer]
|
| 107 |
+
# AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
|
| 108 |
+
# Look at train.py for other options. You could also easily edit the file and add your own.
|
| 109 |
+
type = 'adamw_optimi'
|
| 110 |
+
lr = 1e-5
|
| 111 |
+
betas = [0.9, 0.99]
|
| 112 |
+
weight_decay = 0.01
|
epoch7/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": null,
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": false,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 48,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 48,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"ffn.0",
|
| 28 |
+
"v",
|
| 29 |
+
"q",
|
| 30 |
+
"o",
|
| 31 |
+
"k",
|
| 32 |
+
"ffn.2"
|
| 33 |
+
],
|
| 34 |
+
"task_type": null,
|
| 35 |
+
"trainable_token_indices": null,
|
| 36 |
+
"use_dora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
epoch7/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2fa4f972166cc91d677a117f7c01634bddf286878bb5b393cf2730312b31308a
|
| 3 |
+
size 131309776
|