Skip to content

Commit c88e10f

Browse files
committed
grpo llama 3.2 3b with 3 reward functions
1 parent 54e49bc commit c88e10f

4 files changed

Lines changed: 644 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
compute_environment: LOCAL_MACHINE
2+
debug: false
3+
deepspeed_config:
4+
deepspeed_multinode_launcher: standard
5+
offload_optimizer_device: none
6+
offload_param_device: none
7+
zero3_init_flag: true
8+
zero3_save_16bit_model: true
9+
zero_stage: 3
10+
distributed_type: DEEPSPEED
11+
downcast_bf16: 'no'
12+
machine_rank: 0
13+
main_training_function: main
14+
mixed_precision: bf16
15+
num_machines: 1
16+
num_processes: 8
17+
rdzv_backend: static
18+
same_network: true
19+
tpu_env: []
20+
tpu_use_cluster: false
21+
tpu_use_sudo: false
22+
use_cpu: false
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Model arguments
2+
model_name_or_path: meta-llama/Llama-3.2-3B-Instruct
3+
model_revision: main
4+
torch_dtype: bfloat16
5+
attn_implementation: flash_attention_2
6+
bf16: true
7+
tf32: true
8+
output_dir: runs/llama-3.2-3b-grpo-text2sql-alltrain-lr5-ng8
9+
10+
# Lora Arguments
11+
# No LoRA is used here
12+
13+
# Training arguments
14+
max_steps: 500 # 1000 #500
15+
per_device_train_batch_size: 1
16+
gradient_accumulation_steps: 8
17+
gradient_checkpointing: true
18+
gradient_checkpointing_kwargs:
19+
use_reentrant: false
20+
learning_rate: 5.0e-7 # 1.0e-6 # 5.0e-7 # 1.0e-6 as in the deepseek math paper 5-e7 from https://hijkzzz.notion.site/unraveling-rlhf-and-its-variants-engineering-insights#147d9a33ecc9806090f3d5c749d31f05
21+
lr_scheduler_type: cosine
22+
warmup_ratio: 0.03
23+
# GRPO specific parameters
24+
beta: 0.001 # 0.04 as in the deepseek math paper 0.001 from https://hijkzzz.notion.site/unraveling-rlhf-and-its-variants-engineering-insights#147d9a33ecc9806090f3d5c749d31f05
25+
max_prompt_length: 512 # 256
26+
max_completion_length: 1024
27+
num_generations: 8 # 6 # 8
28+
use_vllm: true
29+
30+
# Reward function weights
31+
# Order: [format_reward_func, execution_reward_func, ensemble_n_gram_reward_func]
32+
reward_weights: [1.0, 3.0, 1.0]
33+
# **Recommended Weight Strategy**
34+
# Current Setting: `[1.0, 3.0, 1.0]`**
35+
# * **Format reward (1.0)**: Standard weight since format correctness is binary but essential
36+
# * **Execution reward (3.0)**: **Highest weight** - SQL execution correctness is most important for text2sql
37+
# * **N-gram similarity (1.0)**: Standard weight for syntactic similarity
38+
39+
# **Alternative Weight Strategies**
40+
# **Conservative approach: `[2.0, 4.0, 1.0]`**
41+
# * Emphasizes both format and execution correctness
42+
# * Lower weight on similarity metrics
43+
# **Balanced approach: `[1.5, 2.0, 1.5]`**
44+
# * More balanced across all three metrics
45+
# * Good for early training stages
46+
# **Similarity-focused: `[1.0, 2.0, 2.0]`**
47+
# * Higher weight on N-gram similarity
48+
# * Useful if execution often fails initially
49+
50+
51+
vllm_device: "cuda:0" # use vLLM for generation and DeepSpeed for distributed training.
52+
# Set the num_processes to the number of GPUs you have -
53+
# the last one will be used with vLLM for Generation.
54+
# if you have 6 GPUs, set vllm_device to "cuda:5" (or 5?) and
55+
# num_processes to 5 (or 6? in which case, 6th GPU will be used
56+
# for both generation and training
57+
58+
vllm_gpu_memory_utilization: 0.5
59+
60+
# Logging arguments
61+
logging_strategy: steps
62+
logging_steps: 2
63+
report_to:
64+
- tensorboard
65+
save_strategy: "steps"
66+
save_steps: 50
67+
seed: 42
68+
69+
# Hugging Face Hub
70+
push_to_hub: false
71+
# hub_model_id: llama-3-1-8b-math-orca-qlora-10k-ep1 # if not defined same as output_dir
72+
hub_strategy: every_save

0 commit comments

Comments
 (0)