Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the split placement example #281

Merged
merged 1 commit into from
Feb 15, 2025

Conversation

xffxff
Copy link
Contributor

@xffxff xffxff commented Feb 15, 2025

The split placement example is outdated, I tried it and encountered some errors. To address this, the following changes were made in this PR

  1. Copied the content from verl/trainer/config/ppo_trainer.yaml to examples/split_placement/config/ppo_trainer_split.yaml
  2. Copied RayPPOTrainer.fit method into the fit func in examples/split_placement/split_monkey_patch.py and modified it to get the futures of critic_output and actor_output


actor_output = actor_output.get()
actor_output_metrics = reduce_metrics(actor_output.meta_info['metrics'])
metrics.update(actor_output_metrics)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified to get futures of critic_output and actor_output

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job! What do you modify here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified to get futures of critic_output and actor_output

The comments here are just to highlight the changes compared to RayTrainer.fit, because most of the code is copied from RayTrainer.fit.
image

These changes are copied from examples/split_placement/split_monkey_patch.py, because the update_actor and update_critic would be non-blocking as described in https://github.com/volcengine/verl/tree/main/examples/split_placement#step-2-make-the-models-executed-asynchronously. I didn't add any new things here, I just copied bits from both RayTrainer.fit and examples/split_placement/split_monkey_patch.py to make it consistent with the original logic.

@PeterSH6 PeterSH6 merged commit c8b9c35 into volcengine:main Feb 15, 2025
12 checks passed
as12138 pushed a commit to as12138/verl that referenced this pull request Feb 20, 2025
The split placement example is outdated, I tried it and encountered some
errors. To address this, the following changes were made in this PR
1. Copied the content from `verl/trainer/config/ppo_trainer.yaml` to
`examples/split_placement/config/ppo_trainer_split.yaml`
2. Copied `RayPPOTrainer.fit` method into the `fit` func in
`examples/split_placement/split_monkey_patch.py` and modified it to get
the futures of `critic_output` and `actor_output`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants