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

Support recreating dataloaders during loop #248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ananthsub
Copy link
Contributor

Summary:
Sometimes users need to recreate the dataloaders at the start of the epoch during the overall training loop. To support this, we allow users to register a creation function when creating the state for training or fitting. We pass the state as an argument since users may want to use progress information such as the progress counters to reinitialize the dataloader.

We don't add this support for evaluate or predict since those functions iterate through the corresponding dataloader just once.

For fit, this allows flexibility to reload training & evaluation dataloaders independently during if desired

Differential Revision: D40539580

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40539580

@codecov
Copy link

codecov bot commented Oct 20, 2022

Codecov Report

Merging #248 (a636d89) into master (bc64893) will increase coverage by 0.11%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #248      +/-   ##
==========================================
+ Coverage   89.22%   89.34%   +0.11%     
==========================================
  Files          85       85              
  Lines        5272     5330      +58     
==========================================
+ Hits         4704     4762      +58     
  Misses        568      568              
Impacted Files Coverage Δ
tests/runner/test_fit.py 96.98% <100.00%> (+0.36%) ⬆️
tests/runner/test_train.py 100.00% <100.00%> (ø)
torchtnt/runner/evaluate.py 91.54% <100.00%> (+0.37%) ⬆️
torchtnt/runner/fit.py 83.01% <100.00%> (+3.94%) ⬆️
torchtnt/runner/state.py 98.93% <100.00%> (+0.04%) ⬆️
torchtnt/runner/train.py 92.37% <100.00%> (+0.48%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Summary:
Pull Request resolved: pytorch#248

Sometimes users need to recreate the dataloaders at the start of the epoch during the overall training loop. To support this, we allow users to register a creation function when creating the state for training or fitting. We pass the state as an argument since users may want to use progress information such as the progress counters to reinitialize the dataloader.

We don't add this support for `evaluate` or `predict` since those functions iterate through the corresponding dataloader just once.

For `fit`, this allows flexibility to reload training & evaluation dataloaders independently during if desired

Differential Revision: D40539580

fbshipit-source-id: c67d7be4d20ac25f0b65927a20b525d86f8b56a4
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40539580

@facebook-github-bot
Copy link
Contributor

Hi @ananthsub!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

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

Successfully merging this pull request may close these issues.

2 participants