Skip to content

Fix GraphConverter three-body index batching#166

Open
Lingyu-Kong wants to merge 1 commit into
microsoft:mainfrom
Lingyu-Kong:fix-three-body-indices-batching
Open

Fix GraphConverter three-body index batching#166
Lingyu-Kong wants to merge 1 commit into
microsoft:mainfrom
Lingyu-Kong:fix-three-body-indices-batching

Conversation

@Lingyu-Kong

Copy link
Copy Markdown

Summary

Fix GraphConverter.convert() to return M3GNetData instead of plain PyG Data.

three_body_indices stores edge indices, so PyG needs M3GNetData.__inc__ to offset those indices by num_bonds when batching multiple graphs. Returning plain Data leaves three_body_indices local to each graph for batch_size > 1, while the current M3GNet forward path expects already-global batched edge indices.

Validation

  • Added a regression test checking that the second graph's three_body_indices are offset by the first graph's num_bonds after Batch.from_data_list.
  • Ran py_compile on the modified files.
  • Ran git diff --check.

@Lingyu-Kong

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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