From ad8f0f73ad1f5276603cd1a69171750999066c5f Mon Sep 17 00:00:00 2001 From: Arslan Mazitov Date: Tue, 29 Apr 2025 18:29:42 +0200 Subject: [PATCH 1/4] Updated versions to PET-MAD v1.1.0rc4 --- examples/pet-mad/environment.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/pet-mad/environment.yml b/examples/pet-mad/environment.yml index cdde3320..994be8dc 100644 --- a/examples/pet-mad/environment.yml +++ b/examples/pet-mad/environment.yml @@ -3,10 +3,8 @@ channels: - conda-forge dependencies: - python=3.12 - - lammps-metatensor=*=cpu*nompi* - - libtorch=*=cpu*mkl* - - pet-mad - - python-metatensor-torch=0.7.6 + - lammps-metatensor=2025.02.04.mts0=cpu_hb5fed64_nompi_git.ce972db_0 + - pet-mad=1.1.0rc4=pyhb0d71a2_0 - pip - pip: - ase From 0ceb05bb818c349266d6e31049af181d234f1377 Mon Sep 17 00:00:00 2001 From: Michele Ceriotti Date: Tue, 29 Apr 2025 23:03:54 +0200 Subject: [PATCH 2/4] Explicit pinning not working on Linux it seems --- examples/pet-mad/environment.yml | 4 ++-- examples/pet-mad/pet-mad.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/pet-mad/environment.yml b/examples/pet-mad/environment.yml index 994be8dc..8b456cc9 100644 --- a/examples/pet-mad/environment.yml +++ b/examples/pet-mad/environment.yml @@ -3,8 +3,8 @@ channels: - conda-forge dependencies: - python=3.12 - - lammps-metatensor=2025.02.04.mts0=cpu_hb5fed64_nompi_git.ce972db_0 - - pet-mad=1.1.0rc4=pyhb0d71a2_0 + - lammps-metatensor=*=cpu*nompi* + - pet-mad - pip - pip: - ase diff --git a/examples/pet-mad/pet-mad.py b/examples/pet-mad/pet-mad.py index f69645c8..1601f92f 100644 --- a/examples/pet-mad/pet-mad.py +++ b/examples/pet-mad/pet-mad.py @@ -391,7 +391,7 @@ # original Python or C++ source code. In particular, this is necessary for # the LAMMPS interface to work because it has no access to the Python code. -calculator.model.save("pet-mad-latest.pt", collect_extensions="extensions") +calculator.model.save("pet-mad-latest.pt") # %% From 40cd354d2e3758d46d1359501fafad0f8d2743f0 Mon Sep 17 00:00:00 2001 From: Michele Ceriotti Date: Wed, 30 Apr 2025 07:49:02 +0200 Subject: [PATCH 3/4] Changed the order of export to avoid weird bug --- examples/pet-mad/pet-mad.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/examples/pet-mad/pet-mad.py b/examples/pet-mad/pet-mad.py index 1601f92f..829f5dfb 100644 --- a/examples/pet-mad/pet-mad.py +++ b/examples/pet-mad/pet-mad.py @@ -140,6 +140,13 @@ calculator = PETMADCalculator(version="latest", device="cpu") +# %% +# +# The model can also be exported in a format that can be used with +# external MD engines. This is done by saving the model to a file, +# which includes the model architecture and weights. + +calculator.model.save("pet-mad-latest.pt") # %% # @@ -380,19 +387,6 @@ # without having to introduce vacancies or wait for the # very long time scale needed for diffusion. -# %% -# -# Before starting the simulations with MD engines, it is important -# to export the model to a format that can be used by the engine. -# This is done by saving the model to a file, which includes the -# model weights and the compiled extensions. We use the ``collect_extensions`` -# argument to save the compiled extensions to disk. These extensions ensure that -# the model remains self-contained and can be executed without requiring the -# original Python or C++ source code. In particular, this is necessary for -# the LAMMPS interface to work because it has no access to the Python code. - -calculator.model.save("pet-mad-latest.pt") - # %% # From a77c770af16245ebe6ab6ad418ec6d646f5da0da Mon Sep 17 00:00:00 2001 From: Michele Ceriotti Date: Wed, 30 Apr 2025 08:37:29 +0200 Subject: [PATCH 4/4] Fix (?) periodic hamiltonian --- examples/periodic-hamiltonian/environment.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/examples/periodic-hamiltonian/environment.yml b/examples/periodic-hamiltonian/environment.yml index 65d4ea5c..10ac49e4 100644 --- a/examples/periodic-hamiltonian/environment.yml +++ b/examples/periodic-hamiltonian/environment.yml @@ -11,13 +11,7 @@ dependencies: - ase==3.22.1 - seekpath - requests - - metatensor - - metatensor-core - - metatensor-learn - - metatensor-operations - - metatensor-torch - - --extra-index-url https://download.pytorch.org/whl/cpu - - rascaline-torch @ git+https://github.com/luthaf/rascaline@3450bc4d609aee87ab73648b059536baa97d15ac#subdirectory=python/rascaline-torch + - --extra-index-url https://download.pytorch.org/whl/cpu - lightning - xitorch - keras_core