-
Notifications
You must be signed in to change notification settings - Fork 358
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
BatchSplittingSampler
return wrong length
#640
Comments
Thanks for contributing to Opacus. Will take a look. |
Have you had the time to look into this? It seems like a straightfoward fix. |
Thanks for contributing to Opacus! The fix makes sense to me. |
Thanks for pointing that out. Bad habit I guess, math.ceil is better. I changed it to math.ceil |
This patch is still computing incorrectly the expected number of batches. See #516. |
🐛 Bug
BatchSplittingSampler
reports the length asConverting the result simply to
int
leads to the resulted number of batches being one too low. Instead, we need to ceil the result first:Some libraries like pytorch lightning will skip the last batch if this is reported wrong, resulting in no actual step occuring at all.
The text was updated successfully, but these errors were encountered: