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

fix: ddp bug #145

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

fix: ddp bug #145

wants to merge 3 commits into from

Conversation

JSabadin
Copy link
Contributor

PR Description

This PR updates the metric computation step to ensure that all returned metrics (map and related values) are moved to the GPU device before logging. Without this change, calls to pl.log would trigger runtime errors by attempting distributed reductions (all_reduce) on CPU tensors under the nccl backend in multi-GPU training environments.

@JSabadin JSabadin requested a review from a team as a code owner December 13, 2024 11:00
@JSabadin JSabadin requested review from kozlov721, klemen1999, tersekmatija and conorsim and removed request for a team December 13, 2024 11:00
@github-actions github-actions bot added the fix Fixing a bug label Dec 13, 2024
Copy link
Collaborator

@klemen1999 klemen1999 left a comment

Choose a reason for hiding this comment

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

Will we encounter same issue if using MeanAveragePrecisionKeypoints or other custom metrics?

@JSabadin
Copy link
Contributor Author

JSabadin commented Dec 16, 2024

Will we encounter same issue if using MeanAveragePrecisionKeypoints or other custom metrics?

Yes, if the output metrics are stored on the device's CPU

@klemen1999
Copy link
Collaborator

klemen1999 commented Dec 16, 2024

Lets test this out and include the fixes for others as well under this PR in that case

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.01%. Comparing base (631b905) to head (02a5672).
Report is 24 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #145      +/-   ##
==========================================
- Coverage   96.31%   95.01%   -1.31%     
==========================================
  Files         147      170      +23     
  Lines        6304     7517    +1213     
==========================================
+ Hits         6072     7142    +1070     
- Misses        232      375     +143     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@kozlov721 kozlov721 left a comment

Choose a reason for hiding this comment

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

Lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants