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

Finetune Transformers Models with PyTorch Lightning: documentation error? #139

Open
yfeng24816 opened this issue Feb 4, 2022 · 4 comments
Assignees
Labels
Example Example / Demo / Tutorial

Comments

@yfeng24816
Copy link

When calculating the total steps, shouldn't we use number of batches * epoch size ? In this case, it would be self.total_steps = (len(train_loader.dataset) // tb_size) * ab_size instead of self.total_steps = (len(train_loader.dataset) // tb_size) // ab_size.

Please fix me if anywhere is wrong.

image

https://pytorchlightning.github.io/lightning-tutorials/notebooks/lightning_examples/text-transformers.html

cc @Borda @rohitgr7

@yfeng24816 yfeng24816 added the docs label Feb 4, 2022
@rohitgr7
Copy link
Contributor

rohitgr7 commented Feb 4, 2022

I guess it should be batches * num_epochs but why would it be * ab_size?

@rohitgr7 rohitgr7 added the Example Example / Demo / Tutorial label Feb 4, 2022
@yfeng24816
Copy link
Author

Is ab_size something like num_epochs? It becomes self.trainer.max_epochs when accumulate_grad_batches is 1.

@rohitgr7
Copy link
Contributor

rohitgr7 commented Feb 4, 2022

okay. yes... I didn't see max_epochs there. should be something like

total = (total / accumulation_factor)*max_epochs.

@rohitgr7 rohitgr7 transferred this issue from Lightning-AI/pytorch-lightning Feb 4, 2022
@yfeng24816
Copy link
Author

So do you also think there is an error in the documentation too? I am not sure by my own.

@Borda Borda removed the docs label Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Example Example / Demo / Tutorial
Projects
None yet
Development

No branches or pull requests

3 participants