Closed frostedoyster closed 3 weeks ago
I tried to restructure the code, but I get this:
python3.12/site-packages/metatrain/utils/evaluate_model.py:300: UserWarning: This system's positions or cell requires grad, but the neighbors does not. You should use `register_autograd_neighbors()` to make sure the neighbors distance vectors are integrated in the computational graph. (Triggered internally at /home/filippo/code/demo/metatensor-models/metatensor/metatensor-torch/src/atomistic/system.cpp:616.)
Should I hide it?
From looking around the code, _eval_targets
in eval.py
is now computing the NL twice: once line 160 of eval.py
, and one in the changes of this PR. I would remove the one in eval.py
!
I don't think we're recomputing the NL in the changes that are introduced in this PR. We're just re-building the System object (taking all NLs that were attached to it and attaching them to the new object). No NL calculation should be done here
Unfortunately I get this warning now on all architectures for evaluation:
/home/filippo/code/metatrain-test/virtualenv/lib/python3.12/site-packages/metatrain/utils/evaluate_model.py:300: UserWarning: This system's positions or cell requires grad, but the neighbors does not. You should use `register_autograd_neighbors()` to make sure the neighbors distance vectors are integrated in the computational graph. (Triggered internally at /project/metatensor-torch/src/atomistic/system.cpp:615.)
new_system.add_neighbor_list(nl_options, nl)
Moreover, PET (which is the only architecture that uses the precomputed interatomic vectors from the NL) crashes, probably due to the warning above. PET runs fine on main however
@Luthaf it works on all architectures now, thank you!
Closes #215
📚 Documentation preview 📚: https://metatrain--249.org.readthedocs.build/en/249/