pytorch-lightning icon indicating copy to clipboard operation
pytorch-lightning copied to clipboard

Remove Redundant Host & Device Synchronizations

Open alpha0422 opened this issue 3 months ago • 6 comments

What does this PR do?

Fixes #21232.

Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • [ ] Did you read the contributor guideline, Pull Request section?
  • [ ] Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • [ ] Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR. Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

Reviewer checklist
  • [ ] Is this pull request ready for review? (if not, please submit in draft mode)
  • [ ] Check that all items from Before submitting are resolved
  • [ ] Make sure the title is self-explanatory and the description concisely explains the PR
  • [ ] Add labels and milestones (and optionally projects) to the PR so it can be classified

cc @csarofeen @ptrblck @eqy

alpha0422 avatar Sep 21 '25 05:09 alpha0422

Can we please add one or more unittests for this? Mostly to check that we do not regress if changes are made to this part of the codebase?

Good point, added a few unittests, thanks.

alpha0422 avatar Sep 22 '25 13:09 alpha0422

Hi @SkafteNicki, what should I do to move forward?

alpha0422 avatar Oct 01 '25 02:10 alpha0422

@alpha0422 PR looks fine to me. We are having progrems with our CI at the moment so it may take a bit of time before the PR is merged.

SkafteNicki avatar Oct 01 '25 05:10 SkafteNicki

Hope this PR will be merged. We apply this patch, and it speeds up our training a bit.

anhnguyen-namitech avatar Oct 23 '25 03:10 anhnguyen-namitech

@anhnami we are doing our best, the hope is #21309 will fix some of the remaining issues that been blocking a lot of PRs the last couple of weeks

SkafteNicki avatar Oct 23 '25 05:10 SkafteNicki

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 79%. Comparing base (a7cb33a) to head (79a26d3). :warning: Report is 6 commits behind head on master. :white_check_mark: All tests successful. No failed tests found.

:exclamation: There is a different number of reports uploaded between BASE (a7cb33a) and HEAD (79a26d3). Click for more details.

HEAD has 103 uploads less than BASE
Flag BASE (a7cb33a) HEAD (79a26d3)
cpu 52 27
python 6 3
lightning_fabric 12 0
pytest 27 0
python3.10 12 6
lightning 29 15
python3.11 12 6
python3.12.7 16 9
python3.12 6 3
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #21233     +/-   ##
=========================================
- Coverage      87%      79%     -8%     
=========================================
  Files         269      266      -3     
  Lines       23708    23657     -51     
=========================================
- Hits        20536    18642   -1894     
- Misses       3172     5015   +1843     

codecov[bot] avatar Nov 06 '25 10:11 codecov[bot]

Hi @SkafteNicki, just wanted to follow up on this PR. Is there anything I can do to help move this forward? I'm happy to make any changes if needed.

alpha0422 avatar Dec 15 '25 01:12 alpha0422