inference-conversion
Use LLM Foundry inference helpers for Hugging Face generation, chat, Composer-to-HF conversion, ONNX export, and optional backend routing without owning training or evaluation.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- inference-conversion
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use LLM Foundry inference helpers for Hugging Face generation, chat, Composer-to-HF conversion, ONNX export, and optional backend routing without owning training or evaluation.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/backends-and-export.md7.6 KB
- 参考文档references/conversion-reference.md7.7 KB
- 参考文档references/troubleshooting.md7.9 KB
- 参考文档references/workflows.md7.3 KB
- 脚本scripts/llmfoundry_inference_smoke.py9.7 KB
03 SKILL.md 正文
Inference and Conversion
Use this sub-skill when a task needs to run or prepare LLM Foundry models for inference-time use:
- generate completions or chat interactively with a local or Hub Hugging Face causal LM;
- convert a Composer
Trainercheckpoint into a Hugging Facesave_pretrainedfolder; - export a Hugging Face checkpoint to ONNX;
- reason about advanced FasterTransformer or endpoint-generation prerequisites without running those backends;
- diagnose authentication, object-store, dtype/device, memory, ONNX, or backend-load failures in these workflows.
Operating checklist
-
Identify the artifact the user has now: Hugging Face folder or Hub id, Composer checkpoint, ONNX target folder, FT checkpoint, or endpoint URL.
-
Confirm side effects before taking them: model download, checkpoint conversion, object-store upload, Hugging Face Hub upload, endpoint call, or FT runtime execution.
-
Prefer local, already-available model/checkpoint paths for verification. Do not download private models or upload checkpoints unless the user explicitly provides credentials and asks for it.
-
Run the bundled safe smoke probe first when requirements are unclear:
python scripts/llmfoundry_inference_smoke.py --help -
Route tasks outside this boundary:
- training or producing Composer checkpoints ->
training-finetuning; - MPT internals, registry, or deep config editing ->
package-apis-configuration; - ICL or benchmark evaluation ->
evaluation; - dataset/tokenization preparation ->
data-preparation.
- training or producing Composer checkpoints ->
References
- Generation and chat workflows: references/workflows.md
- Composer/HF/ONNX conversion details: references/conversion-reference.md
- Optional backends, export prerequisites, and smoke probing: references/backends-and-export.md
- Failure-mode triage: references/troubleshooting.md
Guardrails
- Treat FasterTransformer and endpoint generation as advanced reference-only unless the user explicitly asks to run them and the required external service or library is present.
- Never test Hugging Face Hub upload with
--test_uploaded_modelunless the user accepts a network download/reload and has a valid Hub token. trust_remote_codeis powerful: enable it only for model repos or local folders the user trusts.--deviceand--device_mapare mutually exclusive in the HF generation/chat helpers; choose one loading strategy before execution.- Keep full training, eval, and model-internal configuration explanations in their owning sub-skills and link back here only for inference/export decisions.
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).