Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on torch_scatter and torch_sparse #229

Merged
merged 17 commits into from
Nov 3, 2023

Conversation

RaulPPelaez
Copy link
Collaborator

Removes dependency on torch_sparse by implementing message passing operations with manually written ones.

Removes dependency on torch_scatter by using torch.index_add and torch.scatter_reduce.

@RaulPPelaez
Copy link
Collaborator Author

cc @guillemsimeon @AntonioMirarchi. Correctness tests are passing, but for this PR I had to reimplement the message passing of ET, T, and GN.

I do not want to merge it before a long train has been carried out to compare nothing broke.
Can you recommend a good test yaml for this? Please post it here and I will run it with/without this PR.

@guillemsimeon
Copy link
Collaborator

For the ET, the MD17 is fine. For the T, I would directly remove the architecture from TorchMD-NET, and I do not know any case where it has been used. For the GN, you can perhaps use the ones here https://arxiv.org/pdf/2212.07492.pdf

@RaulPPelaez
Copy link
Collaborator Author

@giadefa, do you agree with removing the Transformer architecture altogether? Its less dev burden for sure...

@guillemsimeon
Copy link
Collaborator

Raul, could you also train TensorNet on QM9 U0 with seed 1 as part of these tests? The yaml is in the repo.

@RaulPPelaez
Copy link
Collaborator Author

I would say ET is correctly implemented:
image

@RaulPPelaez
Copy link
Collaborator Author

TensorNet also looks ok:
image

@RaulPPelaez
Copy link
Collaborator Author

RaulPPelaez commented Oct 14, 2023

GN also seems fine:
image
Not sure what makes GN be so much more accurate in terms of reproducibility than the other ones, though.
I am using this yaml:

activation: tanh
batch_size: 8192
inference_batch_size: 8192
dataset: Custom
coord_files: "chignolin_ca_coords.npy"
embed_files: "chignolin_ca_embeddings.npy"
force_files: "chignolin_ca_deltaforces.npy"
cutoff_upper: 12.0
cutoff_lower: 3.0
derivative: true
early_stopping_patience: 30
embedding_dimension: 128
lr: 0.0005
lr_factor: 0.8
lr_min: 1.0e-06
lr_patience: 10
lr_warmup_steps: 0
model: graph-network
neighbor_embedding: false
ngpus: -1
num_epochs: 100
num_layers: 4
num_nodes: 1
num_rbf: 18
num_workers: 8
rbf_type: expnorm
save_interval: 2
seed: 1
test_interval: 2
test_size: 0.1
trainable_rbf: true
val_size: 0.05
weight_decay: 0.0

@RaulPPelaez RaulPPelaez changed the title [WIP] Remove dependency on torch_scatter and torch_sparse Remove dependency on torch_scatter and torch_sparse Oct 24, 2023
Copy link
Collaborator

@guillemsimeon guillemsimeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks good to me

@RaulPPelaez RaulPPelaez merged commit a67ac80 into torchmd:main Nov 3, 2023
1 check passed
@RaulPPelaez RaulPPelaez deleted the remove_scatter_sparse branch January 23, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants