Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Flower Framework
Light Logo Dark Logo
main

教程

  • 什么是联邦学习?
  • 开始使用Flower
  • 使用联邦学习策略
  • Customize a Flower Strategy
  • Communicate custom Messages
  • 快速入门教程
    • PyTorch快速入门
    • 快速入门 TensorFlow
    • Quickstart MLX
    • 🤗 Transformers快速入门
    • 快速入门 JAX
    • 快速入门Pandas
    • 快速入门 fastai
    • 快速入门 PyTorch Lightning
    • scikit-learn快速入门
    • XGBoost快速入门
    • 快速入门 Android
    • 快速入门 iOS

How-to Guides

  • Build
    • 安装Flower
    • Configure pyproject.toml
    • Configure a ClientApp
    • Design stateful ClientApps
    • 使用策略
    • 实施策略
    • 整合评估结果
    • Save and load model checkpoints
    • Use Built-in Mods
    • Use Differential Privacy
    • Implement FedBN
    • Use CLI JSON output
    • OpenFL Migration Guide
    • 升级至 Flower 1.0
    • Upgrade to Flower 1.13
    • Upgrade to Message API
  • Simulate
    • Run Flower Locally with a Managed SuperLink
    • 运行模拟
  • Deploy
    • Run Flower with the Deployment Runtime
    • Enable TLS connections
    • Authenticate SuperNodes
    • Configure logging
    • Run Flower on GCP
    • Run Flower on Azure
    • Run Flower on Red Hat OpenShift
    • Run Flower on Multiple OpenShift Clusters
    • Authenticate Accounts via OpenID Connect
    • Configure Audit Logging
    • Manage Flower Federations
    • Run Flower using Docker
      • Quickstart with Docker
      • Enable TLS for Secure Connections
      • Persist the State of the SuperLink
      • Set Environment Variables
      • Run with Root User Privileges
      • Run ServerApp or ClientApp as a Subprocess
      • Pin a Docker Image to a Specific Version
      • Use a Different Flower Version
      • Quickstart with Docker Compose
      • Run Flower Quickstart Examples with Docker Compose
      • Deploy Flower on Multiple Machines with Docker Compose
    • Run Flower using Helm
      • Deploy SuperLink
      • Deploy SuperNode

说明

  • 联邦学习评估
  • 差分隐私
  • 安全聚合协议
  • Flower的架构
  • Flower Strategy Abstraction

参考资料

  • Reference
    • flwr
      • app
        • Array
        • ArrayRecord
        • ConfigRecord
        • Context
        • Error
        • Message
        • MessageType
        • 描述数据
        • MetricRecord
        • RecordDict
        • UserConfig
      • clientapp
        • ClientApp
        • mod
          • adaptiveclipping_mod
          • arrays_size_mod
          • fixedclipping_mod
          • message_size_mod
          • LocalDpMod
      • serverapp
        • Grid
        • ServerApp
        • strategy
          • Bulyan
          • DifferentialPrivacyClientSideAdaptiveClipping
          • DifferentialPrivacyClientSideFixedClipping
          • DifferentialPrivacyServerSideAdaptiveClipping
          • DifferentialPrivacyServerSideFixedClipping
          • FedAdagrad
          • FedAdam
          • FedAvg
          • FedAvgM
          • FedMedian
          • FedProx
          • FedTrimmedAvg
          • FedXgbBagging
          • FedXgbCyclic
          • FedYogi
          • Krum
          • MultiKrum
          • QFedAvg
          • Result
          • Strategy
    • Flower CLI 参考
    • Flower Configuration
    • 项目实例
    • 遥测功能
    • 更新日志
    • Flower Runtime Comparison
    • Flower Network Communication
    • Exit Codes
      • [0] SUCCESS
      • [1] GRACEFUL_EXIT_SIGINT
      • [100] SUPERLINK_THREAD_CRASH
      • [101] SUPERLINK_LICENSE_INVALID
      • [102] SUPERLINK_LICENSE_MISSING
      • [103] SUPERLINK_LICENSE_URL_INVALID
      • [104] SUPERLINK_INVALID_ARGS
      • [105] SUPERLINK_DATABASE_SCHEMA_MISMATCH
      • [2] GRACEFUL_EXIT_SIGQUIT
      • [200] SERVERAPP_STRATEGY_PRECONDITION_UNMET
      • [201] SERVERAPP_EXCEPTION
      • [202] SERVERAPP_STRATEGY_AGGREGATION_ERROR
      • [203] SERVERAPP_RUN_START_REJECTED
      • [3] GRACEFUL_EXIT_SIGTERM
      • [300] SUPERNODE_REST_ADDRESS_INVALID
      • [302] SUPERNODE_NODE_AUTH_KEY_INVALID
      • [303] SUPERNODE_STARTED_WITHOUT_TLS_BUT_NODE_AUTH_ENABLED
      • [304] SUPERNODE_INVALID_TRUSTED_ENTITIES
      • [400] SUPEREXEC_INVALID_PLUGIN_CONFIG
      • [500] FLWRCLI_NODE_AUTH_PUBLIC_KEY_INVALID
      • [600] COMMON_ADDRESS_INVALID
      • [601] COMMON_MISSING_EXTRA_REST
      • [602] COMMON_TLS_NOT_SUPPORTED
      • [700] SIMULATION_EXCEPTION
      • [701] SIMULATION_MISSING_EXTRA
    • 常见问题

