Repository navigation
optimizer: size UMA batches by n_atoms, configurable via memory_scales_with - #44
Merged
niklashoelter merged 1 commit intoOct 5, 2026
Conversation
…s_with Add technical.memory_scales_with (auto|n_atoms|n_edges). auto picks n_atoms for UMA, whose large fixed per-structure memory makes edge counts overcharge small molecules, and keeps n_edges for ORB and SevenNet.
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.
Adds
technical.memory_scales_with("auto"|"n_atoms"|"n_edges", default"auto").autousesn_atomsfor UMA (fairchem) and keepsn_edgesfor ORB and SevenNet.Why
UMA has a large fixed memory cost per structure (about 7 MiB for uma-s, 26 MiB for uma-m). With
n_edges, the autobatcher's probe replicates the smallest structure, so that fixed cost gets charged per edge, and small molecules look far more expensive than they are. On a job that mixes 4-atom and 185-atom molecules, the ceiling ended up below the largest molecule. Every uma-m-1p1 run on the kraken library failed with:With
n_atoms, the same job runs.Behaviour change
UMA batch sizing changes by default. To get the old behaviour back, set
"memory_scales_with": "n_edges". ORB and SevenNet are unchanged.Caveat
n_atomsfits UMA without D3. With D3 on, uma-m's memory follows edges + atoms, and neither metric alone fits well. If that combination runs out of memory, setn_edgesexplicitly.Tests
tests/optimization/test_memory_metric.py(auto selection per backend, explicit override); config validation intests/test_config.py.