ROLL
ROLL copied to clipboard
fix: correct CriticWorker tqdm total to match epochs=1 dataloader
Problem
In CriticWorker.train_step (roll/pipeline/base_worker.py), the dataloader is created with epochs=1, but the tqdm progress bar total is calculated using ppo_epochs:
dataloader = data.make_iterator(
mini_batch_size=backward_batch_size, epochs=1 # epochs=1
)
for batch_idx, mini_batch in tqdm(
enumerate(dataloader),
total=data.batch.batch_size[0] * ppo_epochs // backward_batch_size # uses ppo_epochs
):
When ppo_epochs > 1, the progress bar total is inflated. For example with ppo_epochs=2, the progress bar shows 50% when training is actually complete.
Fix
Remove ppo_epochs from the tqdm total calculation to match the epochs=1 dataloader:
total=data.batch.batch_size[0] // backward_batch_size
Files Changed
roll/pipeline/base_worker.py— tqdm total calculationtests/pipeline/test_critic_tqdm_total.py— regression test