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

Convert to DataSpec and add token counts that include padding #676

Merged
merged 15 commits into from
Oct 17, 2023

Conversation

dakinggg
Copy link
Collaborator

@dakinggg dakinggg commented Oct 15, 2023

This PR changes DataLoader to DataSpec in order to provide a non default token counting function that takes into account padding.

Two runs that are the same except that one of them counts tokens with padding and one counts them without.
Screenshot 2023-10-14 at 8 20 59 PM
Screenshot 2023-10-14 at 8 21 17 PM

  • Fix all the places we assume that dataloaders are returned not dataspecs (mostly tests)
  • support denoising dataloader too (maybe)

@dakinggg dakinggg marked this pull request as ready for review October 16, 2023 21:11
Copy link
Collaborator

@mvpatel2000 mvpatel2000 left a comment

Choose a reason for hiding this comment

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

LGTM but want research approval

llmfoundry/data/text_data.py Outdated Show resolved Hide resolved
llmfoundry/data/text_data.py Outdated Show resolved Hide resolved
dakinggg and others added 7 commits October 16, 2023 14:38
Co-authored-by: Mihir Patel <mihir.v.patel7@gmail.com>
Co-authored-by: Mihir Patel <mihir.v.patel7@gmail.com>
Copy link
Contributor

@alextrott16 alextrott16 left a comment

Choose a reason for hiding this comment

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

LGTM. Left a couple comments for you to consider, but I think it's fine either way.

llmfoundry/data/text_data.py Show resolved Hide resolved
llmfoundry/data/text_data.py Outdated Show resolved Hide resolved
@dakinggg dakinggg merged commit 4fa2dd8 into mosaicml:main Oct 17, 2023
12 checks passed
jjanezhang added a commit that referenced this pull request Oct 20, 2023
fixed typing for mosaicmllogger

fixed formatting, moved logging logic out of logger builder

removed callback moved all to train.py

Convert to DataSpec and add token counts that include padding (#676)

Add support for automatically registering models to UC at the end of training (#618)

removed callback from init

removed callback from init

removed generate callback

sorted imports

formatting changes
@dakinggg dakinggg deleted the token-counting branch December 11, 2023 23:44
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.

None yet

3 participants