Commit 6ba07ff0 authored by Wang, Leping's avatar Wang, Leping
Browse files

change project config files to prepare public deployment

parent be849994
[submodule "batchASE"] [submodule "batchASE"]
path = batchASE path = batchASE
url = ssh://git@10.208.16.64:2222/wangleping/mace-bench-hygon.git url = git@gitee.com:nivren/batch-ase.git
branch = hygon-opt-bfgs branch = hygon-opt-bfgs
[submodule "mace"] [submodule "mace"]
path = 3rdparty/mace path = 3rdparty/mace
url = ssh://git@10.208.16.64:2222/huafeng/MACE.git url = git@gitee.com:nivren/mace.git
branch = fasteq-mace-bench branch = fasteq-mace-bench
[submodule "FastEq"] [submodule "FastEq"]
path = 3rdparty/FastEq path = 3rdparty/FastEq
url = ssh://git@10.208.16.64:2222/ncic-ai4sci/FastEq.git url = git@gitee.com:nivren/fast-eq.git
branch = hip branch = hip
[submodule "cuequivariance_torch"] [submodule "cuequivariance_torch"]
path = 3rdparty/cuequivariance_torch path = 3rdparty/cuequivariance_torch
url = git@github.com:malixian/cuEquivariance.git url = git@gitee.com:nivren/fast-eq.git
branch = hip branch = hip
# BOMLIP-CSP # ICT-CSP
An open-source Python framework that integrates machine learning interatomic An open-source Python framework that integrates machine learning interatomic
potentials (MLIPs) with a tailored batched optimization strategy, enabling rapid, potentials (MLIPs) with a tailored batched optimization strategy, enabling rapid,
unbiased structure prediction across the full density range unbiased structure prediction across the full density range.
## Installation (Hygon DCU)
### 1. Clone the repository
## Install the BOMLIP-CSP
```sh ```sh
git clone https://github.com/pic-ai-robotic-chemistry/BOMLIP-CSP.git --recursive git clone -b public git@gitee.com:nivren/ict-csp.git
conda create -n BOMLIP_CSP python=3.10 -y cd ict-csp
conda activate BOMLIP_CSP
cd BOMLIP-CSP/batchASE
# using chmod -R 755 in your BOMLIP-CSP folder if you do not have exection permission
./reproduce/init_mace.sh
source util/env.sh
cd ..
``` ```
## Perform a complete CSP process ### 2. Configure local torch & triton wheels
Starting the exclusive mode to further accelerate the process if you have administrator privileges. Edit `pyproject.toml` — replace the paths under `[tool.uv.sources]` for `torch` and
```sh `triton` with the local `.whl` file paths for your DCU platform.
sudo ./util/mps_start.sh
```
The main program of the CSP process. ### 3. Fetch third-party submodules
BATCHED GEOMETRY OPTIMIZATION REQUIRES GPU USAGE!
PLEASE CONFIRM THE GPU AND WORKER SETTINGS IN THE SHELL SCRIPT BEFORE RUNNING THIS COMMAND!
which includes --gpu_offset --n_gpus --num_workers.
```sh ```sh
./csp.sh git submodule update --init \
batchASE \
3rdparty/mace \
3rdparty/FastEq \
3rdparty/cuequivariance_torch
``` ```
End the exclusive mode after running. ### 4. Set up build dependencies
```sh ```sh
sudo ./util/mps_clean.sh source /opt/dtk/env.sh
sudo apt install python3.10-dev python3-dev
sudo apt install libgflags-dev libgoogle-glog-dev
sudo apt install build-essential libstdc++-12-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/librt.so.1 /usr/lib/x86_64-linux-gnu/librt.so
``` ```
## Perform conformer search / structure generation / structure optimization separately ### 5. Create the virtual environment
### conformer search
In csp.sh, the argument --mode controls the jobs to do. > **Prerequisite:** This project uses [uv](https://docs.astral.sh/uv/) for Python
> environment management. Install it first if you haven't:
> ```sh
> curl -LsSf https://astral.sh/uv/install.sh | sh
> ```
Use conformer_only to perform conformer search task only.
```sh
python "${TOP_DIR}/main.py" --path ${TAR_DIR} --smiles "C1CC2=COC=C12" \
--num_generation 100 --generate_conformers 10 --mode conformer_only > generate_conformer.log 2>&1
```
### structure generation
Or use structure_only to perform structure generation only.
In this mode, conformers (generated by this program or provided by yourself as .xyz file from other methods) should be provided in folder ${TAR_DIR}/molecule_${i}/conformers as conformer_${j}.xyz files
where i start from 1 and j start from 0.
```sh ```sh
python "${TOP_DIR}/main.py" --path ${TAR_DIR} --molecule_num_in_cell 1 \ uv sync
--space_group_list 14,61 --add_name XULDUD --max_workers 16 --num_generation 100 \
--use_conformers 4 --mode structure_only > generate_structure.log 2>&1
``` ```
Conformer search and structure generation could also be done in python script with higher freedom (e.g. higher Z', higher-order co-crystal or control trail structure number for each space group), see structure_generate.py.
### structure optimization ### 6. Verify the installation
Structure optimization is done by a seperate command
```sh ```sh
python "${TOP_DIR}/batchASE/scripts/opt_batch.py" ... uv run python -c "import torch, ase, mace, fasteq; print('ok')"
``` ```
Explanations for all arguments are provided in main.py and batchASE/scripts/opt_batch.py. ### 7. Prepare MACE model weights
Ensure `~/.cache/mace/` contains the required weight file (e.g.
`MACE-OFF23_small.model`). Download from:
### If you want to configure the 7net environment. - <https://github.com/ACEsuit/mace-off/tree/main>
- <https://gitee.com/pfsuo/mace-off/raw/main/mace_off23/MACE-OFF23_small.model>
```sh ### 8. Set up a test run directory
#!/bin/bash
conda create -n 7net-cueq python=3.10 -y && conda activate 7net-cueq
cd BOMLIP-CSP/batchASE
./reproduce/init_7net.sh && source util/env.sh
```
The optimization command for 7net is given in csp.sh
```sh ```sh
# Use a fixed batch size for structural optimization mkdir run && cp example/* run/
python "${TOP_DIR}/batchASE/scripts/opt_batch.py" --target_folder "${TAR_DIR}/structures" \
--molecule_single 13 --gpu_offset 0 --n_gpus 8 --num_workers 48 --batch_size 2 \
--max_steps 3000 --filter1 UnitCellFilter --filter2 UnitCellFilter \
--optimizer1 BFGSFusedLS --optimizer2 BFGS --num_threads 2 --cueq true \
--use_ordered_files true --model sevennet > opt.log 2>&1
``` ```
## Method ### 9. Test crystal structure generation
See the BOMLIP-CSP paper for more details.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. ```sh
source .venv/bin activate
### Third-party Dependencies ./run/generation.sh
```
This project includes dependencies with various licenses: ### 10. Test crystal structure relaxation
- **MACE**: MIT License (compatible)
- **FairChem**: MIT License (compatible)
- **SevenNet**: GPL v3 License (Note: GPL is a copyleft license)
### License Compatibility Notice ```sh
source .venv/bin/activate
./run/relaxation.sh
```
**Important**: This project can run completely without relying on SevenNet. ## Results & Configuration
This project includes SevenNet as an optional dependency, which is licensed under GPL v3.
If you use SevenNet functionality, you should be aware of the GPL licensing requirements.
For commercial use or to avoid GPL restrictions, consider using only the MACE calculator
functionality.
## Citation - **Results** are written to the `csp_results/` directory.
- **Configuration files** for generation and relaxation are located in the `run/` directory.
If you use this code in your research, please cite: ## Tested Environment
```bibtex Hygon DCU · BW200 · DTK 25.04.1
@software{BOMLIP_CSP,
author = {Chengxi Zhao, Zhaojia Ma, Dingrui Fan},
title = {BOMLIP_CSP: Integrating machine learning interatomic potentials with batched optimization for crystal structure prediction},
year = {2025},
url = {https://github.com/pic-ai-robotic-chemistry/BOMLIP-CSP}
}
```
...@@ -23,11 +23,11 @@ dependencies = [ ...@@ -23,11 +23,11 @@ dependencies = [
] ]
[tool.uv.sources] [tool.uv.sources]
torch = { path = "/data/wangleping/torch-2.5.1+das.opt1.dtk25041-cp310-cp310-manylinux_2_28_x86_64.whl" } torch = { path = "/data/whl/torch-2.5.1+das.opt1.dtk25041-cp310-cp310-manylinux_2_28_x86_64.whl" }
mace-torch = { path = "./3rdparty/mace", editable = true } mace-torch = { path = "./3rdparty/mace", editable = true }
cuequivariance-torch = { path = "./3rdparty/cuequivariance_torch/cuequivariance_torch", editable = true } cuequivariance-torch = { path = "./3rdparty/cuequivariance_torch/cuequivariance_torch", editable = true }
fasteq = { path = "./3rdparty/FastEq", editable = true } fasteq = { path = "./3rdparty/FastEq", editable = true }
triton = { path = "../../../../data/wangleping/triton-3.0.0+das.opt1.dtk25041-cp310-cp310-manylinux_2_28_x86_64.whl" } triton = { path = "/data/whl/triton-3.0.0+das.opt1.dtk25041-cp310-cp310-manylinux_2_28_x86_64.whl" }
[tool.uv] [tool.uv]
no-build-isolation-package = [ no-build-isolation-package = [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment