package-apis-configuration
Inspect and use LLM Foundry package APIs, registries, MPT/HF model classes, tokenizers, callbacks, optimizers, metrics, loggers, config transforms, optional backends, and MCLI adaptation patterns.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- package-apis-configuration
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Inspect and use LLM Foundry package APIs, registries, MPT/HF model classes, tokenizers, callbacks, optimizers, metrics, loggers, config transforms, optional backends, and MCLI adaptation patterns.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/api-reference.md10.0 KB
- 参考文档references/mcli-platform.md6.3 KB
- 参考文档references/model-configuration.md9.6 KB
- 参考文档references/registry-and-extension.md7.3 KB
- 参考文档references/troubleshooting.md6.8 KB
- 脚本scripts/llmfoundry_api_probe.py11.1 KB
03 SKILL.md 正文
Package APIs and Configuration
Use this sub-skill when the task is about LLM Foundry's installed Python package surface: package import health, registry entries, custom registry extensions, MPT/Hugging Face model constructors, tokenizers, callbacks, optimizers, schedulers, metrics, loggers, configuration transforms, optional dependency gates, or MosaicML platform YAML adaptation.
Start here:
- Use references/api-reference.md for package identity, installed registry entries, public signatures, and builder contracts.
- Use references/model-configuration.md for MPTConfig, MPTForCausalLM, ComposerMPTCausalLM, ComposerHFCausalLM, and ComposerHFT5 configuration rules.
- Use references/registry-and-extension.md for
llmfoundry registry, Python entry points,code_paths,import_file, andconstruct_from_registrypatterns. - Use references/mcli-platform.md for adapting LLM Foundry YAMLs to MosaicML platform/MCLI jobs.
- Use references/troubleshooting.md when imports, registry construction, optional packages, CUDA-only components, credentials, or HF remote-code loads fail.
- Run scripts/llmfoundry_api_probe.py before deeper package work to print package version, registry entries, a tiny MPTConfig check, CUDA availability, and optional dependency status without downloads or training.
Operating rules:
- Prefer registry and signature inspection before instantiating models.
build_tokenizerand Hugging Face model wrappers can download remote assets; do not call them unless the task explicitly allows network/model access. - For CPU-only or quick API checks, override MPT attention to
attn_impl: torchand ComposerMPT loss toloss_fn: torch_crossentropy; defaults favor GPU/flash-attention paths. - Treat registry names as exact keys. If a key is unknown, first confirm the package import completed, then check
llmfoundry registry get <group>or directregistry.<group>.get_all(). - For custom code, prefer a bounded
code_pathsimport file for one run and Python entry points for reusable packages. The imported code must register into the appropriatellmfoundry.registryobject before builders run. - Preserve constructor keyword boundaries: remove
namebefore passing kwargs to constructors, do not pass optimizerparamsthrough YAML, and only pass callbacktrain_configthroughbuild_callback'strain_configargument. - Route full data preparation, training, evaluation, generation, and checkpoint conversion workflows to their owning sub-skills. This sub-skill only covers package APIs/configuration and platform adaptation surfaces.
- Exclude maintenance-only CI, lint, release, and packaging-policy tasks unless they directly affect runtime package import or registry behavior.
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).