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 failing test on main #2080

Merged
merged 1 commit into from
Oct 24, 2023
Merged

Fix failing test on main #2080

merged 1 commit into from
Oct 24, 2023

Conversation

muellerzr
Copy link
Collaborator

What does this PR do?

We should only save/load the sampler if it's an iterable dataset shard, and if we use our custom sampler. Otherwise pulling from the batch sampler and loading it is more nuanced. For the sake of the release, let's focus on just the new sampler. If users report that they can't reproduce trainings on batch samplers (or if we test and find we can't), then we can pivot after.

Fixes # (issue)

Failing test on main that caught this

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@LysandreJik @BenjaminBossan

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 24, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Member

@BenjaminBossan BenjaminBossan 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 fixing the issue.

From my understanding, this is a -- potentially temporary -- fix that makes the saving and loading of the sampler more specific because the current code does not cover some cases. If that's right, could you elaborate where it goes wrong so that we have it written down for the future?

@muellerzr
Copy link
Collaborator Author

Where it goes askew is we need a better way to get the users batch sampler from our custom batch sampler. Such as dataloader.batch_sampler.batch_sampler. (Since our sampler stores that in the batch_sampler.

One potential fix: add dataloader.get_sampler() which will know to return either the batch_sampler or sampler of the original dataloader

@muellerzr muellerzr merged commit eb8c535 into main Oct 24, 2023
26 checks passed
@muellerzr muellerzr deleted the fix-failing-test branch October 24, 2023 16:55
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.

3 participants