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

Dataloader updates and streamlining #99

Merged
merged 22 commits into from
Jul 30, 2024

Conversation

daviswer
Copy link
Collaborator

@daviswer daviswer commented Jul 25, 2024

A number of cleanup/streamlining changes with no behavioral impact at the training level. This is mostly preparation for landing in torchdata and upcoming features, particularly support for n_workers > 1.

  • Modify instantiation so that all path- and rank-dependent setup in a layer is deferred to a new recursive setup fn, which executes immediately before saving/loading/stepping. This allows for modification of rank/path after instantiation.
  • SamplingDataset and ScalableShardDataset are now implemented as proper _WrapperDatasets (though they still must stack in the same order and location). This reflects the intended modular use of _WrapperDatasets, rather than treating these as edge cases of _StatefulDataset due to their containing multiple sub-iterators. No more pass-through args!
  • Remove Weird_Separated_Camel_Case naming convention in favor of ProperClassNaming
  • Update unit tests to reflect above changes
  • Update dataloader builder to reflect the more modular sampling and scalable datasets
  • Update PreloadBufferDataset so that when the buffer is too large (i.e. rescaling to a smaller number of workers) it will shrink down to the desired size over time, rather than staying oversized.

Again, no user-facing behavior is changed, these are just preparatory updates for further additions. Backward compatibility with older checkpoints is maintained, and training code runs unaffected.

@daviswer daviswer requested a review from lchu6 July 25, 2024 20:32
Copy link
Contributor

@lchu6 lchu6 left a comment

Choose a reason for hiding this comment

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

LG.

regression test passed.

@lchu6 lchu6 merged commit ba862d8 into foundation-model-stack:main Jul 30, 2024
3 checks passed
@daviswer daviswer deleted the data-reorg branch July 30, 2024 18:17
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.

2 participants