-
Notifications
You must be signed in to change notification settings - Fork 34
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
[performance] slogdet is slow on GPU #5
Comments
Hi, Related to this issue, if you try a large network (e.g. the Glow architecture for CIFAR-10), then you may encounter an error in the middle of training which says:
After looking it up on Google, it seems to me that the SVD operation of _slogdet may be responsible for this. On a note in PyTorch official documentation they say:
I haven't tested the above solution to see whether it has an effect or not. UPDATE:
|
Hi, Thanks! This is gold. I tried on my computer I also found a ~20% speedup by running torch.slogdet on CPU. |
The CIFAR-10 example uses the default I would suggest using something like
instead, which keep the scales bounded. The first choice is what we used in our image experiments, the second is what was used in the Glow code. |
Hey, great codebase, thank you!
I was looking into performance bottlenecks and I found the following which gave me almost a 2x (1.76 it/s -> 2.96 it/s) speedup for the cifar10 example
The issue is in the
Conv1x1
module. the calculation oftorch.slogdet
is much slower on GPU than CPUhttps://github.com/didriknielsen/survae_flows/blob/master/survae/transforms/bijections/conv1x1.py#L40
This is the modified fast
_logdet
The text was updated successfully, but these errors were encountered: