Skip to content

fix(logging): log INFO only on main rank - #39

Merged
Neonkraft merged 1 commit into
mainfrom
fix/logging
Jun 30, 2026
Merged

fix(logging): log INFO only on main rank#39
Neonkraft merged 1 commit into
mainfrom
fix/logging

Conversation

@Neonkraft

Copy link
Copy Markdown
Collaborator

Summary

Under accelerate launch, every rank ran main() and emitted log messages independently, producing N copies of every logger.info line (one per GPU). setup_logging() now reads the RANK environment variable (set by accelerate before spawning processes) and installs a NullHandler on all non-zero ranks, so only rank 0 produces any log output.

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Performance
  • Documentation
  • Maintenance

@HannanJaved HannanJaved left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM :)

@Neonkraft
Neonkraft merged commit 0e952a4 into main Jun 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants