Skip to content

Commit each W&B metrics step - #4818

Merged
felipemello1 merged 2 commits into
pytorch:mainfrom
felipemello1:fix/wandb-commit-metrics
Sep 21, 2026
Merged

felipemello1 merged 2 commits into
pytorch:mainfrom
felipemello1:fix/wandb-commit-metrics

Conversation

@felipemello1

@felipemello1 felipemello1 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

When a step is passed explicitly, W&B buffers the metrics instead of committing the row. Charts can therefore lag or remain empty.

This commits each metrics row when it is logged.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 21, 2026
@felipemello1
felipemello1 marked this pull request as ready for review September 21, 2026 17:03
@pytorch-bot pytorch-bot Bot added the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Sep 21, 2026
for k, v in metrics.items()
}
self.wandb.log(wandb_metrics, step=step)
self.wandb.log(wandb_metrics, step=step, commit=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we config wandb correctly? I feel it even if it buffers, it should not remain empty.

But I guess we only log to wandb once per step, so commit should not cause any perf issue.

@felipemello1
felipemello1 merged commit e0e35fe into pytorch:main Sep 21, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/fake-pg Run 1-GPU Fake PG integration tests CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants