Conversation
modified: sample_inputs/input.in.mace modified: src/mace_mpi_api.F90
new file: interfaces/MACE/README.md
|
@FelyCZ this is super exciting, thanks! Is this PR ready for review? |
|
Hi @danielhollas, I have tested the code on a local machine (WSL Ubuntu 22.04.5 LTS) and it yielded no problems. |
|
Perfect, thanks! I just gave you Triage permissions to the repo which should give you enough rights to ask for review and run tests on GitHub (I think). I'll leave it up to @JanosJiri regarding the level of permissions that you should have (perhaps you should be a member of the PHOTOX Dev Team which has write permissions to this repo?). Thanks for adding unit tests! One of them is failing though, can you take a look? The build failure of GFortran 9 is unrelated to these changes so don't worry about it, I'll fix that separately before we merge this. Can you also please run the autoformatter? https://github.com/PHOTOX/ABIN/blob/master/CONTRIBUTING.md#code-formatting Once the format and test pass on GitHub please ping me for review, thanks! |
|
Thanks for the Triage role! I've fixed the unit test and run the autoformat script. The actions are passing now. |
I could have a look, but I won't be able to get to it for quite some time. Sorry, I'm just overwhelmed with my thesis and finishing all papers before I leave the group. Also, I have very limited knowledge of MPI, so I won't be able to review it reliably (at least now).
@FelyCZ, I can add you to the PHOTOX Dev Team](https://github.com/orgs/PHOTOX/teams/devs) if you want and if you plan to work on ABIN or anything else in the repo. There is no official policy for that. |
|
@FelyCZ if you merge in master that should fix the gcc9 build. |
There was a problem hiding this comment.
Just a quick comment, I don't think we should be including the MACE-OFF model in the repo, it's a huge binary blob, and it will likely become obsolete soon as new models come out.
We can definitely provide instructions and link about where it can be downloaded though!
Is this file needed for tests? If so, we should download it as part of the MACE installation script perhaps.
There was a problem hiding this comment.
I agree that it's not entirely necessary. The main idea was to provide users with a quick way to test the interface without any further configuration.
The file is not necessary for the tests; however, the default configuration (&mace namelist) uses the file as fallback.
Add MACE Interface via MPI
Description
This PR adds a new interface for the MACE (Machine Learning Atomic Cluster Expansion) potential to ABIN. MACE is integrated via an MPI-based client-server architecture: a Python server loads and evaluates the MACE ML model, while the Fortran side communicates coordinates, energies, and forces over MPI. This follows the same pattern used for the existing TeraChem (
_tera_) interface.The interface supports configurable model paths, device selection (CPU/CUDA), precision settings, and various MACE-specific options -- all controlled through a new
&macenamelist in the ABIN input file.File Changes
Fortran Core
src/mace_mpi_api.F90mod_mace_mpi). Handles MPI port connection to the Python server, sends atom types/config/coordinates, and defines all MACE namelist variables (model path, device, dtype, batch size, etc.).src/force_mace.F90mod_force_mace). Orchestrates per-bead force evaluation -- sends coordinates viasend_mace, receives energy and forces viareceive_mace. Supports OpenMP.src/forces.F90_mace_case to theforce_wrapperpotential selector, routing toforce_mace().src/init.F90&macenamelist reading and MACE interface/server initialization whenpot='_mace_'.src/mpi_wrapper.F90_mace_to the MPI-required potential check so non-MPI builds raise a clear error.src/Makefilemace_mpi_api.oandforce_mace.oto the build.Python Server
interfaces/MACE/mace_server.pyinterfaces/MACE/README.md&macenamelist parameters. Includes MACE-OFF licensing notice.interfaces/MACE/MACE-OFF23_medium.modelTests
tests/MACE/test.shtests/MACE/mock_mace_server.pymace-torch/PyTorch.tests/MACE/input.inpot='_mace_'and&macenamelist.tests/MACE/mini.xyztests/MACE/*.refenergies.dat.ref,forces.xyz.ref,movie.xyz.ref,velocities.xyz.ref,temper.dat.ref).tests/test.shMACEin the MPI test folder list.unit_tests/test_mace.pfunit_tests/Makefilemacetarget to the unit test build, test runner, and clean targets.Utilities & Docs
utils/run.mace_mpi_abin.shdev_scripts/install_mace.shmace-torch,mpi4py).sample_inputs/input.in.mace&macenamelist configuration.README.md