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 · 10 comments
Assignees
Labels
Example Example / Demo / Tutorial question Further information is requested

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
@Borda Borda added the question Further information is requested label Jul 24, 2024
@Borda
Copy link
Member

Borda commented Jul 24, 2024

@stancld mind have a look, please? 🐿️

@stancld
Copy link

stancld commented Jul 25, 2024

@Borda Yes, I will have a look on Friday (tmrw). Can you assign the issue to me, please? :]

@stancld
Copy link

stancld commented Jul 26, 2024

It looks like no such example is present in tutorial anymore 🤔

@Borda
Copy link
Member

Borda commented Jul 26, 2024

It looks like no such example is present in tutorial anymore 🤔

https://github.com/Lightning-AI/tutorials/tree/main/lightning_examples/text-transformers

@stancld
Copy link

stancld commented Jul 26, 2024

Oh sorry, I have forked tutorials repo, but it's pytorch one :D

@stancld
Copy link

stancld commented Jul 27, 2024

@Borda I checked the notebook and it looks like the calculation of the total number of training steps is now the responsibility of a Lightning Trainer. The reported error is, therefore, no more relevant for this example, and I believe the issue can be closed/marked as done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Example Example / Demo / Tutorial question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants