Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Julian Schneider

Pages: [1] 2 3 ... 11
1
Dear Asif,

We will check and get back to you.

2
Hi Nils,

You are correct that ML-FFs are commonly based on the assumption that the total energy is a sum of the energies of each atomic environment.
Unfortunately, we currently do not support atomic energy as an analysis quantity that can be extracted from the calculation.
In order to make a better decision if we should support this analysis in the future, could you maybe give us more input into the application for which you would like to use it?

Best regards,
Julian

3
General Questions and Answers / Re: M3GNET
« on: February 28, 2024, 22:26 »
The log shows only the CPU processes and threads, not the CUDA cores.

If you have more CPU cores, you can increase the OMP_NUM_THREADS to use more threads, which will normally speed-up the CPU part simulation, but it does not neccessarily speed-up the GPU part.

4
It is our experience that the MTP trained on crystal displacements alone is sufficient, and can describe crystals in MD at moderate temperatures very well without active learning in almost all cases.

If you are unsure, you could run some MTP simulations of small systems, check that the simulation runs stable, and compare the forces from MTP with forces from DFT on a few snapshots from this simulations. The error should be similar to the training / testing error of the MTP.

5
This is a bug that we have fixed for the upcoming service pack.
To work around it in the current version please use the calculator in the attached file (which has been egenrated by exporting to script with "Report All" and in the script replacing Angstrom**4 by Angstrom**5 in the Stiwe2Potential() definitions).

6
General Questions and Answers / Re: Error on Cluster
« on: February 9, 2024, 17:47 »
The M3GNet implementation in QuantumATK currently only supports running on a single GPU and with a 1 MPI process (the case that works nicely for you).

When running on CPU only you should set device='cpu'. We found an issue when running on a node that does not support CUDA with device='cuda', the automatic fallback to CPU does not work. We will fix that in the upcoming service pack.

7
General Questions and Answers / Re: Phonon spectrum error
« on: February 5, 2024, 10:24 »
We could run the calculation on our side without error, so it does not seem like a bug. It looks like in your case it goes wrong when using the symmetries. We are still investigating what it could be.

In the meantime, I would recommend to run the calculation with setting
Code
use_symmetry=False
in the DynamicalMatrix.

You can actually try to run it on the same file, ideally it should only do the missing displacement calculations of the equivalent atoms, but re-.use the already calculated atom displacements.

8
General Questions and Answers / Re: M3GNET
« on: January 30, 2024, 09:01 »


To include vdW interactions, it is posssible to combine the M3GNet calculator with a D3-dispersion correction (in analogy to what one would in a DFT calculation for such a system). The calculator would look like this:



Code
calculator_m3gnet = TremoloXM3GNetDirectPESCalculator(device='cpu') 
calculator_d3 = TremoloXCalculator(parameters=DispersionD3Z(xc='PBE'))
calculator = CombinedCalculator([calculator_m3gnet,calculator_d3])

9
General Questions and Answers / Re: M3GNET
« on: January 30, 2024, 08:59 »
With OMP-threading I mean multi-core threading, so using as many cores as you have threads. Then you should see an increase in performace. I have tested it and I could see a decrease in simulation time with increasing number of cores / OMP-threads. The actual speedup may depend on the size of the system.

10
I tried running your script and it seems to run ok in principle. So it could be that it just runs out of memory on your computer and it looks like this is happening during the DFT calculations of the training data.
It looks like you have already tried most of the options to reduce memory by distributing across more nodes.
Apart from that it might be possible to reduce the memory a bit by deleting the calculator state of the optimized configurations, as shown in the attached script.
Also, it seems that the ParallelCG solver you use for the poisson equation uses a bit more memory than the default FFT solver, so changing that could also help a bit, unless you have a specific reason for using that solver.


11
General Questions and Answers / Re: M3GNET
« on: January 16, 2024, 09:41 »
Dear Asif,

The M3GNet calculator does currently not support parallelization over multiple cores via MPI. Instead you could use OMP threading to parallelize over the cores.
In the job manager you can do it as shown in the attached screenshot (assuming you are running on 8 cores).

From the terminal, one would do it like this:
Code
# Define the number of threads to use
export OMP_NUM_THREADS=8
export MKL_NUM_THREADS=8
mpiexec -n 1 atkpython my_script.py


12
General Questions and Answers / Re: M3GNET
« on: January 12, 2024, 22:07 »
Good to hear that it works!
I can understand that the warning can be misleading and we will work on improving that.

Best regards,
Julian

13
General Questions and Answers / Re: M3GNET
« on: January 11, 2024, 20:55 »
Dear Asif,

