Synchronise with devel#77
Merged
Merged
Conversation
# Conflicts: # bin/emle-analyze # emle/_analyzer.py
Tarball-to-extxyz tool
# Conflicts: # emle/models/_emle.py # emle/models/_mace.py
# Conflicts: # emle/calculator.py
EMLETrainer fixes
PyTorch 2.6 changed the default of torch.load's weights_only argument from False to True. Models containing e3nn objects (EnergyEMLEMACE) cannot be loaded with weights_only=True. Pass weights_only=False explicitly in both MACEEMLE and MACEEMLEJoint _load_mace_model static methods. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…on block Under PyTorch >= 2.6, torch.load defaults to weights_only=True, which rejects e3nn's constants.pt because it contains a slice object. This caused the emle_mace import inside the try/except block to fail with UnpicklingError rather than ImportError, so the bare 'except ImportError' silently swallowed the error but left EnergyEMLEMACE unregistered. Fix by: - Calling _torch.serialization.add_safe_globals([slice]) before the import so e3nn can load its constants.pt under PyTorch 2.6+. - Broadening the handler to 'except Exception' so any unexpected import failure is still caught rather than propagating. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…MACEEMLEJoint TorchScript-compiled models (class RecursiveScriptModule) expose the original class name via model.original_name but cannot be instantiated directly, and their ModuleList submodules do not support negative indexing, making config extraction via attribute introspection impossible. Changes in both MACEEMLE and MACEEMLEJoint.__init__: - Short-circuit already-compiled models: append source_model.to(dtype) directly and skip the extract-config / rebuild / recompile pipeline entirely. - Use getattr(model, "original_name", ...) for EnergyEMLEMACE dispatch so that compiled checkpoints (where __class__.__name__ is "RecursiveScriptModule") are still correctly identified. - When reconstructing an uncompiled EnergyEMLEMACE model from config, use the EnergyEMLEMACE class explicitly rather than source_model.__class__ (which would be RecursiveScriptModule for compiled inputs that bypass short-circuit). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Renames the backend string from 'maceemle' to 'emle-mace' in EMLECalculator, the supported backends list, and emle-analyze. Also removes a duplicate dead-code elif branch for the old name in emle-analyze. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.
This PR brings the latest updates from
develintomain.