Skip to content

Make MACE work with LLPR#1013

Open
pfebrer wants to merge 6 commits intomainfrom
mace_llpr
Open

Make MACE work with LLPR#1013
pfebrer wants to merge 6 commits intomainfrom
mace_llpr

Conversation

@pfebrer
Copy link
Contributor

@pfebrer pfebrer commented Jan 16, 2026

MACE wasn't working with LLPR because of some stupid reasons:

  • It was missing the last_layer_feature_size attribute.
  • LLPR couldn't work with last layer features that have components (even if they are scalars).

This is a temporary fix so that things work (one can test the tutorial using MACE instead of soap-bpnn) before the workshop next week. I think @SanggyuChong is working on some improvements, so the implementation will be changed in the future. Eventually we should support multihead models, for now I just made the MACE internal head work with LLPR. This works with MACE foundation models.

@pfebrer
Copy link
Contributor Author

pfebrer commented Jan 16, 2026

Ok, ready @Luthaf

Copy link
Member

@Luthaf Luthaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me, I'd like to have some input from one of the LLPR maintainer though @frostedoyster @SanggyuChong

@Luthaf
Copy link
Member

Luthaf commented Jan 19, 2026

cscs-ci run

1 similar comment
@pfebrer
Copy link
Contributor Author

pfebrer commented Jan 19, 2026

cscs-ci run

@pfebrer
Copy link
Contributor Author

pfebrer commented Jan 19, 2026

The same error has happened twice in CSCS-CI (at different moments):

read_to_channel: ReadMessage error websocket: close 1006 (abnormal closure): unexpected EOF

I think it has nothing to do with my PR 😅

@Luthaf
Copy link
Member

Luthaf commented Jan 20, 2026

cscs-ci run

@Luthaf
Copy link
Member

Luthaf commented Jan 20, 2026

It is apparently an internal network error, let's try again today!

@SanggyuChong
Copy link
Contributor

SanggyuChong commented Jan 20, 2026

"LLPR couldn't work with last layer features that have components (even if they are scalars)."

@pfebrer Hasn't this been fixed by Paolo's recent PR? or is this specific to MACE? (EDIT: #1004 is the PR I'm referring to)

@pfebrer
Copy link
Contributor Author

pfebrer commented Jan 20, 2026

Actually, in that PR Paolo fixed a point where it was assuming there were components (and made it work when there are no components). But the strange thing is that all the code before that assumes that there are no components 😅

@pfebrer
Copy link
Contributor Author

pfebrer commented Jan 20, 2026

cscs-ci run

Copy link
Contributor

@SanggyuChong SanggyuChong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all, many thanks @pfebrer for going ahead and figuring out these bugs. You've also done a wonderful job handling the extraction of ll feats for different scenarios.

With regards to the components, instead of erroring out we should reshape to keep the ll_feat_size and flatten out everything else. My vision here is that ultimately, performing LLPR-based UQ should closely follow how the loss function is formulated. Then, computing the covariance matrix should also simply add up all the loss terms originating from the different components, as done in most training scenarios. The UQ metrics will then be returned for each component.

If there is ever a scenario where different weights are applied to different components, we can think of responding by allowing the covariance computation routine to account for the different applied weights, but that can wait until later.

Would be best to also renamed the title given that the LLPR model is also getting modified.

self.layouts[target_name] = target_info.layout

self.last_layer_feature_size = 128

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this doesn't work with:

  1. The internal MACE head.
  2. Heads that output spherical harmonics with more than one irrep.

I think Sanggyu is working on a branch to support multiheads

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this branch I just made the internal MACE head work because it is what LLPR supported (a single head with scalar features)

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.

4 participants