this message is not necessarily pointing towards an error in the calculation, it just means that the CUDA drivers cannot be initialized.
It could still be that the calculation ran through fine, especially since your calculation ran M3GNet on CPU only.
Could you please double check if the calculations completed ok (meaning that the results files are there and no other error message is written to the log)?
If there are other error messages or a traceback in the log, could you please report them here, then we can let you know how to fix it?

14
General Questions and Answers / Re: M3GNET
« on: January 9, 2024, 17:50 »
Thank you for your question.

Using M3GNet requires the installation of pytorch into QuantumATK first. There are two possibilities how to do that in QuantumATK.

Option 1: Installing pytorch in a python virtual environment (venv, see also https://docs.python.org/3/library/venv.html ):
This is the safe way as it keeps pytorch separated from the QuantumATK installation.

Create a folder with enough space for the venv (we call it $MY_ENV_DIR).
Set up the venv using the python executable in the QuantumATK package:
Code
"$QATK_DIR/atkpython/bin/python" -m venv --system-site-packages "$MY_ENV_DIR"
Activate the venv:
Code
source "$MY_ENV_DIR/bin/activate"
Installing pytorch 2.1
Code
python -m pip install torch==2.1.1 --index-url https://download.pytorch.org/whl/cu118
All simulations need to be run in the activated venv.
The differences to running a simulation via atkpython is:
1. Use the python executable instead of atkpython.
2. Add the line
Code
from QuantumATK import *
at the top of the python script you want to run.
Then M3GNet can be imported and set up like a normal calculator in QuantumATK:
Code
from tremolox.neighborlistcalculator.M3GNetCalculator import TremoloXM3GNetDirectPESCalculator
calculator = TremoloXM3GNetDirectPESCalculator(device='cpu')


Option 2: Installing pytorch directly into the QuantumATK installation.
Although we have not encountered any compatibility issue between pytorch and the external modules in quantumatk, there is still a small risk that this can cause problems. Therefore we recommend making a separate installation of QuantumATK for this. The advantage is that the usage is more straightforward.
Install pytorch using pip:
Code
"$QATK_DIR/atkpython/bin/python -m pip install torch==2.1.1 --index-url https://download.pytorch.org/whl/cu118

In this case scripts can directly be run via atkpython, as one is used to.
M3GNet can be imported and set up like a normal calculator in QuantumATK:
Code
from tremolox.neighborlistcalculator.M3GNetCalculator import TremoloXM3GNetDirectPESCalculator
calculator = TremoloXM3GNetDirectPESCalculator(device='cpu')


To use GPU acceleration one can set
Code
device='cuda'


Note, these instructions are for Linux systems.
For Windows the steps are identical but some of the directories have to be adapted slightly, e.g. replacing bin/ with Scripts/

In case you encounter problems with disc space during installation of pytorch, we recommend to set the environment variables XDG_CACHE_HOME (for the pip cache) and TMPDIR to directories where enough disc space is available.


Hope this helps.

15
Dear Akhil,

as the message says MTP does currently not support using tags to select the subset of atoms it acts on.
In your case I would recommend augmenting the MTP with a D3-dispersion correction, exactly as one would in DFT.
We have a fast force-field-like implementation of the D3-correction which can be combined with other force-fields (https://docs.quantumatk.com/manual/ForceField.html#dispersiond3bj-na-p-sr-ac-pd-ne-ni-f-nd-gd-pt-re-nb-rh-v-rb-at-c-xe-cs-co-cl-ce-yb-hf-ru-b-ra-pb-u-cu-ga-sb-os-au-br-tl-n-s-y-te-bi-ar-eu-pu-po-cr-mg-sc-ir-zn-pr-as-lu-mn-ca-ta-fr-se-ho-ge-rn-h-li-mo-ti-zr-o-er-ag-w-al-tm-ba-hg-tb-be-pm-tc-sm-k-pa-fe-sn-kr-cd-si-la-np-dy-th-in-i-he)


It would work something like this:
Code
# Set up the MTP potential set as you normally would.
potential_set_mtp = TremoloXPotentialSet('MTP')
potential_set_mtp.addParticleType(ParticleType('Mo'))
potential_set_mtp.addParticleType(ParticleType('S'))
potential_set_mtp.addPotential(MTPPotential('mtp_filename.mtp'))

# Use the pre-defined potential set for D3 correction with BJ-damping.
potential_set_d3 = DispersionD3BJ("PBE")

# Merge both potential sets when setting up the calculator
calculator = TremoloXCalculator([potential_set_mtp, potential_set_d3])

This approach will be more accurate than the one based on a LJ potential, because it only adds the missing dispersion contribution to the otherwise accurate MTP.

Pages: [1] 2 3 ... 11