Skip to content

Commit

Permalink
Update PR templates
Browse files Browse the repository at this point in the history
  • Loading branch information
PicoCentauri committed Jun 3, 2024
1 parent bcfd69b commit 8062006
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 7 deletions.
32 changes: 29 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_new-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,39 @@



# New architecture TODOs
# Contributor (creator of pull-request) checklist

- [ ] Add your architecture to the experimental folder
- [ ] Add your architecture to the experimental/stable folder. See the
[docs/src/dev-docs/architecture-life-cycle.rst](Architecture life cycle) document for
requirements.
`src/metatensor/models/experimental/<architecture_name>`
- [ ] Add default hyperparameter file to
`src/metatensor/models/cli/conf/architecture/experimental.<architecture_name>.yaml`
`src/metatensor/models/experimental/<architecture_name>/default-hypers.yml`
- [ ] Add a `.yml` file into github workflows `.github/workflow/<architecture_name>.yml`
- [ ] Architecture dependencies entry in the `optional-dependencies` section in the
`pyproject.toml`
- [ ] Tests: torch-scriptability, basic functionality (invariance, fitting, prediction)
- [ ] Add maintainers as codeowners in [CODEOWNERS](CODEOWNERS)

# Reviewer checklist

## New experimental architectures

- [ ] Capability to fit at least a single quantity and predict it, verified through CI
tests.
- [ ] Compatibility with JIT compilation using `TorchScript
<https://pytorch.org/docs/stable/jit.html>`_.
- [ ] Provision of reasonable default hyperparameters.
- [ ] A contact person designated as the maintainer.
- [ ] All external dependencies must be pip-installable. While not required to be on
PyPI, a public git repository or another public URL with a repository is acceptable.


## New stable architectures
- [ ] Provision of regression prediction tests with a small (not exported) checkpoint
file.
- [ ] Comprehensive architecture documentation
- [ ] If an architecture has external dependencies, all must be publicly available on
PyPI.
- [ ] Adherence to the standard output infrastructure of `metatensor-models`, including
logging and model save locations.
4 changes: 4 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Please go the the `Preview` tab and select the appropriate PR template:

* [Default template](?expand=1&template=pull_request_template.md)
* [Adding a new architecture](?expand=1&template=pull_request_new-architecture.md)
2 changes: 1 addition & 1 deletion docs/src/dev-docs/architecture-life-cycle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ removal if maintenance is no longer feasible.
architecture's internal functionality or any issues that may arise therein.

Experimental Architectures
---------------------------
--------------------------

New architectures added to the library will initially be classified as experimental.
These architectures are stored in the ``experimental`` subdirectory within the
Expand Down
16 changes: 13 additions & 3 deletions docs/src/dev-docs/new-architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ In order to follow this, a new architectures has two define two classes
evaluated and exported. This class must implement the interface documented below in
:py:class:`TrainerInterface`.

.. note::

``metatensor-models`` does not know the types and numbers of targets/datasets that
an architecture can handle. As a result, it cannot generate useful error messages
when a user attempts to train an architecture with unsupported target and dataset
combinations. Therefore, it is the responsibility of the architecture developer to
verify if the model and the trainer support the provided train_datasets and
validation_datasets passed to the Trainer, as well as the dataset_info passed to the
model.

The ``ModelInterface`` is the main model class and must implement a
``save_checkpoint()``, ``load_checkpoint()`` as well as a ``restart()`` and
``export()`` method.
Expand All @@ -57,7 +67,7 @@ The ``ModelInterface`` is the main model class and must implement a
__supported_devices__ = ["cuda", "cpu"]
__supported_dtypes__ = [torch.float64, torch.float32]
def __init__(self, model_hypers, dataset_info: DatasetInfo):
def __init__(self, model_hypers: Dict, dataset_info: DatasetInfo):
self.hypers = model_hypers
self.dataset_info = dataset_info
Expand Down Expand Up @@ -135,10 +145,10 @@ these two constants the ``__init__.py`` must contain constants for the original
:param __model__: Mapping of the custom ``ModelInterface`` to a general one to be loaded
by metatensor-models
by ``metatensor-models``.
:param __trainer__: Same as ``__MODEL_CLASS__`` but the Trainer class.
:param __authors__: Tuple denoting the original authors with email address and Github
handle of an architecture. These do not necessary be in charge of maintaining the
the architecture
the architecture.
:param __maintainers__: Tuple denoting the current maintainers of the architecture. Uses
the same style as the ``__authors__`` constant.

0 comments on commit 8062006

Please sign in to comment.