Skip to content

Commit

Permalink
stride is an issue in the backward pass through the forces, this m mi…
Browse files Browse the repository at this point in the history
…ght fix it
  • Loading branch information
wiederm committed Aug 24, 2024
1 parent a315724 commit c5b87be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modelforge/train/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def _get_forces(

return {
"per_atom_force_true": per_atom_force_true,
"per_atom_force_predict": per_atom_force_predict,
"per_atom_force_predict": per_atom_force_predict.contiguous(),
}

def _get_energies(
Expand Down Expand Up @@ -1128,6 +1128,10 @@ def setup_trainer(self) -> Trainer:
"""
from lightning import Trainer

# if devices is a list
if isinstance(self.runtime_parameter.devices, list):
strategy = "ddp"

trainer = Trainer(
max_epochs=self.training_parameter.number_of_epochs,
num_nodes=self.runtime_parameter.number_of_nodes,
Expand Down

0 comments on commit c5b87be

Please sign in to comment.