memory issue for MLFF calculation for large ML_MB

Question on input files/tags, interpreting output, etc.

Please check whether the answer to your question is given in the VASP online manual or has been discussed in this forum previously!

Moderators: Global Moderator, Moderator

Message
Author
henrique_miranda
Global Moderator
Global Moderator
Posts: 414
Joined: Mon Nov 04, 2019 12:41 pm
Contact:

Re: memory issue for MLFF calculation for large ML_MB

#16 Post by henrique_miranda » Thu Jul 28, 2022 3:19 pm

To avoid the sudden change, I constrain the magnetization by setting NUPDOWN=4. Does this make sense?
I would say so but you can look at the bandstructure of the structures where the magnetization became 0 and see what happens when you set NUPDOWN.

Thanks for sharing the basis set size plots.
This makes it clearer to see what is happening.
For most elements, the basis set will not increase much more. It's hydrogen that is problematic
You will need to try and figure out why this is so.

It might be worth checking out whether the POTIM you are using is already small enough.
If your system is changing the temperature too much over time of the MD run it is expected that the different atoms will visit new positions in the phase space which the ML FF will need to learn.

Yes, indeed the default parameter of ML_AFILT2 is 0.002 and not 0.02 as indicated in ML_IAFILT2.
I corrected the wiki page.

henrique_miranda
Global Moderator
Global Moderator
Posts: 414
Joined: Mon Nov 04, 2019 12:41 pm
Contact:

Re: memory issue for MLFF calculation for large ML_MB

#17 Post by henrique_miranda » Fri Jul 29, 2022 8:23 pm

You might also consider setting this variable:
wiki/index.php/ML_LBASIS_DISCARD

ferenc_karsai
Global Moderator
Global Moderator
Posts: 422
Joined: Mon Nov 04, 2019 12:44 pm

Re: memory issue for MLFF calculation for large ML_MB

#18 Post by ferenc_karsai » Mon Aug 01, 2022 8:27 am

Could you please post your ML_AB, POSCAR, POTCAR, INCAR and ML_LOGFILE file where you reach ML_MB.

ferenc_karsai
Global Moderator
Global Moderator
Posts: 422
Joined: Mon Nov 04, 2019 12:44 pm

Re: memory issue for MLFF calculation for large ML_MB

#19 Post by ferenc_karsai » Mon Aug 01, 2022 8:42 am

xiaoming_wang wrote: Thu Jul 28, 2022 2:16 pm
As your mentioned ML_AFILT2, I checked the wiki and found the default value is 0.002. However, from the wiki of ML_IAFILT2 https://www.vasp.at/wiki/index.php/ML_IAFILT2, it seems that the default value is 0.02 for which we can safely use the default ML_LMAX2=4. I checked my calculations, the parameters from the ML_LOGFILE are that ML_AFILT2=0.002 and ML_LMAX2=4. So, seems there are some inconsistences. Could you please check that?

Best,
Xiaoming
Thank you very much for pointing that out! The default value is ML_AFILT2=0.002, in the text there is a typo it should be 0.002, because for l=5 ML_AFILT2=0.02 has anyway a value of 0. I corrected the text now. At least on the ML_AFILT2 page the right value is written.

xiaoming_wang
Jr. Member
Jr. Member
Posts: 52
Joined: Tue Nov 12, 2019 4:34 am

Re: memory issue for MLFF calculation for large ML_MB

#20 Post by xiaoming_wang » Mon Aug 01, 2022 12:36 pm

ferenc_karsai wrote: Mon Aug 01, 2022 8:27 am Could you please post your ML_AB, POSCAR, POTCAR, INCAR and ML_LOGFILE file where you reach ML_MB.
Since the POSCAR has been replaced by the CONTCAR, I uploaded the XDATCAR instead. The ML_AB file is too large, I just uploaded the first half.
You do not have the required permissions to view the files attached to this post.

xiaoming_wang
Jr. Member
Jr. Member
Posts: 52
Joined: Tue Nov 12, 2019 4:34 am

Re: memory issue for MLFF calculation for large ML_MB

#21 Post by xiaoming_wang » Mon Aug 01, 2022 12:44 pm

henrique_miranda wrote: Fri Jul 29, 2022 8:23 pm You might also consider setting this variable:
https://www.vasp.at/wiki/index.php/ML_LBASIS_DISCARD
I'll try this parameter also.

ferenc_karsai
Global Moderator
Global Moderator
Posts: 422
Joined: Mon Nov 04, 2019 12:44 pm

Re: memory issue for MLFF calculation for large ML_MB

#22 Post by ferenc_karsai » Mon Aug 01, 2022 2:54 pm

I've looked at your file and the discrepancy in number of local reference configurations is really huge for the different types, especially for hydrogen.

So please try a learning from scratch with the following INCAR parameters changed:
ML_MB=5000
ML_LBASIS_DISCARD=.TRUE.
ISYM=0
LREAL=A
ENCUT=550 #at least 30 percent larger cutoff from the largest ENMAX in POTCAR file, due to NpT ensemble
POMASS = 63.55 35.45 12.01 10.00 14.00
POTIM=1.25 # We still keep the larger hydrogen mass, but otherwise it takes forever
TEBEG=200
TEEND=300
ML_ISTART=0
LANGEVIN_GAMMA = 5*10
PMASS = 100
ML_EPS_LOW = 5.e-9

The rest of the parameters you can keep from your calculation.
You will still see that hydrogen will be sampled much faster, but when it reaches ML_MB the calculation will not stop. It will still sample new configurations and throw out old ones, keeping the number of local reference configurations at 5000.
I've also added a small temperature ramp, so that it can neve easily get stuck on a Bayesian force error threshold.
I have no clue how good this will work, let's see. Very complicated structures like yours are new for us too.

Also always monitor the structural changes. We have allowed relaxation in all degrees of freedom for the lattice. Liquids usually tend to completely distort (get rod-like) when all degrees of freedom are allowed to change. In that case one needs to use ICONST files where the lattice angles and possibly lattice parameter length ratios are constrained. In your case it looks like a liquid with single CuCl layers in between. No clue what this will do...

xiaoming_wang
Jr. Member
Jr. Member
Posts: 52
Joined: Tue Nov 12, 2019 4:34 am

Re: memory issue for MLFF calculation for large ML_MB

#23 Post by xiaoming_wang » Tue Aug 09, 2022 8:26 pm

Hi,

Either using ML_LBASIS_DISCARD or increasing ML_EPS_LOW could eliminate the memory problem. In the following I used the parameters suggested by ferenc_karsai. I tested the machine-learned FF by comparison of the relaxed lattice parameters and reference data as shown in the tutorial tutorials/latest/md/part2/. However, I got big difference (more than 1 eV) of the total energies for the two ends (large and small lattice variation). To improve the FF, I first tried different ENCUT.
encut.png
The x axis is the cell volume, and the y axis is the energy difference between DFT and MLFF. From 500 eV to 550 eV, we can see clear improvement. However, from 550 eV to 600 eV, the improvement can only be observed at the right end. For the left end, there is no improvement at all. Next, I tried playing with the parameter LREAL and EDIFF to improve the force evaluation.
lreal.png
But as can be seen, by setting LREAL=F and EDIFF=1E-6 did not show any improvement. Last, I tried to increase the basis set size ML_MB.
mb.png
Increasing the basis set size (ML_MB from 5000 to 8500), however, only slightly improved the FF. So, I'm wondering what other parameters that I can play with to further improve the FF?

Best,
Xiaoming
You do not have the required permissions to view the files attached to this post.

Post Reply