Skip to content

ppo-critic can train - #2023

Open
Hyperion-shuo wants to merge 15 commits into
InternLM:mainfrom
Hyperion-shuo:ss/ppo-critic
Open

ppo-critic can train #2023
Hyperion-shuo wants to merge 15 commits into
InternLM:mainfrom
Hyperion-shuo:ss/ppo-critic

Conversation

@Hyperion-shuo

Copy link
Copy Markdown
Contributor

No description provided.

@windreamer
windreamer requested a review from YanhuiDua August 14, 2026 13:21
@@ -0,0 +1,109 @@
from pathlib import Path

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

建议先提供一个最简的以 gsm8k 为 demo 例子的 qwen3.5 ppo 配置例子,作为全局入口

@@ -360,10 +357,11 @@ class BaseRLTrainerConfig(BaseModel):
seed: int = 42
debug_rollout: bool = False
debug_rollout_dir: Path | str | None = None
rollout_exporter: Callable[[list[list[RolloutState]], int], None] | None = None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

导出需要自定义吗?目前的 debug_save 无法满足需求吗/

@@ -451,6 +451,10 @@ class RLColocateTrainerConfig(BaseRLTrainerConfig):
validation. Defaults to False.
exp_tracker (Literal["tensorboard", "jsonl"]): Experiment tracker type.
Defaults to "tensorboard".
discard_initial_rollout_batches (int): Number of initial complete

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这个有啥好处吗?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

这个可以去掉了,测试下来没啥用
之前主要因为ppo容易长度崩溃,所以想把第一个长度比较短的batch数据丢掉

@@ -767,6 +804,14 @@ def _resume_train_controller_and_state(self, checkpoint_path: Path | str) -> Pat
with train_state_path.open("r") as f:
train_state = json.load(f)
self._cur_step = train_state["cur_step"]
rng_state_path = checkpoint_path / self._SAVE_RNG_STATE_PATH
if rng_state_path.exists():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这个是发现啥 bug 才加的吗?

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