You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using torchmetrics with cpu is too slow, slower than with gpu. I don't think there are a lot of calculations using gpu, multiplies, divides. But I'm not sure where this bottleneck took.
After running the python cprofiler and vizualizing with snakeviz I get this:
it is the topk function from pytorch that is the sinner here, that seems to have much worse performance on cpu than gpu (the program spends around 92% on that single call).
We could probably work around this to only use the torch.topk function whenever the topk parameter != 1 (just use argmax which I think have better performance). @Borda any opinion here?
🐛 Bug
Using
torchmetrics
withcpu
is too slow, slower than withgpu
. I don't think there are a lot of calculations usinggpu
, multiplies, divides. But I'm not sure where this bottleneck took.To Reproduce
Steps to reproduce the behavior:
Expected behavior
They should not be that much different.
Environment
The text was updated successfully, but these errors were encountered: