ODINN-SciML / ODINN.jl

Global glacier model using Universal Differential Equations for climate-glacier interactions
MIT License
71 stars 12 forks source link

Speed up loss function based on `V` #33

Closed JordiBolibar closed 1 year ago

JordiBolibar commented 2 years ago

I have run some benchmarks on the different loss functions based on H, V and HV. The results are the following:

H: 203.710 s (3655336127 allocations: 188.45 GiB)

V: 519.855 s (8589977971 allocations: 471.25 GiB)

HV: 480.228 s (7931932251 allocations: 434.23 GiB)

This clearly indicates that H is the fastest solution. My intuition tells me that including V is slower, possibly due to the fact that it involves dependencies on 2 matrices: Vx and Vy. Since using V should be our preferred option, we should investigate ways to speed this up. Efforts in trying to reduce the number of sampling points to compute the loss (#22) don't seem to yield any advantages. @facusapienza21 to be discussed in today's meeting.

JordiBolibar commented 2 years ago

As discussed in today's meeting, we should find a way to link the adjoints needed for V with the tree from the adjoints of the forward pass of H. A potential solution might be to manually code those to help Zygote make the link.

JordiBolibar commented 1 year ago

Not sure this is relevant anymore. To be re-opened if necessary.