Page 1 of 1

Speed up MLFF

Posted: Tue Jul 12, 2022 6:12 am
by Zhi0838
Hello,

I conducted a a series of AIMD combined with MLFF to study the ferroelectric phase transition of KNbO3. In order to generate the highly accutrate MLFF, total 1174 configurations were collected in 3*3*3 supercell (ML_SION1 = 0.2 was used) . Subsequently, I tested the MLFF in a 6*6*6 supercell and the good ferroelectric transition could be presented. However, I found the speed of MD using MLFF is slower than the classical MD method. The 6*6*6 supercell (1080 atoms) runs about 18.5 steps per core per hour. So my question is how to speed up the MLFF while keeping the high accuracy as possible.

Thanks.

Zhi

MLFF parameters are attached:

ML_LMLFF = .TRUE.
ML_ISTART = 1
ML_SION1 = 0.2
ML_MRB1 = 12
ML_WTOTEN = 20
ML_WTIFOR = 1
ML_WTSIF = 1
ML_IALGO_LINREG=3
ML_EPS_LOW=1.0E-14

Re: Speed up MLFF

Posted: Wed Jul 13, 2022 1:49 pm
by andreas.singraber
Hello Zhi!

I agree that 18.5 steps per core hour does not look particularly fast, but can you tell me what you mean when you say it is "slower than the classical MD method"? If by "classical" you mean empirical force fields, then yes, the MLFF will usually be slower. That is expected because the computational complexity of atomic environment descriptors plus the kernel method is much higher. On the other hand, if you mean that the execution of an MLFF time step is slower than one AIMD step, there is certainly a problem.

To get a better understanding could you please upload the full VASP setup files (INCAR, POSCAR, KPOINTS, POTCAR) and the resulting ML_FF and ML_LOGFILE? Please also add a POSCAR for the 6*6*6 supercell! At first glance I wonder a bit about the ML_MRB1 = 12 setting. This will dramatically increase the number of angular descriptors and may be responsible for the slow predictions. Are you sure a lower setting will not give acceptable accuracy?

I also want to note that we are currently improving the performance of ML_ISTART = 2, i.e., the prediction-only mode, but unfortunately I cannot yet give an approximate release date nor a general idea how much faster this will be.

Best,

Andreas Singraber

Re: Speed up MLFF

Posted: Fri Jul 15, 2022 4:30 am
by Zhi0838
Hello Andreas!

I mean that the calssical MD is the MD based on the empirical interatomic potential energy. I am so sorry for confusing.

My MLFF documents are attached. However, the ML_FF cannot be unloaded due to the exceeding file size (151 MB). For the ML_MRB1 = 12 setting, I teseted the energy difference between the four phases (cubic, tetragonal, orthorhombic and rhombohedral) compared with the first principle results, and the setting was more accurate than the ML_MRB1 = 8 (I did not carry out the MD simulations using the MLFF based on ML_MRB1 = 8, maybe the accuracy is acceptable).

Thanks for you kind help! And hoping the good results can be achieved in your work!

Best,

Zhi

Re: Speed up MLFF

Posted: Mon Aug 08, 2022 7:23 am
by ferenc_karsai
If you want to have the same accuracy there is not much you can do. Usually the SVD (ML_IALGO_LINREG=3) needs larger number of radial functions (MRB1,2=12) and a lower gaussian broadening (ML_SION1,2=0.3).
The only thing I could imagine you try is ML_EPS_REG = 1E-15. I saw you used ML_EPS_REG = 1E-14. If the regularization does not have to kick in (it is really structure dependent), then a lower ML_EPS_REG can lead to accuracies compared to that from the SVD but without needing increased MRB1 and ML_SION. But I can't guarantee it works. Also if you need only a good description of the energy you can further increase the weight on the energy ML_WTOTEN, but of course the forces and stresses get worse.

I have already implemented the algorithm for the fast version and I can say it will get really significantly faster. But I still need time to further improve it and finish it with all features.