Skip to content

Conversation

@falletta
Copy link
Contributor

@falletta falletta commented Feb 3, 2026

Changes

  • Parallelized matrix exponential derivative (expm_frechet): Now processes batches of matrices simultaneously instead of looping through each one individually.
  • Parallelized matrix logarithm (matrix_log_33): Now computes logarithms for all systems at once, grouping them by mathematical case type for efficient batch processing.
  • Removed nested loops in cell force computation: The Frechet cell filter previously used two nested loops (one over systems, one over 9 directions). These are now replaced with a single batched operation that computes everything in parallel
  • Added helper utilities: Small utility functions to handle the conversion between single-matrix and batched-matrix formats

The figure below shows the speedup achieved for 10-step atomic relaxation. The test is performed for a 8-atom cubic supercell of MgO using the mace-mpa model. Prior results are shown in blue, while new results are shown in red. The speedup is calculated as speedup (%) = (baseline_time / current_time − 1) × 100. We observe a speedup up to 564% for large batches.
Screenshot 2026-02-03 at 2 57 00 PM

Co-authored-by: Cursor <cursoragent@cursor.com>
@orionarcher
Copy link
Collaborator

Could we get some tests verifying identical numerical behavior of the old and new versions? Can be deleted before merging when we get rid of the unbatched version.

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.

Implement batched versions of math operations used in Frechet and all treatment of complex eigs in logM

2 participants