-
Notifications
You must be signed in to change notification settings - Fork 500
support infinite loop over alpaca dataset #66
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
Conversation
[ghstack-poisoned]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one question on stop condition. otherwise LGTM.
if not self.infinite: | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add some mechanic to allow a stop? self.infinite
is a constant after being initialized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think cmd + c should be sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm!
yield input, label | ||
while len(all_tokens) >= max_buffer_token_len: | ||
x = torch.LongTensor(all_tokens[:max_buffer_token_len]) | ||
# batched_x = x.reshape(self.batch_size, -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we can delete the staled comment?
if not self.infinite: | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think cmd + c should be sufficient?
Stack from ghstack (oldest at bottom):
Previously, alpaca dataset is consumed up after only ~50 iterations with 8 data parallel ranks and 8 batch size. This PR adds the (default) option to loop infinitely on the dataset, so that we can unblock integrating other functionalities. Note that loss-related metrics should be read with caution as this will cause overfit.
Update: moved to #92 because migrating to pytorch/ confused ghstack.