贡献者文档

  • Contribute
    • 在 GitHub 上投稿
    • 成为贡献者
    • 安装开发版本
    • 建立虚拟环境
    • 使用 VSCode Dev Containers 进行开发
    • 编写文件
    • 发布 Flower
    • 贡献译文
    • How to Build Docker Flower Images Locally
    • Migrate Flower Database Schema
    • Public and private APIs
    • 首次代码贡献
  • main
🇬🇧 🇫🇷 🇨🇳 🇰🇷
Back to top
View this page

Run Flower Locally with a Managed SuperLink¶

When you use a local profile in the Flower configuration with options.* and no explicit address, flwr does not call the simulation runtime directly. Instead, Flower starts a managed local flower-superlink on demand, submits the run through the Control API, and the local SuperLink executes the run with the simulation runtime.

This is the default experience for a profile like the one created automatically in your Flower configuration:

[superlink.local]
options.num-supernodes = 10
options.backend.client-resources.num-cpus = 1
options.backend.client-resources.num-gpus = 0

If FLWR_HOME is unset, Flower stores this managed local runtime under $HOME/.flwr/local-superlink.

What Flower starts for you¶

On the first command that needs the local Control API, Flower starts a local flower-superlink process automatically. That process:

  • listens on 127.0.0.1:39093 for the Control API

  • listens on 127.0.0.1:39094 for SimulationIO

  • keeps running in the background after your command finishes

  • is reused by later flwr run, flwr list, flwr log, and flwr stop commands

You can override those default ports with the environment variables FLWR_LOCAL_CONTROL_API_PORT and FLWR_LOCAL_SIMULATIONIO_API_PORT.

Submit a run¶

From your Flower App directory, submit a run as usual:

$ flwr run .

Representative output:

Successfully built flwrlabs.myapp.1-0-0.014c8eb3.fab
Starting local SuperLink on 127.0.0.1:39093...
Successfully started run 1859953118041441032

Plain flwr run . submits the run, prints the run ID, and returns. If you want to submit the run and immediately follow the logs in the same terminal, use:

$ flwr run . --stream

List runs¶

To see all runs known to the local SuperLink:

$ flwr list

To inspect one run in detail:

$ flwr list --run-id 1859953118041441032

View logs¶

To stream logs continuously:

$ flwr log 1859953118041441032 --stream

To fetch the currently available logs once and return:

$ flwr log 1859953118041441032 --show

Representative streamed output:

INFO :      Starting FedAvg strategy:
INFO :          Number of rounds: 3
INFO :      [ROUND 1/3]
INFO :      configure_train: Sampled 5 nodes (out of 10)
INFO :      aggregate_train: Received 5 results and 0 failures
...

Stop a run¶

To stop a submitted or running run:

$ flwr stop 1859953118041441032

This stops the run only. It does not stop the background local SuperLink process.

Local runtime files and state¶

The managed local SuperLink keeps its files in $FLWR_HOME/local-superlink/:

  • state.db stores the local SuperLink state

  • ffs/ stores SuperLink file artifacts

  • superlink.log stores the local SuperLink process output

These files persist across local runs until you remove them yourself.

Stop the background local SuperLink¶

There is currently no dedicated flwr command to stop the managed local SuperLink process. To stop it, first inspect the matching process and then terminate it.

macOS/Linux¶

Inspect the process:

$ ps aux | grep '[f]lower-superlink.*--control-api-address 127.0.0.1:39093'

Stop the process:

$ pkill -f 'flower-superlink.*--control-api-address 127.0.0.1:39093'

Windows PowerShell¶

Inspect the process:

PS> Get-CimInstance Win32_Process |
>>   Where-Object {
>>     $_.CommandLine -like '*flower-superlink*--control-api-address 127.0.0.1:39093*'
>>   } |
>>   Select-Object ProcessId, CommandLine

Stop the process:

PS> Get-CimInstance Win32_Process |
>>   Where-Object {
>>     $_.CommandLine -like '*flower-superlink*--control-api-address 127.0.0.1:39093*'
>>   } |
>>   ForEach-Object { Stop-Process -Id $_.ProcessId }

If you changed the local Control API port with FLWR_LOCAL_CONTROL_API_PORT, replace 39093 in the commands above.

Troubleshooting¶

If a local run fails before it starts, or if the managed local SuperLink does not come up correctly, inspect:

$FLWR_HOME/local-superlink/superlink.log

That log contains the output of the background flower-superlink process and is the first place to check for startup errors, port conflicts, or runtime failures.

Next
运行模拟
Previous
Simulate using the Flower Simulation Runtime
Copyright © 2026 Flower Labs GmbH
Made with Sphinx and @pradyunsg's Furo
On this page
  • Run Flower Locally with a Managed SuperLink
    • What Flower starts for you
    • Submit a run
    • List runs
    • View logs
    • Stop a run
    • Local runtime files and state
    • Stop the background local SuperLink
      • macOS/Linux
      • Windows PowerShell
    • Troubleshooting