PhySO icon indicating copy to clipboard operation
PhySO copied to clipboard

Very slow on cuda

Open swang066 opened this issue 1 year ago • 4 comments

Hi Wassim,

I am trying to use the PhySO on the Colab. But I found it is very slow when I run the Demo on the gpu cuda, which is even slower than the cpu (~60s/epoch on cpu vs. ~170s/epoch on gpu). Did you test the gpu version? Is it also slow?

Thank you,

Song

swang066 avatar Mar 16 '23 04:03 swang066

Hi, thank you for your interest in our work (am co-author of the paper). This is normal, because the LSTM is very light, so you don't need cuda to run it. You spend more time copying data than actually optimizing. If you want to see performance gain with cuda, you need to modify the LSTM network (number of features, etc).

feevos avatar Mar 16 '23 05:03 feevos

Hi Foivos, thank you very much! Another question is whether PhySO can handle more variables? For example, I have 12 variables (some of them might be extra variables, which are not associated with target), 1 target, and 2000 samples. Can it find a formula between variables and target? If so, will it take a very long time? Thank you!

swang066 avatar Mar 16 '23 05:03 swang066

Hi swang066,

Having 12 variables will make the problem very challenging for PhySO so it might take a longer time to converge and at the end it might only find a good approximation and not necessarily recover the exact underlying physical law due to the difficulty of the problem.

However duration of epochs will not increase due to the number of input variable (it should still be around what is show on the readme file).

Wassim

PS: If you already know the value of constants in your problem and can use fixed constants only and if it makes sense to remove free constants altogether in your problem, removing free constants will increase performances 10 fold because constant optimization is the bottleneck of PhySO at the moment.

WassimTenachi avatar Mar 16 '23 13:03 WassimTenachi

Please let us know if everything is working out for you on the technical aspect so we can close this issue. If you're using PhySO for research please let us know if it suits your needs ! :)

WassimTenachi avatar Mar 16 '23 13:03 WassimTenachi