training-finetuning
Create, inspect, adapt, and troubleshoot LLM Foundry pretraining and fine-tuning Composer YAMLs.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- training-finetuning
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Create, inspect, adapt, and troubleshoot LLM Foundry pretraining and fine-tuning Composer YAMLs.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/checkpointing-and-callbacks.md7.0 KB
- 参考文档references/configuration-reference.md13.5 KB
- 参考文档references/troubleshooting.md9.3 KB
- 参考文档references/workflows.md9.1 KB
- 脚本scripts/llmfoundry_config_probe.py20.2 KB
03 SKILL.md 正文
LLM Foundry training-finetuning
Use this sub-skill when a task involves LLM Foundry training configuration, launch commands, YAML overrides, pretraining, supervised or instruction fine-tuning, domain adaptation, sequence-length adaptation, checkpointing, resumption, training callbacks/loggers/optimizers/schedulers, or bounded smoke runs.
Start here
- Identify the requested workflow:
- pretraining or continued pretraining/domain adaptation with a
textMDS loader; - supervised/instruction fine-tuning with a
finetuningloader; - a CPU smoke run that should be tiny and local;
- a GPU, multi-GPU, or multi-node scaling adaptation;
- checkpoint save/load/autoresume, callback/logger, optimizer/scheduler, or run-stability troubleshooting.
- pretraining or continued pretraining/domain adaptation with a
- Read references/workflows.md for command patterns, override syntax, CPU/GPU scaling, MDS data paths, and MCLI/platform adaptation.
- Read references/configuration-reference.md when creating or reviewing a training YAML. It maps required
TrainConfigfields, common optional fields, dataloaders, model/tokenizer/optimizer/scheduler sections, evaluation hooks, FSDP/TP, precision, and batch-size fields. - Read references/checkpointing-and-callbacks.md for save/load/autoresume, checkpoint naming, HF checkpoint callbacks, run monitors, loggers, optimizers, and schedulers.
- Read references/troubleshooting.md when launch, data, tokenizer/model, optional dependency, memory, FSDP/TP, or checkpoint upload errors appear.
- Before launching a long run, run the safe bundled probe:
python scripts/llmfoundry_config_probe.py <config.yaml> \
variables.data_local=<data-local> \
train_loader.dataset.split=train_small \
max_duration=2ba
The probe only parses the YAML and override strings. It does not train, download models or data, initialize distributed state, or write checkpoints. Diagnostic flags such as --json or --strict may appear before or after the YAML path; OmegaConf overrides remain ordinary key=value tokens.
Primary public CLI
Use the installed public CLI for package-level training:
llmfoundry train <config.yaml> [overrides...]
Examples:
llmfoundry train <pretrain.yaml> \
variables.data_local=<data-local> \
train_loader.dataset.split=train_small \
eval_loader.dataset.split=val_small \
max_duration=10ba \
eval_interval=0 \
save_folder=<save-folder>
llmfoundry train <sft.yaml> \
train_loader.dataset.hf_kwargs.data_dir=<data-local> \
train_loader.dataset.preprocessing_fn=<python.module>:<function> \
max_duration=1ep
For multi-process training, the public command still represents the training entry point, but the cluster or launcher must start the required processes and provide distributed environment variables. Platform job YAMLs are reference-only adaptation material; do not copy account-, cluster-, or credential-specific values blindly.
Boundaries
This sub-skill owns:
- Composer YAML creation and adaptation for pretraining, SFT/instruction tuning, domain adaptation, sequence-length adaptation, and small smoke runs.
TrainConfigrequired/optional fields that affect training, evaluation hooks inside training, callbacks, algorithms, loggers, optimizer/scheduler, save/load/autoresume, precision, FSDP, TP, and batch sizing.- Training launch commands and CLI override strings.
- Training-specific troubleshooting.
Route elsewhere:
- Data conversion schemas, prompt/response conversion tools, and MDS writing details: data-preparation.
- Standalone eval task schema, ICL task authoring, and Eval Gauntlet details: evaluation.
- Checkpoint export to HF/ONNX/FasterTransformer and text generation: inference-conversion.
- Model registry internals, MPT configuration depth, custom package registrations, and API extension design: package-apis-configuration.
Safety rules
- Do not start an unbounded training run while inspecting a config. Probe first, then set explicit
max_duration,eval_interval,save_interval, data split, and checkpoint destination. - Do not use local source checkout paths in runtime instructions. Use placeholders such as
<config.yaml>,<data-local>,<data-remote>,<save-folder>,<load-checkpoint>,<hf-model>, and<run-name>. - Treat model and tokenizer downloads, gated Hugging Face models, object-store checkpoints, MCLI jobs, CUDA kernels, Flash Attention, TransformerEngine, and MegaBlocks as environment-dependent.
- Keep conversion and export out of this sub-skill even when a training checkpoint is the input or output of that later workflow.
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).