HanshuYAN / AdjointDPM

5 stars 1 forks source link

adjoint method costs about 5x memory when solving adjoint equations #2

Open cam1681 opened 1 month ago

cam1681 commented 1 month ago

Hi, I reimplemented the code and found that the adjoint method cost about 5x memory when starting solving adjoint equations. And with direct propagation using dpm solver with about only 10 steps, the memory only increases about 2x, so, I am wondering if you also encounter such problem.

douhongkun commented 2 weeks ago

Hi, I reimplemented the code and found that the adjoint method cost about 5x memory when starting solving adjoint equations. And with direct propagation using dpm solver with about only 10 steps, the memory only increases about 2x, so, I am wondering if you also encounter such problem.

Hello, have you reproduced the security audit experiment yet? I'm running with the source code and the image is all black. image

jiachunp commented 2 weeks ago

Hi, I reimplemented the code and found that the adjoint method cost about 5x memory when starting solving adjoint equations. And with direct propagation using dpm solver with about only 10 steps, the memory only increases about 2x, so, I am wondering if you also encounter such problem.

Hello, have you reproduced the security audit experiment yet? I'm running with the source code and the image is all black. image

The main problem is the Neural ODE solver, when I choose the solver type to be Euler and Midpoint, it works. See below.

For the reason why explicit-adams not work, I think it is mainly because the order is too high. In default torchdiffeq, the min order = 4 and the max order = 12 for explicit adams. I usually reset it to min order = 2 and max order = 4, and it also works. download (1) download

douhongkun commented 2 weeks ago

@jiachunp Thank you for your timely response, this solves my problem!