cyrusyc commited on
Commit
79e5bd9
·
1 Parent(s): 18d7cd4

restrict mace version, update eos test

Browse files
.github/workflows/test.yaml CHANGED
@@ -26,7 +26,7 @@ jobs:
26
  bash scripts/install-pyg.sh
27
  bash scripts/install-dgl.sh
28
  pip install .[test]
29
- pip install mace-torch
30
  pip install "pynanoflann@git+https://github.com/dwastberg/pynanoflann#egg=af434039ae14bedcbb838a7808924d6689274168"
31
 
32
  - name: Run tests
 
26
  bash scripts/install-pyg.sh
27
  bash scripts/install-dgl.sh
28
  pip install .[test]
29
+ pip install .[mace]
30
  pip install "pynanoflann@git+https://github.com/dwastberg/pynanoflann#egg=af434039ae14bedcbb838a7808924d6689274168"
31
 
32
  - name: Run tests
mlip_arena/models/utils.py CHANGED
@@ -47,78 +47,4 @@ def get_freer_device() -> torch.device:
47
  print("No GPU or MPS available. Using CPU.")
48
  device = torch.device("cpu")
49
 
50
- return device
51
-
52
-
53
- # class EXTMLIPEnum(Enum):
54
- # """Enumeration class for EXTMLIP models.
55
-
56
- # Attributes:
57
- # M3GNet (str): M3GNet model.
58
- # CHGNet (str): CHGNet model.
59
- # MACE (str): MACE model.
60
- # """
61
-
62
- # M3GNet = "M3GNet"
63
- # CHGNet = "CHGNet"
64
- # MACE = "MACE"
65
- # Equiformer = "Equiformer"
66
-
67
-
68
- # def get_freer_device() -> torch.device:
69
- # """Get the GPU with the most free memory.
70
-
71
- # Returns:
72
- # torch.device: The selected GPU device.
73
-
74
- # Raises:
75
- # ValueError: If no GPU is available.
76
- # """
77
- # device_count = torch.cuda.device_count()
78
- # if device_count == 0:
79
- # print("No GPU available. Using CPU.")
80
- # return torch.device("cpu")
81
-
82
- # mem_free = [
83
- # torch.cuda.get_device_properties(i).total_memory
84
- # - torch.cuda.memory_allocated(i)
85
- # for i in range(device_count)
86
- # ]
87
-
88
- # free_gpu_index = mem_free.index(max(mem_free))
89
-
90
- # print(
91
- # f"Selected GPU {free_gpu_index} with {mem_free[free_gpu_index] / 1024**2:.2f} MB free memory from {device_count} GPUs",
92
- # )
93
-
94
- # return torch.device(f"cuda:{free_gpu_index}")
95
-
96
-
97
-
98
- # def external_ase_calculator(name: EXTMLIPEnum, **kwargs: Any) -> Calculator:
99
- # """Construct an ASE calculator from an external third-party MLIP packages"""
100
- # calculator = None
101
- # device = get_freer_device()
102
-
103
- # if name == EXTMLIPEnum.MACE:
104
- # from mace.calculators import mace_mp
105
-
106
- # calculator = mace_mp(device=str(device), **kwargs)
107
-
108
- # elif name == EXTMLIPEnum.CHGNet:
109
- # from chgnet.model.dynamics import CHGNetCalculator
110
-
111
- # calculator = CHGNetCalculator(use_device=str(device), **kwargs)
112
-
113
- # elif name == EXTMLIPEnum.M3GNet:
114
- # import matgl
115
- # from matgl.ext.ase import PESCalculator
116
-
117
- # potential = matgl.load_model("M3GNet-MP-2021.2.8-PES")
118
- # calculator = PESCalculator(potential, **kwargs)
119
-
120
-
121
-
122
- # calculator.__setattr__("name", name.value)
123
-
124
- # return calculator
 
47
  print("No GPU or MPS available. Using CPU.")
48
  device = torch.device("cpu")
49
 
50
+ return device
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tests/test_eos.py CHANGED
@@ -2,7 +2,6 @@ import numpy as np
2
  from ase.build import bulk
3
 
4
  from mlip_arena.tasks.eos.run import fit as EOS
5
- from mlip_arena.models.utils import MLIPEnum
6
 
7
  atoms = bulk("Cu", "fcc", a=3.6)
8
 
 
2
  from ase.build import bulk
3
 
4
  from mlip_arena.tasks.eos.run import fit as EOS
 
5
 
6
  atoms = bulk("Cu", "fcc", a=3.6)
7