zliang1233214 commited on
Commit
cf80a1b
·
verified ·
1 Parent(s): 716a054

Upload 3 files

Browse files
adapter_config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": 32,
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": 32,
24
+ "rank_pattern": {},
25
+ "revision": null,
26
+ "target_modules": [
27
+ "img_mlp.fc1",
28
+ "modulation.linear",
29
+ "txt_mod.linear",
30
+ "img_mod.linear",
31
+ "linear2",
32
+ "img_mlp.fc2",
33
+ "img_attn_qkv",
34
+ "txt_attn_qkv",
35
+ "txt_mlp.fc1",
36
+ "txt_attn_proj",
37
+ "linear1",
38
+ "txt_mlp.fc2",
39
+ "img_attn_proj"
40
+ ],
41
+ "task_type": null,
42
+ "trainable_token_indices": null,
43
+ "use_dora": false,
44
+ "use_rslora": false
45
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fda1313316ea0895c632cef32ab6567ba2001583a7f5a437c0d62c09397ecac2
3
+ size 322519480
hunyuan_video.toml ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Output path for training runs. Each training run makes a new directory in here.
2
+ output_dir = '/cpfs/models/output_hunyuan_loras/batch3_text'
3
+
4
+ # Dataset config file.
5
+ dataset = 'examples/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 = 1
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 = 4
22
+ # Grad norm clipping.
23
+ gradient_clipping = 1.0
24
+ # Learning rate warmup.
25
+ warmup_steps = 100
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 = 20
32
+
33
+ # eval settings
34
+
35
+ eval_every_n_epochs = 1
36
+ eval_before_first_step = true
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
+
43
+ # misc settings
44
+
45
+ # 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.
46
+ save_every_n_epochs = 20
47
+ # resume_from_checkpoint = "20250520_07-07-21"
48
+ # 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.
49
+ #checkpoint_every_n_epochs = 1
50
+ checkpoint_every_n_minutes = 120
51
+ # Always set to true unless you have a huge amount of VRAM.
52
+ activation_checkpointing = true
53
+ # Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
54
+ partition_method = 'parameters'
55
+ # dtype for saving the LoRA or model, if different from training dtype
56
+ save_dtype = 'bfloat16'
57
+ # Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
58
+ caching_batch_size = 1
59
+ # How often deepspeed logs to console.
60
+ steps_per_print = 1
61
+ # How to extract video clips for training from a single input video file.
62
+ # 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
63
+ # number of frames for that bucket.
64
+ # single_beginning: one clip starting at the beginning of the video
65
+ # single_middle: one clip from the middle of the video (cutting off the start and end equally)
66
+ # multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
67
+ # default is single_beginning
68
+ video_clip_mode = 'single_beginning'
69
+
70
+ # This is how you configure HunyuanVideo. Other models will be different. See docs/supported_models.md for
71
+ # details on the configuration and options for each model.
72
+ [model]
73
+ type = 'hunyuan-video'
74
+ # Can load HunyuanVideo entirely from the ckpt path set up for the official inference scripts.
75
+ ckpt_path = '/cpfs/models/HunyuanVideo/ckpts/'
76
+ # Or you can load it by pointing to all the ComfyUI files.
77
+ # transformer_path = '/data2/imagegen_models/hunyuan_video_comfyui/hunyuan_video_720_cfgdistill_fp8_e4m3fn.safetensors'
78
+ # vae_path = '/data2/imagegen_models/hunyuan_video_comfyui/hunyuan_video_vae_bf16.safetensors'
79
+ # llm_path = '/data2/imagegen_models/hunyuan_video_comfyui/llava-llama-3-8b-text-encoder-tokenizer'
80
+ # clip_path = '/data2/imagegen_models/hunyuan_video_comfyui/clip-vit-large-patch14'
81
+ # Base dtype used for all models.
82
+ dtype = 'bfloat16'
83
+ # Hunyuan Video supports fp8 for the transformer when training LoRA.
84
+ transformer_dtype = 'float8'
85
+ # How to sample timesteps to train on. Can be logit_normal or uniform.
86
+ timestep_sample_method = 'logit_normal'
87
+
88
+ # For models that support full fine tuning, simply delete or comment out the [adapter] table to FFT.
89
+ [adapter]
90
+ type = 'lora'
91
+ rank = 32
92
+ # Dtype for the LoRA weights you are training.
93
+ dtype = 'bfloat16'
94
+ # You can initialize the lora weights from a previously trained lora.
95
+ #init_from_existing = '/data/diffusion_pipe_training_runs/something/epoch50'
96
+
97
+ [optimizer]
98
+ # AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
99
+ # Look at train.py for other options. You could also easily edit the file and add your own.
100
+ type = 'adamw_optimi'
101
+ lr = 2e-5
102
+ betas = [0.9, 0.99]
103
+ weight_decay = 0.01
104
+ eps = 1e-8
105
+
106
+ # Can use this optimizer for a bit less memory usage.
107
+
108
+ # [optimizer]
109
+ # type = 'AdamW8bitKahan'
110
+ # lr = 2e-5
111
+ # betas = [0.9, 0.99]
112
+ # weight_decay = 0.01
113
+ # stabilize = false