Type
Feature
Description
Framework: flwr Python framework
Component: cli, config
Discovered in: flwr Python package (framework/py/flwr/)
Related files:
framework/py/flwr/cli/flower_config.py
framework/py/flwr/cli/config_migration.py
framework/py/flwr/cli/constant.py
Summary
Since [tool.flwr.federations] in pyproject.toml was deprecated in favour of the global
~/.flwr/config.toml, there is no longer a way to configure per-project SuperLink / simulation
settings (e.g. num-supernodes, client-resources) without directly editing the shared
global config file. The legacy system implicitly supported per-project configuration; the new
system does not provide an equivalent.
Current Behavior
-
On the first flwr run, if ~/.flwr/config.toml does not exist, it is created with
hardcoded defaults:
[superlink]
default = "local"
[superlink.supergrid]
address = "<supergrid-address>"
[superlink.local]
options.num-supernodes = 10
options.backend.client-resources.num-cpus = 1
options.backend.client-resources.num-gpus = 0
-
If pyproject.toml contains a legacy [tool.flwr.federations] section, the settings are
migrated once to ~/.flwr/config.toml and the original section is commented out in
pyproject.toml with a migration notice.
-
After migration, any further edits to the (now commented-out) pyproject.toml section are
silently ignored — config.toml is never re-read from pyproject.toml.
-
All Flower projects on the same machine share the same ~/.flwr/config.toml, so changing
simulation settings for one project silently affects all others.
Steps to Reproduce
- Create two Flower apps that require different simulation settings, e.g.:
- App A needs
num-supernodes = 5, num-cpus = 2
- App B needs
num-supernodes = 50, num-cpus = 0.5
- Run
flwr run for App A — ~/.flwr/config.toml is created/used with whatever the current
global [superlink.local] settings are.
- To run App B with different settings, the user must manually edit
~/.flwr/config.toml,
remember to revert it before switching back to App A, and repeat every time.
- There is no project-local override mechanism to avoid this.
Planned Implementation
One or more of the following improvements would resolve the friction:
- Per-project config override — Support a project-local
config.toml (e.g. in the
project root) that is merged over the global
~/.flwr/config.toml, similar to how many tools support local + global config layering.
- Named connection per project — Allow
pyproject.toml to declare a preferred
SuperLink connection name (not the full connection config) so that different projects can
point to different named entries in the shared ~/.flwr/config.toml.
- CLI flag — Provide a
--config / --connection-config flag on flwr run to point to
an alternative config file for that invocation.
- Documentation — At a minimum, clearly document the recommended workflow for developers
who work on multiple projects with different simulation resource requirements.
Additional Context
- The commenting-out of
pyproject.toml after migration is misleading: it looks like the
settings were "saved", but any future edits to that section have no effect.
- The one-time migration path in
config_migration.py (_comment_out_legacy_toml_config)
effectively removes the user's only familiar touchpoint for per-project config without
providing a direct replacement.
- Relevant code paths:
init_flwr_config() (flower_config.py:153)
— only writes defaults when config.toml is absent; never syncs from pyproject.toml.
migrate() (config_migration.py:171)
— one-shot migration, called on every flwr run but no-ops once the legacy section is
gone.
DEFAULT_FLOWER_CONFIG_TOML (constant.py:103)
— hardcoded defaults written on first initialisation.
Type
Feature
Description
Framework:
flwrPython frameworkComponent:
cli,configDiscovered in:
flwrPython package (framework/py/flwr/)Related files:
framework/py/flwr/cli/flower_config.pyframework/py/flwr/cli/config_migration.pyframework/py/flwr/cli/constant.pySummary
Since
[tool.flwr.federations]inpyproject.tomlwas deprecated in favour of the global~/.flwr/config.toml, there is no longer a way to configure per-project SuperLink / simulationsettings (e.g.
num-supernodes,client-resources) without directly editing the sharedglobal config file. The legacy system implicitly supported per-project configuration; the new
system does not provide an equivalent.
Current Behavior
On the first
flwr run, if~/.flwr/config.tomldoes not exist, it is created withhardcoded defaults:
If
pyproject.tomlcontains a legacy[tool.flwr.federations]section, the settings aremigrated once to
~/.flwr/config.tomland the original section is commented out inpyproject.tomlwith a migration notice.After migration, any further edits to the (now commented-out)
pyproject.tomlsection aresilently ignored —
config.tomlis never re-read frompyproject.toml.All Flower projects on the same machine share the same
~/.flwr/config.toml, so changingsimulation settings for one project silently affects all others.
Steps to Reproduce
num-supernodes = 5,num-cpus = 2num-supernodes = 50,num-cpus = 0.5flwr runfor App A —~/.flwr/config.tomlis created/used with whatever the currentglobal
[superlink.local]settings are.~/.flwr/config.toml,remember to revert it before switching back to App A, and repeat every time.
Planned Implementation
One or more of the following improvements would resolve the friction:
config.toml(e.g. in theproject root) that is merged over the global
~/.flwr/config.toml, similar to how many tools support local + global config layering.pyproject.tomlto declare a preferredSuperLink connection name (not the full connection config) so that different projects can
point to different named entries in the shared
~/.flwr/config.toml.--config/--connection-configflag onflwr runto point toan alternative config file for that invocation.
who work on multiple projects with different simulation resource requirements.
Additional Context
pyproject.tomlafter migration is misleading: it looks like thesettings were "saved", but any future edits to that section have no effect.
config_migration.py(_comment_out_legacy_toml_config)effectively removes the user's only familiar touchpoint for per-project config without
providing a direct replacement.
init_flwr_config()(flower_config.py:153)— only writes defaults when
config.tomlis absent; never syncs frompyproject.toml.migrate()(config_migration.py:171)— one-shot migration, called on every
flwr runbut no-ops once the legacy section isgone.
DEFAULT_FLOWER_CONFIG_TOML(constant.py:103)— hardcoded defaults written on first initialisation.