-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Almaz Dautov
committed
Nov 12, 2024
1 parent
fce6c51
commit ca5a39e
Showing
10 changed files
with
2,186 additions
and
1,609 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
}, | ||
|
||
"zero_optimization": { | ||
"stage": 2, | ||
"stage": 3, | ||
"offload_param": { | ||
"device": "none" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,195 @@ | ||
{ | ||
"train_dataset_settings": { | ||
"sources": [ | ||
{ | ||
"name": "train_chat", | ||
"records_path": "tests/fixtures/datasets/chat/train_chat.jsonl", | ||
"sample_rate": 1.0 | ||
} | ||
], | ||
"prompt_template": { | ||
"role_tag_mapping": { | ||
"bot": "assistant", | ||
"user": "user", | ||
"system": "system" | ||
}, | ||
"prefix_template": "<|start_header_id|>{role}<|end_header_id|>\n\n", | ||
"suffix_template": "<|eot_id|>" | ||
}, | ||
"dataset_type": "chat", | ||
"max_tokens_count": 2000, | ||
"only_answer_loss": true | ||
}, | ||
"val_dataset_settings": { | ||
"sources": [ | ||
{ | ||
"name": "val_chat", | ||
"records_path": "tests/fixtures/datasets/chat/train_chat.jsonl", | ||
"sample_rate": 1.0 | ||
} | ||
], | ||
"prompt_template": { | ||
"role_tag_mapping": { | ||
"bot": "assistant", | ||
"user": "user", | ||
"system": "system" | ||
}, | ||
"prefix_template": "<|start_header_id|>{role}<|end_header_id|>\n\n", | ||
"suffix_template": "<|eot_id|>" | ||
}, | ||
"dataset_type": "chat", | ||
"max_tokens_count": 2000, | ||
"only_answer_loss": true | ||
}, | ||
"cherry_pick_settings": { | ||
"generator_transformers_settings": { | ||
"num_beams": 1, | ||
"do_sample": false, | ||
"stop_strings": "</RS>", | ||
"max_new_tokens": 8 | ||
}, | ||
"custom_generation_settings": { | ||
"skip_special_tokens": false | ||
}, | ||
"dataset_settings": { | ||
"sources": [ | ||
{ | ||
"name": "chat_test", | ||
"records_path": "tests/fixtures/datasets/chat/train_chat.jsonl", | ||
"num_samples": 2 | ||
} | ||
], | ||
"prompt_template": { | ||
"role_tag_mapping": { | ||
"bot": "assistant", | ||
"user": "user", | ||
"system": "system" | ||
}, | ||
"prefix_template": "<|start_header_id|>{role}<|end_header_id|>\n\n", | ||
"suffix_template": "<|eot_id|>" | ||
}, | ||
"dataset_type": "chat", | ||
"max_tokens_count": 150, | ||
"only_answer_loss": true | ||
}, | ||
"metric_settings": [ | ||
{ | ||
"type": "length", | ||
"parameters": { | ||
"need_average": [ | ||
true | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "kl", | ||
"parameters": { | ||
"need_average": [ | ||
true | ||
], | ||
"ref_logits_type": "sft" | ||
} | ||
}, | ||
{ | ||
"type": "kl", | ||
"parameters": { | ||
"need_average": [ | ||
true | ||
], | ||
"ref_logits_type": "reference" | ||
} | ||
} | ||
] | ||
}, | ||
"reward_model_settings": { | ||
"model_path": "/from_s3/llama-3.2-1B", | ||
"model_type": "seq_cls", | ||
"model_kwargs": { | ||
"num_labels": 1, | ||
"attn_implementation": "flash_attention_2" | ||
}, | ||
"transformers_settings": {} | ||
}, | ||
"model_settings": { | ||
"model_path": "/from_s3/llama-3.2-1B", | ||
"model_type": "causal", | ||
"liger_kernels_settings": { | ||
"use_rope": true, | ||
"use_cross_entropy": false, | ||
"use_geglu": true, | ||
"use_fused_linear_cross_entropy": false, | ||
"use_rms_norm": false | ||
}, | ||
"model_kwargs": { | ||
"attn_implementation": "flash_attention_2" | ||
}, | ||
"transformers_settings": {} | ||
}, | ||
"tokenizer_settings": { | ||
"tokenizer_kwargs": { | ||
"padding_side": "left" | ||
} | ||
}, | ||
"trainer_settings": { | ||
"actor_settings": { | ||
"actor_type": "distributed_vllm", | ||
"vllm_num_engines": 6, | ||
"vllm_tensor_parallel_size": 1 | ||
}, | ||
"deepspeed": "tests/fixtures/configs/train/reinforce/deepspeed_cfg.json", | ||
"gradient_checkpointing": true, | ||
"gradient_checkpointing_kwargs": { | ||
"use_reentrant": false | ||
}, | ||
"critic_type": "ray_transformers", | ||
"reward_processor_type": "rloo", | ||
"evaluation_strategy": "steps", | ||
"num_generations": 4, | ||
"per_device_train_batch_size": 8, | ||
"per_device_eval_batch_size": 8, | ||
"gradient_accumulation_steps": 10, | ||
"adam_beta1": 0.9, | ||
"adam_beta2": 0.95, | ||
"adam_epsilon": 0.00001, | ||
"eval_steps": 50, | ||
"save_steps": 100, | ||
"save_strategy": "steps", | ||
"load_best_model_at_end": false, | ||
"logging_steps": 1, | ||
"learning_rate": 0.00001, | ||
"max_steps": 1001, | ||
"lr_scheduler_type": "constant_with_warmup", | ||
"warmup_ratio": 0.03, | ||
"fp16": false, | ||
"bf16": true, | ||
"optim": "adamw_torch", | ||
"weight_decay": 0.0, | ||
"max_grad_norm": 2, | ||
"save_total_limit": 11, | ||
"dataloader_num_workers": 12, | ||
"stop_token": "<end_of_turn>", | ||
"temperature": 0.7, | ||
"non_eos_penalty": true, | ||
"penalty_reward_value": -1, | ||
"clip_rewards_min": -1e+8, | ||
"clip_rewards_max": 1e+8, | ||
"whiten_rewards": false, | ||
"kl_coef": 0.05, | ||
"mean_baseline_coef": 0.95, | ||
"num_samples_for_reward_stats": 1000, | ||
"no_cuda": false | ||
}, | ||
"special_tokens_settings": { | ||
"bos_token": "<s>", | ||
"eos_token": "</s>", | ||
"pad_token": "<unk>" | ||
}, | ||
"logging_settings": { | ||
"project_name": "alignment", | ||
"run_name": "sft", | ||
"entity": "turbo-alignment" | ||
}, | ||
"seed": 0, | ||
"log_path": "train_output" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"fp16": { | ||
"enabled": false | ||
}, | ||
"bf16": { | ||
"enabled": true | ||
}, | ||
"optimizer": { | ||
"type": "AdamW", | ||
"params": { | ||
"lr": "auto", | ||
"betas": "auto", | ||
"eps": "auto", | ||
"weight_decay": "auto" | ||
} | ||
}, | ||
"scheduler": { | ||
"type": "WarmupDecayLR", | ||
"params": { | ||
"warmup_min_lr": "auto", | ||
"warmup_max_lr": "auto", | ||
"warmup_num_steps": "auto", | ||
"total_num_steps": "auto" | ||
} | ||
}, | ||
|
||
"zero_optimization": { | ||
"stage": 3, | ||
"offload_param": { | ||
"device": "none" | ||
}, | ||
"offload_optimizer": { | ||
"device": "none", | ||
"pin_memory": true | ||
}, | ||
"allgather_partitions": true, | ||
"allgather_bucket_size": 1e5, | ||
"overlap_comm": false, | ||
"reduce_scatter": true, | ||
"reduce_bucket_size": "auto", | ||
"contiguous_gradients": true, | ||
"sub_group_size": 1e5, | ||
"stage3_param_persistence_threshold": "auto", | ||
"stage3_prefetch_bucket_size": 0, | ||
"stage3_max_live_parameters": 0, | ||
"stage3_max_reuse_distance": 0, | ||
"stage3_gather_16bit_weights_on_model_save": true | ||
}, | ||
"gradient_accumulation_steps": "auto", | ||
"gradient_clipping": "auto", | ||
"steps_per_print": 2, | ||
"train_batch_size": "auto", | ||
"train_micro_batch_size_per_gpu": "auto", | ||
"wall_clock_breakdown": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.