ROLL icon indicating copy to clipboard operation
ROLL copied to clipboard

fix: correct CriticWorker tqdm total to match epochs=1 dataloader

Open dubin555 opened this issue 8 months ago • 1 comments

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 calculation
  • tests/pipeline/test_critic_tqdm_total.py — regression test

dubin555 avatar Mar 14 '26 10:03 dubin555

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 14 '26 10:03 CLAassistant