tianjuxue / jax-am

Additive manufacturing simulation with JAX.
https://jax-am.readthedocs.io/en/latest/
GNU General Public License v3.0
265 stars 56 forks source link

PETSc with original ad_wrapper is computing wrong gradients #20

Open SNMS95 opened 1 year ago

SNMS95 commented 1 year ago

This has to be fixed!

We may need to keep short gradient checks for each function to detect where the leak is happening.

tianjuxue commented 1 year ago

I think this is a problem with PETSc not converging. If you look at the logging information, the solver did not converge at all. So gradient computation will definitely be wrong.

I have a feeling that this is due to PETSc using 32-bit rather than 64-bit. If you have some time, please explore. Thanks.