federated-learning
Use FedML for federated-learning simulation, cross-silo/cross-device/cross-cloud roles, algorithm flows, and privacy/security/analytics variants.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- federated-learning
- license
- Apache 2.0
- metadata
- { "disco-role": "operating", "parent_skill": "fedml" }
- description
- Use FedML for federated-learning simulation, cross-silo/cross-device/cross-cloud roles, algorithm flows, and privacy/security/analytics variants.
- disable-model-invocation
- true
02 资源文件 1
03 SKILL.md 正文
FedML Federated Learning
Use this sub-skill for FedML federated-learning workflows: single-process simulation, MPI/NCCL simulation, cross-silo roles, cross-device/cross-cloud roles, algorithm-flow APIs, and advanced privacy/security/federated-analytics examples.
Do not use this for
- Ordinary centralized or cross-cloud non-FL training: use
../distributed-training/SKILL.md. - Package building or launch submission details: combine with
../launch-and-packaging/SKILL.md. - Android or IoT clients: those stacks were excluded from verified runtime coverage.
Mode selection
| User task | Preferred route |
|---|---|
| quick local FL example | single-process simulation (backend='sp') |
| multi-process local simulation | MPI only after host MPI and mpi4py are verified |
| GPU/multi-process simulation | NCCL only after CUDA/NCCL/process launch are verified |
| cross-silo server/client job | cross-silo role-specific entry points plus launch/package guidance |
| privacy/security/analytics variant | start from the corresponding python/examples/federate/* reference and keep compute/data constraints explicit |
Core API pattern
import fedml
args = fedml.load_arguments(training_type="simulation", comm_backend="sp")
args = fedml.init(args)
device = fedml.device.get_device(args)
dataset, output_dim = fedml.data.load(args)
model = fedml.model.create(args, output_dim)
runner = fedml.FedMLRunner(args, device, dataset, model, client_trainer=..., server_aggregator=...)
runner.run()
Use sp for a first smoke unless the task explicitly requires MPI or NCCL.
Algorithm-flow helper
For a local structural check of FedML's algorithm-flow API without datasets or backend services, run from the root skill directory:
python sub-skills/federated-learning/scripts/local_algorithm_flow_smoke.py
This does not prove full training convergence; it proves a local executor/flow pattern and is safe offline.
Evidence anchors
python/examples/federate/quick_start/parrot/— quick-start SP simulation examples.python/examples/federate/flow/fedavg/— algorithm-flow pattern.python/examples/federate/quick_start/octopus/andbeehive/— cross-silo package examples.python/examples/federate/security/,privacy/,federated_analytics/— advanced variants.python/tests/smoke_test/simulation_mpi/— MPI smoke reference only; MPI was not verified in the prep environment.
Backend cautions
- MPI is optional/unverified unless the target environment has
mpirunandmpi4py. - NCCL requires a compatible GPU/CUDA/NCCL and multi-process launch setup.
- Cross-silo/cross-cloud workflows need consistent YAML, server/client roles, backend env, and often API credentials.
- Do not run host-mutating MPI setup scripts automatically.
Exit criteria
A federated-learning task is complete when the FL mode, backend, role split, data/model assumptions, and launch-vs-local decision are explicit, and any unverified MPI/NCCL/credential requirements are recorded rather than implied.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).