Using auto_scale_batch_size with variable length batches (sequential data) #12073
Unanswered
jonathanking
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment 3 replies
-
well, auto_scale_batch_size relies on dataloader, by increasing the batch_size at every iteration. So even if you have variable-length sequences, the batch_size for that dataloader still remains the same for all the batches within that iteration, thus it should work fine. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In my sequence modeling work, I have models that use batches of shape
batch_size x sequence_length x D
wheresequence_length
may be different between each batch.How does the
pl.Trainer(auto_scale_batch_size=...)
flag work in this case? Am I unable to use this feature? I imagine it may assume that the batches are similar in size except for the batch dimension.Surely I am not the only person working on modeling tasks with variable-length sequences. If this feature is unavailable in this context, I would love to hear if anyone has written alternatives or modifications that have the same effect.
Thank you for your help!
Beta Was this translation helpful? Give feedback.
All reactions