Skip to content

MACECalculator failure on xpu #1613

Description

@HannaTuerk

Describe the bug
Creating a mace calcluator on XPU currently gives the following error:
File "/python3.11/site-packages/mace/calculators/mace.py", line 256, in init    model = ipex.optimize(model)            ^^^^^^^^^^^^^^^^^^^^ File
"python3.11/site-packages/intel_extension_for_pytorch/frontend.py", line 337, in optimize    assert optimizer is not None, "The optimizer should be given for training mode"           ^^^^^^^^^^^^^^^^^^^^^AssertionError: The optimizer should be given for training mode

To Reproduce
Script to reproduce the behavior:

from mace.calculators import MACECalculator
calculator = MACECalculator(
model_paths="mace-mp-0b3-medium.model",
device='xpu',
)

Additional context
@naik-aakash suggested to add model.eval above line 262 in mace/calculators/mace.py . This fixes the calculator creaton problem and lets us successfully run structure relaxations, however we have not tested how this influences model fine-tuning.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions