Commit a73b2ab
authored
[worker] fix: Fix missing
### 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.
-->
In the recent PR:
- #2953,
the file `workers/actor/dp_actor.py` was updated so that
`rollout_log_probs` is passed to `policy_loss_fn`:
https://github.com/volcengine/verl/blob/38d23914ee512a125e00763fe3ddcc8df4319346/verl/workers/actor/dp_actor.py#L448-L456
In that PR, the "vanilla" policy loss function was modified to accept
`rollout_log_probs` as an argument. However, other policy loss functions
(e.g., "gspo") were not updated accordingly, which leads to an error
such as:
```
TypeError: compute_policy_loss_gspo() got an unexpected keyword argument 'rollout_log_probs'
```
when setting `config.policy_loss.loss_mode` to one of these
alternatives.
Therefore, in this PR, `rollout_log_probs` is also added as an argument
to the other policy loss functions.
### Checklist Before Starting
- [x] Search for similar PRs. Paste at least one query link here: ...
- [x] 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`
### 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.
### Checklist Before Submitting
> [!IMPORTANT]
> Please check all the following items before requesting a review,
otherwise the reviewer might deprioritize this PR for review.
- [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).)rollout_log_probs argument in policy loss functions (#3274)1 parent e1603dc commit a73b2ab
1 file changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
820 | 821 | | |
821 | 822 | | |
822 | 823 | | |
823 | | - | |
| 824 | + | |
824 | 825 | | |
825 | 826 | | |
826 | 827 | | |
| |||
909 | 910 | | |
910 | 911 | | |
911 | 912 | | |
| 913 | + | |
912 | 914 | | |
913 | 915 | | |
914 | 916 | | |
| |||
967 | 969 | | |
968 | 970 | | |
969 | 971 | | |
970 | | - | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
971 | 981 | | |
972 | 982 | | |
973 | 983 | | |
| |||
995 | 1005 | | |
996 | 1006 | | |
997 | 1007 | | |
| 1008 | + | |
998 | 1009 | | |
999 | 1010 | | |
1000 | 1011 | | |
| |||
1089 | 1100 | | |
1090 | 1101 | | |
1091 | 1102 | | |
| 1103 | + | |
1092 | 1104 | | |
1093 | 1105 | | |
1094 | 1106 | | |
| |||
1160 | 1172 | | |
1161 | 1173 | | |
1162 | 1174 | | |
| 1175 | + | |
1163 | 1176 | | |
1164 | 1177 | | |
1165 | 1178 | | |
| |||
0 commit comments