Open chlwjd1234 opened 1 week ago
Hi, the GPU evaluation of CVs is supported. E.g.: https://github.com/jintuzhang/gnncv/blob/3d0a788a2a215576a5a65b417dd9b82fb574e5a1/nacl/run_biased_gnn/6A_2layer_1c/1/plumed.inp#L29
Thanks.
Now I'm struggling with the torch dependency issues. Could you tell me the torch versions that are tested, especially for this gnncv & mlcolvar modified for graph ? I'm trying to use libtorch 1.13.1 + cuda 11.7.
Also, when running plumed with gnncv, I got error which says:
1455 terminate called after throwing an instance of 'PLMD::Plumed::ExceptionError'
1456 what(): Couldn't find method: 'forward' on class: 'torch.mlcolvar.graph.core.nn.models._torch_mangle_1.GVPModel (of Python compilation unit at: 0x513265c0)'
1457 Exception raised from getMethod at ../aten/src/ATen/core/class_type.cpp:342 (most recent call first):
1458 frame #0: c10::Error::Error(c10::SourceLocation, std::cxx11::basic_string<char, std::char_traits
But idk why it cannot find forward method when running. When I check it manually, I got
from mlcolvar.graph.core.nn.models import GVPModel model = GVPModel(1,6,[16,1]) print(hasattr(model, 'forward')) True
PyTorch
versions including 2.0.1
and 2.2.2
, and tested LibTorch
versions including 2.0.1
, 2.1.2
, and 2.2.2
. However, for LibTorch
, versions 2.1.2
and 2.2.2
are suggested, as earlier versions may contain memory issues (within PyG
).PLUMED
installation. If the provided example runs, then there should be a bug in your training script.SchNet
instead of GVP
from the beginning, which is smoother and easier to train, generally.Thank you for the comments. I'm having same problem in SchNet or GVP model. Also the example NaCl model.ptc has same errors.
I wonder if using independent libtorch causes problem. I mean, when installing pytorch via conda or pip, there would be libtorch which is linked to pytorch. And when compiling plumed, independent libtorch ,which is downloaded by wget, is used. Is it correct to them in this way?
Could you share the the versions of lightning, torch_geometric, torch_scatter ? Also, I wonder if all of the pyg related packages are necessary rather than only torch_geometric and torch_scatter (pyg, torch_sparse, torch_cluster ... )
LibTorch
for PLUMED
is correct. However, since there is an error even for the model file in the repo, there must be an error in your PLUMED
part (input script, or compilation). Try to compile PLUMED
with LibTorch
2.1.2, and see if this will resolve your problem.Thanks.
One quick question: Is your libtorch ABI compatible or not? I've been using abi compatible version of libtorch 2.1.2 for plumed, but I just noticed that pytorch is usually built without ABI when installed via conda
Both versions of LibTorch
(abi
and no-abi
) have been tested. It would be fine as long as you could compile PLUMED
.
I'm not sure, but for now I'm suspecting the namespace mangling when saving to torchscript may be causing the error. Still working on it..
Thanks for the interesting research.
I wanna try this gnn-cv by myself. Did you calculated the gnn-cv with gpu? If only cpu is used, any comment on calculation cost of simulation examples tested in preprint would be helpful.
Thanks!