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 batchsampler does not work correctly #20327

Merged
merged 6 commits into from
Nov 13, 2024
Merged

Conversation

dadwadw233
Copy link
Contributor

@dadwadw233 dadwadw233 commented Oct 9, 2024

What does this PR do?

Fixes #20326

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?

    • some error occured while testing (on single gpu), but it doesn't seem to have anything to do with my 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

📚 Documentation preview 📚: https://pytorch-lightning--20327.org.readthedocs.build/en/20327/

@github-actions github-actions bot added the pl Generic label for PyTorch Lightning package label Oct 9, 2024
Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

Could you add a test ?

@dadwadw233
Copy link
Contributor Author

Could you add a test ?

I added a simple test (in the latest commit) in 'test_data' which will not be passed in current version but fixed by this pr 😃

@dadwadw233 dadwadw233 requested a review from tchaton October 13, 2024 08:51
Copy link

codecov bot commented Oct 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81%. Comparing base (8ad3e29) to head (ab29ee6).

❗ There is a different number of reports uploaded between BASE (8ad3e29) and HEAD (ab29ee6). Click for more details.

HEAD has 553 uploads less than BASE
Flag BASE (8ad3e29) HEAD (ab29ee6)
cpu 147 21
lightning 107 16
pytest 87 2
python3.9 41 6
python3.10 42 6
lightning_fabric 25 0
python3.11 44 6
gpu 4 2
python3.12 20 3
pytorch2.1 35 12
pytest-full 64 21
pytorch_lightning 19 7
pytorch2.2 10 3
pytorch2.3 10 3
pytorch2.4 9 3
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #20327     +/-   ##
=========================================
- Coverage      89%      81%     -8%     
=========================================
  Files         267      264      -3     
  Lines       23065    23011     -54     
=========================================
- Hits        20574    18609   -1965     
- Misses       2491     4402   +1911     

Copy link
Collaborator

@lantiga lantiga left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the contribution!

@lantiga lantiga added the ready PRs ready to be merged label Nov 12, 2024
@t-vi t-vi merged commit bd5866b into Lightning-AI:master Nov 13, 2024
75 checks passed
MrWhatZitToYaa pushed a commit to MrWhatZitToYaa/pytorch-lightning that referenced this pull request Nov 20, 2024
* fix batchsampler does not work correctly

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add batch sampler shuffle state test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pl Generic label for PyTorch Lightning package ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Pytorch BatchSampler does not work well with pytorch lightning
5 participants