From d1372cf449191b56707295e6c7d9770d30876025 Mon Sep 17 00:00:00 2001 From: t-reents Date: Thu, 16 Oct 2025 10:17:57 +0200 Subject: [PATCH 1/3] MACE: transfer atomic numbers to CPU before converting to numpy. --- torch_sim/models/mace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torch_sim/models/mace.py b/torch_sim/models/mace.py index bc367aac..5104492d 100644 --- a/torch_sim/models/mace.py +++ b/torch_sim/models/mace.py @@ -229,7 +229,7 @@ def setup_from_system_idx( # Create one-hot encodings for all atoms self.node_attrs = to_one_hot( torch.tensor( - atomic_numbers_to_indices(atomic_numbers.numpy(), z_table=self.z_table), + atomic_numbers_to_indices(atomic_numbers.cpu().numpy(), z_table=self.z_table), dtype=torch.long, device=self.device, ).unsqueeze(-1), From 27c240cae6e11e75bbeef31ff6938c3f9ee4532d Mon Sep 17 00:00:00 2001 From: t-reents Date: Thu, 16 Oct 2025 10:39:13 +0200 Subject: [PATCH 2/3] Fix linting --- torch_sim/models/mace.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/torch_sim/models/mace.py b/torch_sim/models/mace.py index 5104492d..be7b3914 100644 --- a/torch_sim/models/mace.py +++ b/torch_sim/models/mace.py @@ -229,7 +229,9 @@ def setup_from_system_idx( # Create one-hot encodings for all atoms self.node_attrs = to_one_hot( torch.tensor( - atomic_numbers_to_indices(atomic_numbers.cpu().numpy(), z_table=self.z_table), + atomic_numbers_to_indices( + atomic_numbers.cpu().numpy(), z_table=self.z_table + ), dtype=torch.long, device=self.device, ).unsqueeze(-1), From 559b99dfdcfe67e915704666efa763d348c14dc8 Mon Sep 17 00:00:00 2001 From: abhijeetgangan Date: Fri, 17 Oct 2025 13:06:11 -0700 Subject: [PATCH 3/3] Try fixing failing test for mace on mac --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a0a0c5e9..6ac1c84a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -96,6 +96,10 @@ jobs: - name: Set up uv uses: astral-sh/setup-uv@v6 + - name: Install HDF5 on macOS + if: runner.os == 'macOS' + run: brew install hdf5 + - name: Install legacy fairchem repository and dependencies if: ${{ matrix.model.name == 'fairchem-legacy' }} run: |