Unverified Commit 6e4a445f by Shawn/Yuxuan Tong Committed by GitHub

[Feature] Assert Single Batch for `val_dataloader` (#424)

This is an enhancement for the single batch strategy for
`val_dataloader`, making https://github.com/volcengine/verl/pull/353
more robust.
parent 60c92147
...@@ -528,10 +528,11 @@ class RayPPOTrainer(object): ...@@ -528,10 +528,11 @@ class RayPPOTrainer(object):
collate_fn=collate_fn) collate_fn=collate_fn)
assert len(self.train_dataloader) >= 1 assert len(self.train_dataloader) >= 1
assert len(self.val_dataloader) >= 1 assert len(
self.val_dataloader
) == 1, "Validation dataloader must have a single batch, which inference engines will schedule the memory themselves."
print(f'Size of train dataloader: {len(self.train_dataloader)}') print(f'Size of train dataloader: {len(self.train_dataloader)}')
print(f'Size of val dataloader: {len(self.val_dataloader)}')
# inject total_training_steps to actor/critic optim_config. This is hacky. # inject total_training_steps to actor/critic optim_config. This is hacky.
total_training_steps = len(self.train_dataloader) * self.config.trainer.total_epochs total_training_steps = len(self.train_dataloader) * self.config.trainer.total_epochs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment