Skip to content

fix: pass gts argument in _dump_generations call in _train_step#493

Open
yyk1996 wants to merge 1 commit intomicrosoft:mainfrom
yyk1996:fix/dump-generations-missing-gts
Open

fix: pass gts argument in _dump_generations call in _train_step#493
yyk1996 wants to merge 1 commit intomicrosoft:mainfrom
yyk1996:fix/dump-generations-missing-gts

Conversation

@yyk1996
Copy link

@yyk1996 yyk1996 commented Feb 18, 2026

Summary

Fixes the TypeError caused by missing gts argument when calling _dump_generations in _train_step with rollout_data_dir enabled.

Closes #492

Root Cause

_dump_generations requires gts as a positional argument, but the call site in _train_step did not pass it, resulting in a TypeError at runtime.

Changes

Extract ground_truth from each sample's non_tensor_batch and pass it as gts to _dump_generations:

sample_gts = [item.non_tensor_batch.get("reward_model", {}).get("ground_truth", None) for item in batch]
self._dump_generations(
    inputs=inputs,
    outputs=outputs,
    scores=scores,
    gts=sample_gts,
    reward_extra_infos_dict=reward_extra_infos_dict,
    dump_path=rollout_data_dir,
)

ground_truth is retrieved from reward_model in non_tensor_batch if available, otherwise falls back to None.

Testing

  • Verified the fix resolves the TypeError when rollout_data_dir is set in trainer config
  • Tested with cases where ground_truth is present and absent in non_tensor_batch

Environment

  • Version: v0.3.0
  • File: agentlightning/verl/trainer.py
  • Class: RayPPOTrainer

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.

RayPPOTrainer._dump_generations() missing gts argument in _train_step call

1 participant

Comments