isayevlab / Auto3D_pkg

Auto3D generates low-energy conformers from SMILES/SDF
MIT License
148 stars 34 forks source link

Testing Tutorial notebook, very slow #62

Open GattiMh opened 10 months ago

GattiMh commented 10 months ago

Hello!

I'm working on M2 Mac and I had no issue with installation. Currently, testing your tutorial notebooks optimising the 4 smiles from the smiles.smi file provided.

Upon running these lines:

if __name__ == "__main__":
    path = os.path.join(root, "example/files/smiles.smi")
    args = options(path, k=1, use_gpu=False)   #specify the parameters for Auto3D 
    out = main(args)            #main acceps the parameters and run Auto3D
    print(out)

The notebook mentions taking it less than 1 minute. In my case is quite slow and seems to take multiple minutes. Am I the only one that has these issue?

Many thanks

LiuCMU commented 10 months ago

Hello, I think you were doing it correctly. I can think of 2 reasons for the speed differences, mainly:

Model Elements Covered Charge Training Dataset Size Target DFT Input Output
ANI2x H, C, N, O, F, S, Cl only neutral molecules ~ 4.5M ωB97X/6-31G* elements, coordinates energy, forces
ANI2xt H, C, N, O, F, S, Cl only neutral molecules, with enhancement for tautomers ~ 13M B97-3c elements, coordinates energy, forces
AIMNET H, B, C, N, O, F, Si, P, S, Cl, As, Se, Br, I both neutral and charged molecules ~ 20 M wB97M/Def2-TZVPP elements, coordinates, molecular charge energy, forces

Please let me know if you have additional questions :-)

GattiMh commented 10 months ago

That's really useful, thanks. I think it's a matter of using GPUs then, probably those timelines are related to having GPU performance accounted. Maybe you should update the comment on the notebook? As it stands, it implies the CPU version will be very fast.

GattiMh commented 10 months ago

When running the thermodynamic_calculator notebook, the first stage is fine generate low energy conformers but the second part # Calculate thermodynamic properties with the 3D structures I get this error:

0%|                                                                                                           | 0/4 [00:00<?, ?it/s]
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[5], line 14
     10     t = 298
     11     return (id, t)
---> 14 out_thermo = calc_thermo(out, "AIMNET", get_mol_idx_t, opt_tol=0.003)
     15 print(out_thermo)

File ~/mambaforge/envs/auto3d/lib/python3.12/site-packages/Auto3D/ASE/thermo.py:264, in calc_thermo(path, model_name, get_mol_idx_t, gpu_idx, opt_tol, opt_steps)
    262     T = 298
    263 else:
--> 264     idx, T = get_mol_idx_t(mol)
    265 print(idx)
    267 try:

Cell In[5], line 9, in get_mol_idx_t(mol)
      8 def get_mol_idx_t(mol):
----> 9     id = mol.data["ID"]
     10     t = 298
     11     return (id, t)

AttributeError: 'Mol' object has no attribute 'data'
LiuCMU commented 10 months ago

Change out_thermo = calc_thermo(out, "AIMNET", get_mol_idx_t, opt_tol=0.003) to out_thermo = calc_thermo(out, "AIMNET", opt_tol=0.003) will solve the problem.

Sorry that the examples are outdated. I already updated them :-)