Open anezkap opened 4 years ago
It is likely that the the adjoint solver is using an iterative method and taking many iterations. The reason is because the solver parameters from the forward solve are not passed to the adjoint solve. Please see this issue in the pyadjoint repo and use the patch suggested there.
Thank you for your help. I though that this (taking many iterations without having the solver parameters from the forward solve) might be the problem as well, but unfortunately the suggested patch did not help. But it's okay. I do not really need my code to be super fast at the moment.
Just to check, did you verify that the options are still not passed or did you just observe that the code is still slow? In the latter case, it may be that there is a separate issue. I suspect the problem is that pyadjoint solves all adjoint equations via the solve(...)
interface, which has a fair bit of overhead.
Hi again I'm sorry I left this open for so long. Anyway, turns out that I could actually use my code being a bit faster, even though it is not totally crucial. I only observed that my code is still slow, I did not verify whether the options are passed or not. I'm not totally sure how to do that - could you guide me a bit about how I can verify it, please? Thanks a lot
We recently (today) merged some changes (#1804) that make this kind of use faster. Can you update and check?
Hi, I am solving a two equation problem in Firedrake and I was a bit concerned about the disproportional amount of time it takes to compute the derivative of my reduced functional Jhat.
The 1D problem I'm trying to solve is as follows:
The equation for c and solving method is basically the same as in the DG advection equation with upwinding tutorial, k, k_2 are constants, and the control here is c_in.
Solving for c and q takes only couple of seconds, but computing Jhat.derivative() takes around 6 minutes.
Does this look normal, or is there a problem in my code and/or a way how to solve this faster?
Thank you for your help!