Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
add ValueError
Signed-off-by: xhx1022 <1737006628@qq.com>
  • Loading branch information
xhx1022 committed Feb 7, 2026
commit 6f914f9eedf9ba3a67909b77c08864edde091e70
23 changes: 7 additions & 16 deletions verl/trainer/ppo/ray_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1520,22 +1520,13 @@ def fit(self):
metrics.update(old_log_prob_metrics)
old_log_prob.batch.pop("entropys")
if "routed_experts" in batch.batch and "routed_experts" in old_log_prob.batch:
if self.use_legacy_worker_impl == "disable":
router_mode = "disabled"
if self.config.actor_rollout_ref.actor.strategy == "megatron":
router_mode = getattr(
self.config.actor_rollout_ref.actor.megatron.router_replay,
"mode",
"disabled",
)
else:
router_mode = getattr(
self.config.actor_rollout_ref.actor.router_replay, "mode", "disabled"
)
if router_mode == "R2":
batch.batch.pop("routed_experts")
else:
old_log_prob.batch.pop("routed_experts")
raise ValueError(
"Detected conflicting router replay configuration: "
"router_replay.mode='R2' and enable_rollout_routing_replay=True "
"cannot be enabled simultaneously. "
"The enable_rollout_routing_replay option is only used in R3 mode; "
"it should not be set when using R2 mode."
)
batch = batch.union(old_log_prob)
if "rollout_log_probs" in batch.batch.keys():
# TODO: we may want to add diff of probs too.
Expand Down
Loading