Skip to content

declearn v2.8.0

Choose a tag to compare

@symdec symdec released this 11 Mar 10:57
· 217 commits to develop since this release
943ce1c

declearn v2.8.0

Released: 11/03/2026

Release Highlights

Major changes

Client Sampling

Add client sampling abstractions, and integrate it in the
FederatedServer (as optionnal argument).

Client sampling enables to have only a subset of clients participate at each
training round.
It adds a new API to do so, and an implementation of some basic rules, both
simple (e.g. uniform sampling) and complex (select the best clients w.r.t.
criterion / scoring functions, such as training runtime or gradient norm).
These rules are made expandable by end-users.
New rules may be added in the future based on user feedback.

A dedicated
guide on client sampling features was added
to the documentation. That is the advised entry-point for people interested
in getting around these new features.

New usage example : Declearn deployment on Grid5000

Add an example on how to run a Declearn experiment on MNIST dataset, deployed
on the cloud environment Grid5000. This example is added in
examples/mnist_g5k/.
The example is made to be easily adaptable in terms of deployment settings
(number and location of Grid5000 machines).
See this folder readme.md for details.

Minor changes

  • In Optimizer, add a way to define a routine triggered at each round start
    for OptiModules (the mechanism already existed for Schedulers and
    Regularizers).

  • For stateful OptiModules, add the possibility to reset their internal states
    at round start, with an initializer argument round_reset. Concerned
    OptiModules are :

    • AdaGradModule
    • AdamModule
    • EWMAModule
    • MomentumModule
    • RMSPropModule
    • YogiModule
    • YogiMomentumModule
  • Include buffers in TorchModel's get_weights when the trainable argument
    is set to False (consistent behavior with TensorflowModel). In previous
    Declearn versions, buffers (parameters not trained by SGD), were ignored and
    cannot be retrieved, now they are considered as non-trainable parameters (like
    frozen weights).

  • Rework of the logging system :

    • Avoid the pattern of using loggers as constructor argument. But instead
      have a logger per class when singleton (ex: server classes), and one logger
      per instance otherwise (ex: one per client), with pre-determined names.
    • Update the logging system for all classes previously concerned by a
      logger.
    • Prefix all loggers by "declearn." to allow hierarchical logging (and
      configuration).
    • Add logging util functions to easily configure server/client loggers, or
      any logger by its name.
  • Add the util function register_from_attr to better control type
    auto-registration from a class attribute value.

  • Use this util in all classes that auto-registered their subclasses in an
    __init_subclass__ method (wrapping the previously-used register_type with
    more control and precise error message).

  • Use the same auto-registration strategy for the Model and Dataset
    subclasses (previously, they were manually decorated with @type_register).

  • Pretiffy and add minor features to the public Declearn documentation webpage
    (via mkdocs configuration changes).

  • Typos, lint fixes and minor docstring changes.

Bug and performance fixes

  • Fix bug in Checkpointer's garbage_collect with a 0-valued max_history.
    Now, putting max_history=0 will induce no checkpoint.

  • Prevent memory leaks on lru_cache in TorchModel's
    _build_samplewise_grads_fn, by moving the caching from the instance method to
    a function _build_samplewise_grads_fn_cached that is external to the class.
    See this ruff rule
    for details on this fixed issue.

  • Improve parsimony (performance, size of network messages) of
    FederatedServer's stop_training (when frozen weights), by only sending
    trainable weights in StopTraining message instead of all weights.

Deprecation

Removal of already-deprecated features

  • In FederatedClient : remove possibility to use a string (path to a JSON)
    for train_data and valid_data arguments. Now, they must be Dataset
    instances.

  • In NetworkClient : remove deprecated argument data_info of the
    register method.

  • Remove deprecated re-export :

    • main.privacy module, moved to declearn.training.dp as of Declearn
      2.6.
    • TrainingManager in main.utils, moved to the training module as of
      Declearn 2.6.
    • Constraint, ConstraintSet, TimeoutConstraint ; moved to
      training._constraint and thus made private.

New deprecation

Previous logging system artifacts : deprecate util function get_logger, and
the majority of logger arguments (exception for TrainingManager), will be
removed in Declearn 2.10.

GitLab release : https://gitlab.inria.fr/magnet/declearn/declearn2/-/releases/v2.8.0