distributed-training
Use FedML for centralized training, cross-cloud training, LLM training recipes, data/model loading, and FedMLRunner-based training workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- distributed-training
- license
- Apache 2.0
- metadata
- { "disco-role": "operating", "parent_skill": "fedml" }
- description
- Use FedML for centralized training, cross-cloud training, LLM training recipes, data/model loading, and FedMLRunner-based training workflows.
- disable-model-invocation
- true
03 SKILL.md 正文
FedML Distributed Training
Use this sub-skill for non-FL training workflows: centralized single-process training, cross-cloud client/server training, launch-driven training jobs, LLM training scripts, fedml.init, fedml.data.load, fedml.model.create, and FedMLRunner.
Do not use this for
- Federated simulation/cross-silo algorithm design: use
../federated-learning/SKILL.md. - Package building or platform launch mechanics: combine with
../launch-and-packaging/SKILL.md. - Model-serving endpoints: use
../model-serving/SKILL.md.
Training route selection
- Centralized/local training — use this when a user wants a normal Python training entry point under FedML.
- Cross-cloud training — use this with
launch-and-packagingwhen client/server code is packaged for the platform. - LLM training — use this for
python/examples/train/llm_trainpatterns; expect optional extras, GPUs, and model/data access. - Remote training job — inspect training code here, then launch with
launch-and-packaging.
Core API pattern
The canonical local training shape is:
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)
runner.run()
Adapt the training_type, backend, dataset, model, trainer, and aggregator to the selected example.
Evidence anchors
python/examples/centralized/— centralized training examples.python/examples/cross_cloud/— cross-cloud client/server package patterns.python/examples/train/llm_train/— LLM scripts, job YAML, bootstrap, DDP and DeepSpeed variants.python/fedml/runner.py—FedMLRunnerorchestration.python/fedml/data/andpython/fedml/model/— data/model factory surfaces.
Backend and safety checks
- Read
../../references/backend-matrix.mdbefore selecting CUDA, DDP, DeepSpeed, or dataset-heavy examples. - Use CPU/small-data checks first when the user asks for a quick smoke test.
- LLM training is not a quick validation route; it may require large downloads, optional extras, GPUs, and remote launch configuration.
- Multiprocessing-heavy entry points should be guarded with
if __name__ == "__main__":. - Dataset loaders may download data. Clarify network/cache constraints before running examples.
Common combinations
- Need to package a training job: read this sub-skill for code shape, then
../launch-and-packaging/SKILL.mdfor YAML/package/launch. - Need centralized training only: stay here and avoid remote platform commands.
- Need federated learning: switch to
../federated-learning/SKILL.mdunless the task is only about a shared model/data loader.
Exit criteria
A distributed-training task is complete when the training mode, backend, data/model path, launch-vs-local decision, and any GPU/network requirements are explicit, and the user has either runnable commands/code or a documented blocker.
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).