Repository navigation
declearn v2.8.0
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 argumentround_reset. Concerned
OptiModules are :AdaGradModuleAdamModuleEWMAModuleMomentumModuleRMSPropModuleYogiModuleYogiMomentumModule
-
Include buffers in
TorchModel'sget_weightswhen thetrainableargument
is set toFalse(consistent behavior withTensorflowModel). 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.
- Avoid the pattern of using loggers as constructor argument. But instead
-
Add the util function
register_from_attrto 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-usedregister_typewith
more control and precise error message). -
Use the same auto-registration strategy for the
ModelandDataset
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'sgarbage_collectwith a 0-valuedmax_history.
Now, puttingmax_history=0will 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_cachedthat is external to the class.
See this ruff rule
for details on this fixed issue. -
Improve parsimony (performance, size of network messages) of
FederatedServer'sstop_training(when frozen weights), by only sending
trainable weights inStopTrainingmessage instead of all weights.
Deprecation
Removal of already-deprecated features
-
In
FederatedClient: remove possibility to use a string (path to a JSON)
fortrain_dataandvalid_dataarguments. Now, they must beDataset
instances. -
In
NetworkClient: remove deprecated argumentdata_infoof the
registermethod. -
Remove deprecated re-export :
main.privacymodule, moved todeclearn.training.dpas of Declearn
2.6.TrainingManagerinmain.utils, moved to thetrainingmodule as of
Declearn 2.6.Constraint,ConstraintSet,TimeoutConstraint; moved to
training._constraintand 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