ACEsuit / mace

MACE - Fast and accurate machine learning interatomic potentials with higher order equivariant message passing.
Other
415 stars 157 forks source link

MD crash with finetuned model from MACE-MP0 #499

Closed jungsdao closed 3 days ago

jungsdao commented 4 days ago

I'm running biased MD with finetuned MACE model from MACE-MP0. This is not finetuned with "multi head interface" branch. I'm running multiple biased MD simulations with slightly different biases (for umbrella sampling application) Everything is fine but with one particular structure, MD explodes. I'm using ASE MD for calculation. Following is the log file of MD run. I'm working on iterative training for MACE but even if I use much accurate model (from later iteration), this problem persists. I wonder if I should add this particular exploding structure into training set to circumvent this issue or is there any other issue that I might have been missed. Please let me know if you have any further information to figure out this issue. Many thanks in advance!

Time[ps]      Etot[eV]     Epot[eV]     Ekin[eV]    T[K]
0.0000      -61372.3930  -61377.7575       5.3645  1976.3
0.0005      -56411.3125  -61363.9297    4952.6172  1824531.9
0.0010      -56461.9609  -61334.2439    4872.2830  1794937.0
0.0015      -56515.1523  -61298.0127    4782.8604  1761993.9
0.0020      -56575.2683  -61282.2837    4707.0154  1734052.8
0.0025      -56604.2887  -61251.7859    4647.4972  1712126.5
0.0030      -56648.5740  -61253.3604    4604.7864  1696391.9
0.0035      -56694.7005  -61285.9557    4591.2552  1691407.1
0.0040      -56744.2024  -61333.5512    4589.3488  1690704.7
0.0045      -56791.2678  -61364.5860    4573.3182  1684799.1
0.0050      -56833.1249  -61371.9039    4538.7790  1672074.9

MACE version : 0.3.5 ASE version : 3.23.1b1 MACE run with CUDA

Additional context Add any other context about the problem here. md_wfl_win0.tar.gz

gabor1 commented 4 days ago

your structure looks reasonable. I wonder - are you doing DFT geometry optimisation and then starting MACE MD right away ? perhaps you should relax the structure with MACE first - if there is a bond length that is just a bit short with DFT with respect to MACE, it can give rise to a big initial force, which then makes the MD explode if you are using a big time step. Alternatively do 100 steps with small tilmestep (0.1 fs) and then switch to normal time step.

I'm not saying there isn't some MACE related problem, but let's rule out the simple things first.

gabor1 commented 4 days ago

we have observed elsewhere that fine-tuned models (or better called "retrained models") that don't use the multi-head are much less stable than models fine-tuned with multihead. this is why we all use multi-head...

ilyes319 commented 4 days ago

@jungsdao Can you please post your finetuning log file + your input script. You should make sure you are using your TRUE E0s computed with your own DFT settings.

jungsdao commented 3 days ago

I realized that this explosion happens because of the bias I imposed to the structure. (There was a singularity in analytical angular derivative) So I think this should not be attributed to MACE issue. Nevertheless multihead training would be the thing I should try. Thanks for helpful suggestions!