Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging sync_dist Documentation Clarification #20648

Open
Unturned3 opened this issue Mar 15, 2025 · 0 comments
Open

Logging sync_dist Documentation Clarification #20648

Unturned3 opened this issue Mar 15, 2025 · 0 comments
Labels
docs Documentation related needs triage Waiting to be triaged by maintainers

Comments

@Unturned3
Copy link

Unturned3 commented Mar 15, 2025

📚 Documentation

If we do self.log('loss', loss, sync_dist=True) in a LightningModule, is the loss averaged or summed across all the GPUs? From my experiments it seems to be averaged, but it would be nice if the documentation can confirm this explicitly. Currently it says "reduces the metric across devices" but does not mention anything about the reduction operation.

Edit: Upon further investigation, the default reduction operation used by self.log seems to be trainer.strategy.reduce (module.py, line 534). At least for DDPStrategy, this indeed defaults to a mean reduction.

cc @lantiga @Borda

@Unturned3 Unturned3 added docs Documentation related needs triage Waiting to be triaged by maintainers labels Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related needs triage Waiting to be triaged by maintainers
Projects
None yet
Development

No branches or pull requests

1 participant