Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cuEq-accelerated MACE gives error for num_interactions=1 #749

Open
lucasdekam opened this issue Dec 13, 2024 · 2 comments
Open

cuEq-accelerated MACE gives error for num_interactions=1 #749

lucasdekam opened this issue Dec 13, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@lucasdekam
Copy link

lucasdekam commented Dec 13, 2024

Hi, when running MACE (installed from source, not pip) with num_interactions=1 and enable_cueq=True I get the following error.

2024-12-13 13:07:11.655 INFO: Converting model to CUEQ for accelerated training
Traceback (most recent call last):
  File "/home/ldkam/miniconda3/envs/cueq/bin/mace_run_train", line 8, in <module>
    sys.exit(main())
  File "/home/ldkam/miniconda3/envs/cueq/lib/python3.10/site-packages/mace/cli/run_train.py", line 66, in main
    run(args)
  File "/home/ldkam/miniconda3/envs/cueq/lib/python3.10/site-packages/mace/cli/run_train.py", line 581, in run
    model = run_e3nn_to_cueq(deepcopy(model), device=device)
  File "/home/ldkam/miniconda3/envs/cueq/lib/python3.10/site-packages/mace/cli/convert_e3nn_cueq.py", line 132, in run
    config = extract_config_mace_model(source_model)
  File "/home/ldkam/miniconda3/envs/cueq/lib/python3.10/site-packages/mace/tools/scripts_utils.py", line 184, in extract_config_mace_model
    mlp_irreps = o3.Irreps(f"{model_mlp_irreps.count((0, 1)) // len(heads)}x0e")
AttributeError: 'int' object has no attribute 'count'

I think it's due to the following code in mace/tools/scripts_utils.py:

    model_mlp_irreps = (
        o3.Irreps(str(model.readouts[-1].hidden_irreps))
        if model.num_interactions.item() > 1
        else 1
    )
    mlp_irreps = o3.Irreps(f"{model_mlp_irreps.count((0, 1)) // len(heads)}x0e")

If num_interactions=1, model_mlp_irreps=1 which does not have the .count method.

@lucasdekam lucasdekam changed the title model_mlp_irreps integer for num_interactions=1 cuEq-accelerated MACE gives error for num_interactions=1 Dec 13, 2024
@ilyes319
Copy link
Contributor

ilyes319 commented Dec 16, 2024

ah yeah I totally did not have a one layer model in mind, I will solve that but that might take me a decent amount of time to get to it.

@lucasdekam
Copy link
Author

No problem, it's not urgent (with enable_cueq=False training still works).

@ilyes319 ilyes319 added the enhancement New feature or request label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants