Skip to content

Register multipolar MACELES readouts in optimizer param groups - #1750

Open
djkim-kr wants to merge 1 commit into
ACEsuit:developfrom
ChengUCB:fix/maceles-optimizer-groups
Open

djkim-kr wants to merge 1 commit into
ACEsuit:developfrom
ChengUCB:fix/maceles-optimizer-groups

Conversation

@djkim-kr

@djkim-kr djkim-kr commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #1741

Problem

MACELES builds seven LES readout containers besides les_readouts:

  • les_u_readouts (dipoles)
  • les_quad_1o_readouts, les_quad_2e_readouts (quadrupoles)
  • les_alpha_readouts, les_alpha_1o_readouts, les_alpha_2e_readouts (polarizability)
  • les_kappa_readouts (hardness)

None of them is listed in optional_submodule_names in get_params_options. Since #1529 added the unregistered-parameter guard, training any MACELES with use_dipole, use_quad, induced charges or dipoles, or anisotropic polarizability fails at optimizer setup:

ValueError: N trainable parameters of MACELES are not registered in any optimizer parameter group ...

Before #1529 the same weights were silently left out of the optimizer. They received gradients but kept their initial values for the whole run.

Changes

  • mace/tools/scripts_utils.py: add the seven container names to optional_submodule_names. They use weight_decay=0.0, the same as les_readouts.
  • tests/extensions/les/test_maceles.py: add a test that builds a multipolar MACELES with 0e/1o/2e channels and asserts that every LES readout container is non-empty and gets its own optimizer group. Unclaimed parameters are already caught by the guard in get_params_options.

Compatibility

Monopole-only MACELES and all other model classes get exactly the same parameter groups as before. Empty containers are skipped by the existing if not submodule_parameters check, so no empty groups are added.

Testing

  • The new test fails on develop with the ValueError above and passes with this change.
  • pytest tests/extensions/les tests/unit/test_optimizer_param_groups.py passes.

This branch is waiting to be deployed

1 waiting deployment
gpu-external — 30dd8e05 Waiting Oct 5, 2026 by djkim-kr via push #642
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.

Multipolar MACELES readouts are missing from optimizer parameter groups

1 participant