miyuki2026 commited on
Commit
eb46505
·
1 Parent(s): d70ebc4
examples/tutorials/dpo/ultrachat/ds_config/{deepspeed_stage_3_config.json → deepspeed_stage_2_config.json} RENAMED
@@ -1,46 +1,35 @@
1
  {
2
- "gradient_accumulation_steps": "auto",
3
- "gradient_clipping": "auto",
4
- "steps_per_print": 200,
5
  "train_batch_size": "auto",
6
  "train_micro_batch_size_per_gpu": "auto",
7
- "wall_clock_breakdown": false,
8
- "optimizer": {
9
- "type": "Adam",
10
- "params": {
11
- "lr": "auto",
12
- "betas": "auto",
13
- "eps": "auto",
14
- "weight_decay": "auto"
15
- }
 
 
 
16
  },
17
  "fp16": {
18
- "enabled": "auto",
19
  "loss_scale": 0,
20
  "loss_scale_window": 1000,
21
  "initial_scale_power": 16,
22
  "hysteresis": 2,
23
  "min_loss_scale": 1
24
  },
25
- "zero_optimization": {
26
- "stage": 3,
27
- "offload_optimizer": {
28
- "device": "cpu",
29
- "pin_memory": true
30
- },
31
- "offload_param": {
32
- "device": "cpu",
33
- "pin_memory": true
34
- },
35
- "overlap_comm": true,
36
- "contiguous_gradients": true,
37
- "sub_group_size": 1e9,
38
- "reduce_bucket_size": "auto",
39
- "stage3_prefetch_bucket_size": "auto",
40
- "stage3_param_persistence_threshold": "auto",
41
- "stage3_max_live_parameters": 1e9,
42
- "stage3_max_reuse_distance": 1e9,
43
- "stage3_gather_16bit_weights_on_model_save": true
44
  },
45
  "scheduler": {
46
  "type": "WarmupLR",
@@ -50,9 +39,6 @@
50
  "warmup_num_steps": "auto"
51
  }
52
  },
53
- "activation_checkpointing": {
54
- "enabled": true,
55
- "partition_activations": true,
56
- "contiguous_memory_optimization": true
57
- }
58
- }
 
1
  {
 
 
 
2
  "train_batch_size": "auto",
3
  "train_micro_batch_size_per_gpu": "auto",
4
+ "gradient_accumulation_steps": "auto",
5
+ "gradient_clipping": 1.0,
6
+ "zero_optimization": {
7
+ "stage": 2,
8
+ "offload_optimizer": {
9
+ "device": "cpu",
10
+ "pin_memory": true
11
+ },
12
+ "contiguous_gradients": true,
13
+ "overlap_comm": true,
14
+ "allgather_bucket_size": 5e8,
15
+ "reduce_bucket_size": 5e8
16
  },
17
  "fp16": {
18
+ "enabled": true,
19
  "loss_scale": 0,
20
  "loss_scale_window": 1000,
21
  "initial_scale_power": 16,
22
  "hysteresis": 2,
23
  "min_loss_scale": 1
24
  },
25
+ "optimizer": {
26
+ "type": "AdamW",
27
+ "params": {
28
+ "lr": "auto",
29
+ "betas": "auto",
30
+ "eps": 1e-8,
31
+ "weight_decay": "auto"
32
+ }
 
 
 
 
 
 
 
 
 
 
 
33
  },
34
  "scheduler": {
35
  "type": "WarmupLR",
 
39
  "warmup_num_steps": "auto"
40
  }
41
  },
42
+ "steps_per_print": 100,
43
+ "wall_clock_breakdown": false
44
+ }
 
 
 
examples/tutorials/dpo/ultrachat/step_2_train_sft_model_deepspeed.py CHANGED
@@ -216,7 +216,7 @@ def main():
216
  sft_config = SFTConfig(
217
  output_dir=args.output_model_dir,
218
  dataset_text_field="formated_text",
219
- deepspeed=None if debug_mode else "./ds_config/deepspeed_stage_3_config.json",
220
  num_train_epochs=1,
221
  per_device_train_batch_size=1 if debug_mode else 2,
222
  gradient_accumulation_steps=1 if debug_mode else 8,
 
216
  sft_config = SFTConfig(
217
  output_dir=args.output_model_dir,
218
  dataset_text_field="formated_text",
219
+ deepspeed=None if debug_mode else "./ds_config/deepspeed_stage_2_config.json",
220
  num_train_epochs=1,
221
  per_device_train_batch_size=1 if debug_mode else 2,
222
  gradient_accumulation_steps=1 if debug_mode else 8,