Skip to content

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

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

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

Conversation

@yunkai-yyk
Copy link

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

@ultmaster
Copy link
Contributor

I guess it doesn't harm. Let's run the tests.

@ultmaster
Copy link
Contributor

/ci

@github-actions
Copy link

github-actions bot commented Feb 28, 2026

🚀 CI Watcher for correlation id-3976202555-mm5qiqg2 triggered by comment 3976202555
🏃‍♀️ Tracking 4 workflow run(s):

✅ All runs completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RayPPOTrainer._dump_generations() missing gts argument in _train_step call

2 participants