Open
Conversation
450d7cf to
191cf36
Compare
- Use batch_to_dict -> move_to_device pattern in deprecated get_properties method, consistent with predict/fit paths - Create index_map on the same device as num_triple_ij to avoid CPU/CUDA tensor mismatch in three_body_edge_map computation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merge the device transfer logic into batch_to_dict via its existing device parameter (now defaulting to None). This ensures every call site gets device placement automatically and removes the risk of forgetting a separate move_to_device call. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add conftest.py with a device fixture that auto-detects available torch devices. Tests using the fixture run on all available backends. A --device flag allows restricting to a single device. Converted test_batch_relax.py from unittest to pytest style to use the device fixture. Verified passing on both cpu and mps. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- M3Gnet.forward now uses .get() with fallback computation for precomputed keys (total_num_atoms, bond_index_bias, etc.), so callers constructing input dicts directly won't KeyError. - batch_to_dict creates index_map on CPU (moved to device at the end), avoiding intermediate device mismatches. - Remove unused pytest import in test_batch_relax.py. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Prevents device mismatch if graph_batch tensors are already on a non-CPU device when batch_to_dict is called. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SphericalBasisLayer.coefas a buffer so it moves with the model on MPSbatch_to_dict()and move the input dict to the target deviceexplicitly