Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
ca05e07
Add an empty metatomic-core python package, re-exporting metatomic-torch
Luthaf May 12, 2026
70c044a
Use pathlib for all path manipulations
Luthaf May 21, 2026
15c5a60
Switch main test runner from tox to cargo
Luthaf May 12, 2026
14746e2
Scaffold a new metatomic-core package
Luthaf May 13, 2026
114625e
Draft the C API for metatomic-core
Luthaf May 27, 2026
7ab62fa
Implement PairListOptions json serialization
sofiia-chorna May 28, 2026
1b7b3de
Implement JSON serialization for `Quantity`
GardevoirX May 28, 2026
0b44828
Validate quantities names
Luthaf May 29, 2026
5c0f917
Implement JSON serialization for ModelMetadata
alessandroforina May 28, 2026
ae8ebd4
Add error handling based on metatensor
RMeli May 28, 2026
1753a2b
Implement mta_string_t in the C API
johannes-spies May 28, 2026
f946bde
Port unit parsing from metatomic-torch
Luthaf May 29, 2026
237eff8
document mta_model_t and related functions in C API
sofiia-chorna May 30, 2026
7b72efb
Add ModelCapabilities to the JSON structs
Luthaf May 31, 2026
d2a98f8
Implement plugin registration and loading, model loading
frostedoyster Jun 1, 2026
a79a644
Add a C model registration test
frostedoyster May 29, 2026
9fcb4c6
Implement System in metatomic-core
Luthaf Jun 1, 2026
1f0ef3d
Implement `mta_format_metadata`
GardevoirX Jun 3, 2026
3004765
Add unit conversion and error handling to C++
RMeli Jun 2, 2026
37dcef8
Add C++ documentation
Luthaf Jun 3, 2026
b609b74
Expose mta_model_t function in rust's Model struct
alessandroforina Jun 11, 2026
d917540
Cleanup CMake code calling cargo
Luthaf Jun 16, 2026
0ff083f
C++ API to format model metadata (#266)
RMeli Jun 23, 2026
488ec5f
Add C++ API for loading plugins
RMeli Jun 24, 2026
b0fa6ff
Re-enable Windows Rust tests
Luthaf May 28, 2026
afa36ec
Add a C API for systems
Luthaf Jun 29, 2026
1ff1453
Separate C++ and C API tests
Luthaf Jun 30, 2026
4c9d00b
Better fix to "no module named __pip__" in tests
Luthaf Jul 1, 2026
f8a8ab4
Bump MSRV to 1.88
Luthaf Jul 8, 2026
41d4a14
Update to edition 2024
Luthaf Jul 8, 2026
d0b7b25
Implement serialization for Systems
Luthaf Jul 1, 2026
d726ddb
Remove double indirection (Box + Arc) in mta_system_t
Luthaf Jul 8, 2026
7c3cd14
C++ metadata classes with JSON serialization/deserialization (#277)
RMeli Jul 8, 2026
ef0b039
Implement System in the C++ API
frostedoyster Jul 8, 2026
310cfe3
Group all code accessing values in a new `kernels` module
Luthaf Jun 29, 2026
b9c4e43
Add cuda kernels for system validation
Luthaf Jun 29, 2026
ce312f1
Add custom metal kernels for system validation
Luthaf Jun 30, 2026
b0ad08b
Cache reference values on device
Luthaf Jul 14, 2026
147dd52
Remove cargo caching in CI, it interacts badly with our setup
Luthaf Jul 15, 2026
948aed6
Use an output parameter in mta_load{_buffer}
Luthaf Jul 16, 2026
679b5ee
Refactory quantity name parsing, keep the separate components accessible
Luthaf Jul 10, 2026
aa9180a
Add function to check that Quantity match the expected layout
GardevoirX Jun 4, 2026
1637cfb
Update to metatensor-core v0.2.4
Luthaf Jul 31, 2026
dba5ec9
C++ API for custom models (#314)
RMeli Sep 8, 2026
eb2c093
Setup examples/tutorials for the C API (#313)
Luthaf Sep 8, 2026
f5b07b7
Always handle System through an Arc
Luthaf Jul 30, 2026
cbd06cb
Handle multiple devices in ReferenceValue
Luthaf Jul 30, 2026
6780b03
Add tests for cuda and metal kernels
Luthaf Sep 8, 2026
734fb45
Add a scale_inplace kernel for unit conversion
Luthaf Jul 27, 2026
2863294
Add a kernel to clone DLPack Tensors and use it to clone Systems
Luthaf Jul 27, 2026
6041ba5
Add a check_atomic_types kernel
Luthaf Jul 31, 2026
8b0d897
Implement mta_execute_model
Luthaf Aug 28, 2026
aacbc32
Remove supported_outputs from mta_model_t
Luthaf Sep 9, 2026
92a167d
Use builders for metadata objects in C++ (#319)
RMeli Sep 9, 2026
c833193
Install nlohmann_json headers in include/metatomic/third-party/
Luthaf Sep 9, 2026
ea807c9
Build the library in metatomic-core Python package
johannes-spies Sep 9, 2026
aed429b
Serialization for C++ system
lucaskloss Jul 28, 2026
c8134f3
C declaration generation for Python and minimal library loading
Luthaf Sep 9, 2026
340a192
Remap path properly for code coverage
Luthaf Sep 14, 2026
d1e6811
Implement metadata classes in Python
Luthaf Sep 14, 2026
1105ca7
C++ wrapper for mta_execute_model
RMeli Sep 15, 2026
ed4e805
Add more status code that can be used by models
Luthaf Sep 15, 2026
96d2432
C API tutorials for custom models and plugins (#320)
EricBoittier Sep 17, 2026
f8e8828
Pass through exceptions in the C++ bindings
RMeli Sep 22, 2026
3856716
API to define plugins in C++
RMeli Sep 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 138 additions & 11 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,79 @@ concurrency:


jobs:
build-core-wheels:
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
strategy:
matrix:
include:
- name: x86_64 Linux
os: ubuntu-24.04
rust-target: x86_64-unknown-linux-gnu
cibw-arch: x86_64
- name: arm64 Linux
os: ubuntu-24.04-arm
rust-target: aarch64-unknown-linux-gnu
cibw-arch: aarch64
- name: arm64 macOS
os: macos-15
rust-target: aarch64-apple-darwin
cibw-arch: arm64
- name: x86_64 Windows
os: windows-2022
rust-target: x86_64-pc-windows-msvc
cibw-arch: AMD64
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0

- name: setup rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: ${{ matrix.rust-target }}

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"

- name: install dependencies
run: python -m pip install cibuildwheel twine

- name: build custom manylinux docker images
if: matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-24.04-arm'
run: |
docker buildx build \
-t rustc-manylinux_2_28_${{ matrix.cibw-arch }} \
python/scripts/rustc-manylinux_2_28_${{ matrix.cibw-arch }}

- name: build metatomic-core wheel
run: python -m cibuildwheel python/metatomic_core
env:
CIBW_BUILD: cp311-*
CIBW_SKIP: "*musllinux*"
CIBW_ARCHS: ${{ matrix.cibw-arch }}
CIBW_BUILD_VERBOSITY: 1
CIBW_MANYLINUX_X86_64_IMAGE: rustc-manylinux_2_28_x86_64
CIBW_MANYLINUX_AARCH64_IMAGE: rustc-manylinux_2_28_aarch64
CIBW_ENVIRONMENT: >
MACOSX_DEPLOYMENT_TARGET=11
# do not complain for missing shared libraries provided by other packages
CIBW_REPAIR_WHEEL_COMMAND_MACOS: |
delocate-wheel --ignore-missing-dependencies --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
CIBW_REPAIR_WHEEL_COMMAND_LINUX: |
auditwheel repair --exclude libmetatensor.so -w {dest_dir} {wheel}

- name: check wheels with twine
run: twine check wheelhouse/*.whl

- uses: actions/upload-artifact@v7
with:
name: core-wheel-${{ matrix.os }}-${{ matrix.cibw-arch }}
path: ./wheelhouse/*.whl

build-torch-wheels:
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }} (torch v${{ matrix.torch-version }})
Expand Down Expand Up @@ -89,8 +162,8 @@ jobs:
if: matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-24.04-arm'
run: |
docker buildx build \
-t gcc11-manylinux_2_28_${{ matrix.cibw-arch }} \
python/scripts/gcc11-manylinux_2_28_${{ matrix.cibw-arch }}
-t rustc-manylinux_2_28_${{ matrix.cibw-arch }} \
python/scripts/rustc-manylinux_2_28_${{ matrix.cibw-arch }}

- name: build metatomic-torch wheel
run: python -m cibuildwheel python/metatomic_torch
Expand All @@ -99,10 +172,19 @@ jobs:
CIBW_SKIP: "*musllinux*"
CIBW_ARCHS: ${{ matrix.cibw-arch }}
CIBW_BUILD_VERBOSITY: 1
CIBW_MANYLINUX_X86_64_IMAGE: gcc11-manylinux_2_28_x86_64
CIBW_MANYLINUX_AARCH64_IMAGE: gcc11-manylinux_2_28_aarch64
CIBW_MANYLINUX_X86_64_IMAGE: rustc-manylinux_2_28_x86_64
CIBW_MANYLINUX_AARCH64_IMAGE: rustc-manylinux_2_28_aarch64
# METATOMIC_NO_LOCAL_DEPS is set to 1 when building a tag of
# metatomic-torch, which will force to use the version of
# metatomic-core already released on PyPI. Otherwise, this will use
# the version of metatomic-core from git checkout (in case there are
# unreleased breaking changes).
#
# This means that when releasing a breaking change in metatomic-core,
# the full release should be available on PyPI before pushing the new
# metatomic-torch tag.
CIBW_ENVIRONMENT: >
METATOMIC_NO_LOCAL_DEPS=1
METATOMIC_NO_LOCAL_DEPS=${{ startsWith(github.ref, 'refs/tags/metatomic-torch-v') && '1' || '0' }}
METATOMIC_TORCH_BUILD_WITH_TORCH_VERSION=${{ matrix.torch-version }}.*
PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cpu
MACOSX_DEPLOYMENT_TARGET=11
Expand Down Expand Up @@ -205,6 +287,9 @@ jobs:
- name: install dependencies
run: python -m pip install wheel build twine

- name: build metatomic-core sdist
run: python -m build python/metatomic_core --sdist --outdir=dist/

- name: build metatomic-torch sdist
run: python -m build python/metatomic_torch --sdist --outdir=dist/

Expand All @@ -222,6 +307,7 @@ jobs:

- name: create C++ tarballs
run: |
./scripts/package-core.sh dist/cxx/
./scripts/package-torch.sh dist/cxx/

- uses: actions/upload-artifact@v7
Expand All @@ -234,12 +320,19 @@ jobs:

merge-and-release:
name: Merge and release wheels/sdists
needs: [merge-torch-wheels, build-others]
needs: [build-core-wheels, merge-torch-wheels, build-others]
runs-on: ubuntu-24.04
permissions:
contents: write
pull-requests: write
steps:
- name: Download metatomic-core wheels
uses: actions/download-artifact@v8
with:
path: wheels
pattern: core-wheel-*
merge-multiple: true

- name: Download metatomic-torch wheels
uses: actions/download-artifact@v8
with:
Expand Down Expand Up @@ -268,6 +361,17 @@ jobs:
name: wheels
description: 鈿欙笍 Download Python wheels for this pull-request (you can install these with pip)

- name: upload to GitHub release (metatomic-core)
if: startsWith(github.ref, 'refs/tags/metatomic-core-v')
uses: softprops/action-gh-release@v3
with:
files: |
wheels/cxx/metatomic-core-cxx-*.tar.gz
wheels/metatomic_core-*
prerelease: ${{ contains(github.ref, '-rc') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: upload to GitHub release (metatomic)
if: startsWith(github.ref, 'refs/tags/metatomic-v')
uses: softprops/action-gh-release@v3
Expand Down Expand Up @@ -311,8 +415,8 @@ jobs:

test-build-external:
# This checks building the wheels with external libraries. This setup is
# mainly used for the conda packages metatensor-*-python, which use the
# libmetatensor-* conda packages to provide the native code.
# mainly used for the conda packages metatomic-*-python, which use the
# libmetatomic-* conda packages to provide the native code.
runs-on: ${{ matrix.os }}
name: External libraries / ${{ matrix.os }}
defaults:
Expand All @@ -338,6 +442,12 @@ jobs:
with:
fetch-depth: 0

- name: setup rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: ${{ matrix.rust-target }}

- name: setup Python
uses: actions/setup-python@v7
with:
Expand All @@ -356,9 +466,9 @@ jobs:

- name: setup libmetatensor
run: |
curl --location -O https://github.com/metatensor/metatensor/releases/download/metatensor-core-v0.2.3/metatensor-core-cxx-0.2.3.tar.gz
tar xf metatensor-core-cxx-0.2.3.tar.gz
cmake -B build-metatensor -S metatensor-core-cxx-0.2.3 \
curl --location -O https://github.com/metatensor/metatensor/releases/download/metatensor-core-v0.2.4/metatensor-core-cxx-0.2.4.tar.gz
tar xf metatensor-core-cxx-0.2.4.tar.gz
cmake -B build-metatensor -S metatensor-core-cxx-0.2.4 \
-DMETATENSOR_INSTALL_BOTH_STATIC_SHARED=OFF \
-DCMAKE_INSTALL_PREFIX=$CMAKE_PREFIX_PATH \
-DCMAKE_BUILD_TYPE=Debug
Expand All @@ -375,6 +485,15 @@ jobs:
cmake --build build-metatensor-torch --config Debug
cmake --install build-metatensor-torch --config Debug

- name: build libmetatomic
run: |
cmake -B build-metatomic-core -S metatomic-core \
-DMETATOMIC_INSTALL_BOTH_STATIC_SHARED=OFF \
-DCMAKE_INSTALL_PREFIX=$CMAKE_PREFIX_PATH \
-DCMAKE_BUILD_TYPE=Debug
cmake --build build-metatomic-core --config Debug
cmake --install build-metatomic-core --config Debug

- name: build libmetatomic-torch
run: |
cmake -B build-metatomic-torch -S metatomic-torch \
Expand All @@ -383,6 +502,14 @@ jobs:
cmake --build build-metatomic-torch --config Debug
cmake --install build-metatomic-torch --config Debug

- name: build metatomic-core wheels
run: |
python -m build python/metatomic_core --wheel --outdir=dist/
# check that the wheel is using an external library
unzip -l dist/metatomic_core*.whl | grep "_external.py"
env:
METATOMIC_CORE_PYTHON_USE_EXTERNAL_LIB: "ON"

- name: build metatomic-torch wheels
run: |
pip install build
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Python tests

on:
push:
branches: [main]
pull_request:
# Check all PR

concurrency:
group: python-tests-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
python-tests:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} / Python ${{ matrix.python-version }} / Torch ${{ matrix.torch-version }}
strategy:
matrix:
include:
- os: ubuntu-24.04
python-version: "3.11"
torch-version: "2.3"
numpy-version-pin: "<2.0"
- os: ubuntu-24.04
python-version: "3.11"
torch-version: "2.13"
- os: ubuntu-24.04
# TorchScript is no longer supported in Python 3.14
# so we keep a test with 3.13 to make sure this doesn't break
python-version: "3.13"
torch-version: "2.13"
- os: ubuntu-24.04
python-version: "3.14"
torch-version: "2.13"
- os: macos-15
Comment thread
RMeli marked this conversation as resolved.
python-version: "3.14"
torch-version: "2.13"
- os: windows-2022
Comment thread
RMeli marked this conversation as resolved.
python-version: "3.14"
torch-version: "2.13"
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0

- name: setup Python
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

- name: setup rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: Setup sccache
if: ${{ !env.ACT }}
uses: mozilla-actions/sccache-action@v0.0.10
with:
version: "v0.10.0"
Comment thread
RMeli marked this conversation as resolved.

- name: setup MSVC command prompt
uses: ilammy/msvc-dev-cmd@v1

- name: Setup sccache environnement variables
if: ${{ !env.ACT }}
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV

- name: install tests dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox coverage

- name: run tests
run: tox -e lint,core-tests,torch-tests,docs-tests
env:
PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu
METATOMIC_TESTS_TORCH_VERSION: ${{ matrix.torch-version }}

- name: combine Python coverage files
shell: bash
run: |
coverage combine .tox/*/.coverage
coverage xml

- name: upload to codecov.io
uses: codecov/codecov-action@v7
with:
fail_ci_if_error: true
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
Loading
Loading