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
Bugfix - pretraining oom #348
Conversation
3707a8d
to
4997b57
Compare
Thanks @eduardocarvp, It seems to be exactly what we needed. I was thinking about the cases where the std is 0, this happens everytime one feature has a unique value. As all this is just about normalization we could maybe fill 0 values of the std by the absolute value of the unique value (+1 if the unique value is 0). This might be done in another PR but I'd like to have this in the next release as it causes a lot of confusion during pretraining. |
What about this @Optimox ? |
@eduardocarvp I think we should try not to ask for unnecessary newer version to allow compatibility with other packages. For instance, we do not need the latest pytorch version, it would be a shame to force |
da33c54
to
016f3ae
Compare
016f3ae
to
c2bd5dc
Compare
c2bd5dc
to
aac163b
Compare
What kind of change does this PR introduce?
This fixes the OOM error when using GPU with large validation sets during pretraining.
Does this PR introduce a breaking change?
No.
What needs to be documented once your changes are merged?
Nothing.
Closing issues
Closes #341
PS:
I spent a lot of time trying to find why the two losses were not giving the same answer. It turns out, be default numpy.std does not apply the Bessel correction, which consists of multiplying the std by n/(n-1) to render the estimator unbiased. For that, we need to add
ddof=1
on the lineand just then the test works.
Talking about tests, the test was written, but since we do not currently have unit tests and pytest is not installed, installing it would cause the poetry lock to change and upgrade quite a lot of packages. We should probably do this somewhere else on another PR and then add the unit tests to the gitlab-ci on that occasion.