Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 14 additions & 27 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,27 @@
### What does this PR do?

> Add **concise** overview of what this PR aims to achieve or accomplish. Reference related GitHub issues and PRs that help with the review.
> Adds a new recipe to perform GRPO with full weight-updates on 1.5B models.
### Checklist Before Starting

- [ ] Search for similar PRs. Paste at least one query link here: ...
- [ ] Format the PR title as `[{modules}] {type}: {description}` (This will be checked by the CI)
- `{modules}` include `fsdp`, `megatron`, `sglang`, `vllm`, `rollout`, `trainer`, `ci`, `training_utils`, `recipe`, `hardware`, `deployment`, `ray`, `worker`, `single_controller`, `misc`, `perf`, `model`, `algo`, `env`, `tool`, `ckpt`, `doc`, `data`
- If this PR involves multiple modules, separate them with `,` like `[megatron, fsdp, doc]`
- `{type}` is in `feat`, `fix`, `refactor`, `chore`, `test`
- If this PR breaks any API (CLI arguments, config, function signature, etc.), add `[BREAKING]` to the beginning of the title.
- Example: `[BREAKING][fsdp, megatron] feat: dynamic batching`
- [X] Search for similar PRs. Paste at least one query link here: https://github.com/volcengine/verl/pull/3029
- [X] Format the PR title as `[recipe, hardware] feat: Add GRPO with full weight updates for 1.5B models on a single GPU ` (This will be checked by the CI)
- `{modules}`: `recipe`, `hardware`
- `{type}`: `feat`
- No breaking API changes

### Test

> For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.
### API and Usage Example

> Demonstrate how the API changes if any, and provide usage example(s) if possible.

```python
# Add code snippet or script demonstrating how to use this
```

### Design & Code Changes

> Demonstrate the high-level design if this PR is complex, and list the specific changes.
### Test
![Training Curve 1.5b](../examples/tuning/1.5b/Qwen_math_grpo_training_curve_wandb.png)
> Pass@1 for MATH500: 77.8
### Checklist Before Submitting

> [!IMPORTANT]
> Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.
- [ ] Read the [Contribute Guide](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md).
- [ ] Apply [pre-commit checks](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md#code-linting-and-formatting): `pre-commit install && pre-commit run --all-files --show-diff-on-failure --color=always`
- [ ] Add / Update [the documentation](https://github.com/volcengine/verl/tree/main/docs).
- [ ] Add unit or end-to-end test(s) to [the CI workflow](https://github.com/volcengine/verl/tree/main/.github/workflows) to cover all the code. If not feasible, explain why: ...
- [ ] Once your PR is ready for CI, send a message in [the `ci-request` channel](https://verl-project.slack.com/archives/C091TCESWB1) in [the `verl` Slack workspace](https://join.slack.com/t/verl-project/shared_invite/zt-3855yhg8g-CTkqXu~hKojPCmo7k_yXTQ). (If not accessible, please try [the Feishu group (飞书群)](https://applink.larkoffice.com/client/chat/chatter/add_by_link?link_token=772jd4f1-cd91-441e-a820-498c6614126a).)
- [X] Read the [Contribute Guide](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md).
- [X] Apply [pre-commit checks](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md#code-linting-and-formatting): `pre-commit install && pre-commit run --all-files --show-diff-on-failure --color=always`
- [X] Add / Update [the documentation](https://github.com/volcengine/verl/tree/main/docs).
- [X] Add unit or end-to-end test(s) to [the CI workflow](https://github.com/volcengine/verl/tree/main/.github/workflows) to cover all the code. If not feasible, explain why: ...
- [X] Once your PR is ready for CI, send a message in [the `ci-request` channel](https://verl-project.slack.com/archives/C091TCESWB1) in [the `verl` Slack workspace](https://join.slack.com/t/verl-project/shared_invite/zt-3855yhg8g-CTkqXu~hKojPCmo7k_yXTQ). (If not accessible, please try [the Feishu group (飞书群)](https://applink.larkoffice.com/client/chat/chatter/add_by_link?link_token=772jd4f1-cd91-441e-a820-498c6614126a).)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions examples/tuning/1.5b/qwen2.5math-1.5b_grpo_1_h100_fsdp_vllm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
PROJECT_NAME=qwen2.5_Math_1.5b_dr_grpo
LR=1e-5
MODEL_NAME=Qwen/Qwen2.5-Math-1.5B
MAX_NEW_TOKENS=3000
MAX_PROMPT_LENGTH=1024 #1024 #512
MODEL_ALIAS=${MODEL_NAME##*/}
GROUP_SIZE=8
CHOSEN_DEVICE=0 #0,1
TOTAL_EPOCHS=2
LOG_N_VAL_GENERATIONS=40
ADVANTAGE_ESTIMATOR="grpo"


TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
RUN_NAME=${MODEL_ALIAS}_${LR}_${GROUP_SIZE}_${MAX_NEW_TOKENS}_${ADVANTAGE_ESTIMATOR}_${TIMESTAMP}

CUDA_VISIBLE_DEVICES=$CHOSEN_DEVICE python3 -m verl.trainer.main_ppo \
algorithm.adv_estimator=$ADVANTAGE_ESTIMATOR \
data.train_files=data/MATH/train.parquet \
data.val_files=data/MATH/test.parquet \
data.train_batch_size=256 \
data.max_prompt_length=$MAX_PROMPT_LENGTH \
data.max_response_length=$MAX_NEW_TOKENS \
data.filter_overlong_prompts=True \
data.truncation='error' \
actor_rollout_ref.model.path=$MODEL_NAME \
actor_rollout_ref.actor.optim.lr=$LR \
actor_rollout_ref.actor.loss_agg_mode=seq-mean-token-sum-norm \
actor_rollout_ref.model.use_remove_padding=True \
actor_rollout_ref.actor.ppo_mini_batch_size=256 \
actor_rollout_ref.actor.ppo_micro_batch_size_per_gpu=4 \
actor_rollout_ref.actor.use_kl_loss=False \
actor_rollout_ref.actor.kl_loss_coef=0.001 \
actor_rollout_ref.actor.kl_loss_type=low_var_kl \
actor_rollout_ref.actor.entropy_coeff=0 \
actor_rollout_ref.model.enable_gradient_checkpointing=True \
actor_rollout_ref.actor.fsdp_config.param_offload=False \
actor_rollout_ref.actor.fsdp_config.optimizer_offload=False \
actor_rollout_ref.rollout.log_prob_micro_batch_size_per_gpu=4 \
actor_rollout_ref.rollout.tensor_model_parallel_size=1 \
actor_rollout_ref.rollout.name=vllm \
actor_rollout_ref.rollout.gpu_memory_utilization=0.4 \
actor_rollout_ref.rollout.n=$GROUP_SIZE \
actor_rollout_ref.ref.log_prob_micro_batch_size_per_gpu=4 \
actor_rollout_ref.ref.fsdp_config.param_offload=True \
actor_rollout_ref.rollout.temperature=1.0 \
actor_rollout_ref.rollout.top_p=1.0 \
algorithm.use_kl_in_reward=False \
algorithm.norm_adv_by_std_in_grpo=False\
trainer.critic_warmup=0 \
trainer.logger='["console","wandb"]' \
trainer.n_gpus_per_node=1 \
trainer.log_val_generations=$LOG_N_VAL_GENERATIONS\
trainer.nnodes=1 \
trainer.save_freq=20 \
trainer.test_freq=1 \
trainer.project_name=$PROJECT_NAME \
trainer.experiment_name=$RUN_NAME \
trainer.total_epochs=$TOTAL_EPOCHS \